[ILUGC] Re: Need help on slicing a big image to small images
- From: Arun Venkataswamy <arun289@xxxxxxxxx>
- To: ilugc@xxxxxxxxxxxxx
- Date: Sat, 16 Sep 2017 12:40:16 +0530
On Sat, Sep 16, 2017 at 1:05 AM, Shrinivasan T <tshrinivasan@xxxxxxxxx>
wrote:
tried using convert
convert template_01.jpg -crop 19x19@ +repage +adjoin output_2x2_%03d.jpg
still this is not perfect. it overlaps many boxes.
For using automated tiling the image needs to be mathematically normalised.
I see that each slot is 142x165
There are 19x13 slots, so the image should be 2698x2145 (142*19x165*13)
Also, the starting pixel should be the first slot's start (the line in this
case). In the original image, there was a white space of 1 pixel and this
will lead to a 'creep error' of x19pixels when we tile. I have removed this
also.
Then run the command:
convert -crop 19x13@ +repage template-03.jpg tiles/tile_%03d.jpg
Results are here:
https://m45.in/share/tiles.tgz
https://m45.in/share/template-03.jpg
There are still some minor creep. This is possibly because of a bad scan (?)
Try saving the scan as a PNG too which is a lossless format.
I would suggest some kind of edge markers in the printout before scanning
to help get exact orientation for the tiling.
Otherwise, this could be a good openCV/tensor flow project for students to
automatically detect the slots and extract them using computer vision and
machine learning.
Regards,
Arun Venkataswamy
http://wondroussky.blogspot.in/
"à®à®±à¯à®±à®¤à¯ à®à¯à®®à®£à¯ à®
ளவà¯, à®à®²à¯à®²à®¾à®¤à®¤à¯
à®à®²à®à®³à®µà¯" - à®à®µà¯à®¯à®¾à®°à¯
Known is a drop, Unknown is an ocean
_____________________________________
ILUGC List:
http://www.freelists.org/list/ilugc
ILUGC Web:
http://ilugc.in/
Other related posts: