MATLAB: Segment grid boxes

boundarybraillefeature extractiongridimage segmentation

rgb = imread('peppers.png');
imshow(rgb)
hold on
M = size(rgb,1);
N = size(rgb,2);
for k = 1:25:M
x = [1 N];
y = [k k];
plot(x,y,'Color','w','LineStyle','-');
plot(x,y,'Color','k','LineStyle',':');
end
for k = 1:25:N
x = [k k];
y = [1 M];
plot(x,y,'Color','w','LineStyle','-');
plot(x,y,'Color','k','LineStyle',':');
end
hold off
Suppose I want to segment and extract individual areas of the grid .. How do I go about it ? Like, which boundary detection algorithm is used for this purpose ?

Best Answer

Regular rectangular grids, or potentially irregular spacing?
If it is a regular rectangular grid, crop to contain only full cells, detect the grid line separation, then mat2cell() or blkproc() or blockproc()