     1function [v,size_of_img,grid_size] = MLS_getPoints(img1,stepX,stepY)
     2%UNTITLED5 Summary of this function goes here
     3%   Detailed explanation goes here
     4
     5% inconsistent coordinate system - world standard seems to be:
     6% +--------> x,i=width
     7% |
     8% |
     9% |
    10% V y,j=height
    11[imh,imw,rgb]=size(img1);
    12v=[];
    13for i = 1:stepX:imw+stepX
    14
    15    if i >= imw; i = imw; end
    16
    17    for j = 1:stepY:imh+stepY
    18%         if (j == 1) && (i==1); continue;end % skip the [1,1] point (already created)
    19        if j >= imh; j = imh; end % hit the end row of column
    20        v = [v;[j,i]] ;           % append the eval point
    21        if j == imh; break;end    % next colimn
    22    end
    23
    24    if i == imw; break;end        % end after last columm
    25end
    26size_of_img = [imh,imw];
    27grid_size = [stepY,stepX];
    28end