Your image is not still good enough to work on. So I made one and show how to do it.
Let say this is your picture
XX = (# + RandomReal[{-.1, .1}]) & /@ Range[19];
XX = Join[{0}, XX, {20}];
YY = (# + RandomReal[{-.1, .1}]) & /@ Range[19];
YY = Join[{0}, YY, {20}];
img = ContourPlot[Evaluate[Join[(y == #) & /@ XX, (x == #) & /@ YY]],
{x, -0.01, 20.01}, {y, -0.01, 20.01},Frame -> False, PlotRangePadding -> 1,
ContourStyle -> Black, Epilog ->
Table[{Hue[RandomReal[{0, 0.1}]],
Disk[{i - 0.5, j - 0.5}, 0.3 + RandomReal[0.1]]}, {i, 20}, {j,
20}], ImageSize -> 400] // Rasterize

First I Import
the image
img = ImageResize[img, 400]
Now I have to find the position of the black lines. For that I will take a stripe and find the location of black pixel. You may have to do it few times to get the exact values.
{Lx, Ly} = ImageDimensions[img]
ImageTake[img, {25, 30}, {1, Lx}] // Sharpen;
XX = ImageValuePositions[%, Black, 0.2][[All, 1]] // Union;
XX = DeleteDuplicates[XX, EuclideanDistance[#1, #2] <= 5 &];
ImageTake[img, {1, Ly}, {293, 295}] // Sharpen;
YY = ImageValuePositions[%, Black, 0.2][[All, 2]] // Union;
YY = DeleteDuplicates[YY, EuclideanDistance[#1, #2] <= 5 &];
nx = Length[XX]
ny = Length[YY]
Now you have the location of the lines stored in XX
and YY
. So go ahead with ImageTake
.
Table[ImageTake[img, {XX[[i]], XX[[i + 1]]}, {YY[[j]], YY[[j + 1]]}],
{j, ny - 1}, {i, nx - 1}];
%[[1]]

If you want to get rid of the black lines, use ColorReplace
. Only tricky part is to choose the slice. For example when you are finding XX
do not take slice which has a horizontal line. Same for YY
ImageTake
? $\endgroup$