I want to do ImagePartition with offset whose offset size is different with x(horizontal) and y(vertical). Here I got Lena image from https://en.wikipedia.org/wiki/Lenna#/media/File:Lenna_(test_image).png
lena=Import["/Downloads/Lenna_(test_image).png"]
Dimensions[ImageData[lena]]
The dimension was 512x512.
I want to part this image into small images, as in the size of horizontal = 80 pixels, verticle = 32pixels. The overlap between images are horizontal = 44 pixels and verticle = 16 pixels.
Since 80 + (80 - 44)x(13 - 1)= 512, 32 + (32 - 16)x(31 - 1)= 512, I think the number of small images become 13 (horizontal) x 31 (verticle). However, when I try
lenap = ImagePartition[lena, {80, 32}, {80 - 44, 32 - 16}]
Dimensions[lenap]
The number of image was 12(horzontal) x 31(verticle). I can't understand why the number of only horizontal images was strange, i.e. not 13... Also, the Image of
lenap[[1,-1]]
should be same as
ImageTake[lena,{1,32},{512-80+1,512}]
However these images are not same, maybe next pictures each other.
If someone who knows how to ImagePartition with offset properly, please help me!
Also, I want to confirm whether the whole image was used for the Image-partition, I want to reconstruct them into one image. I found another question as Inverse ImagePartition with offset I wanted to do the similar thing, but I don't know which parameter I should change... below didn't work.
ImageAssemble[ArrayFlatten[{{Map[ImageTake[#, dh, dw] &,
Drop[part, -44, -16], {2}],
Map[ImageTake[#, dh, {1, -1}] &, part[[;; -2, {-1}]], {2}]}, {Map[
ImageTake[#, {1, -1}, dw] &, part[[{-1}, ;; -2]], {2}],
part[[{-1}, {-1}]]}}]]