samedi 18 avril 2015

Crop from binary image (boolean array) in Java

I have a 2D boolean array that is a segmented image and looks like this:



000000000000000000
000000011110000000
000001110111100000
000001111110100000
000000111101100000
000000111011000000


And I want to crop the picture and resize it to a specific size like this:



00111100
11101111
11111101
01111011
01110110


I have tried to use a BufferedImage to save it and use getSubimage() but I can't get the boundaries right...


How can I crop it and resize it?


Aucun commentaire:

Enregistrer un commentaire