detect object and crop around it?
Posted: 2019-09-01T11:24:06-07:00
I have 4k+ pics of each cross in a cemetery and I would like to crop it out from rest of photo.
Samples...
https://pasteboard.co/IvqlunU.jpg
https://pasteboard.co/Ivqm32E.jpg
https://pasteboard.co/IvqoLOm.jpg
https://pasteboard.co/Ivqp2D5.jpg
My limited knowledge I came up with this and ran it through a loop, and this did OK
magick convert infile.jpg -crop 1800x2000+1400+1300 +repage infile-cropped.JPG (optimize for web viewing while saving needs to be added.)
Some of the crosses are cut off because the cross falls outside of the crop region. So. I thought that maybe someone can tell me how to dynamically locate cross and crop it out replacing my 1400+1300 offset I had hard coded.
2nd requirement is to make the letters more legible. I have no clue where to start.
Any other suggestions to improve the cropped image would be appreciated, maybe deskew cross, but you are only seeing one at a time, I am now sure it is important.
3rd requirement would be to remove the overlapping cross in background of last two sample images and replace with green grass.
thank you so much
Samples...
https://pasteboard.co/IvqlunU.jpg
https://pasteboard.co/Ivqm32E.jpg
https://pasteboard.co/IvqoLOm.jpg
https://pasteboard.co/Ivqp2D5.jpg
My limited knowledge I came up with this and ran it through a loop, and this did OK
magick convert infile.jpg -crop 1800x2000+1400+1300 +repage infile-cropped.JPG (optimize for web viewing while saving needs to be added.)
Some of the crosses are cut off because the cross falls outside of the crop region. So. I thought that maybe someone can tell me how to dynamically locate cross and crop it out replacing my 1400+1300 offset I had hard coded.
2nd requirement is to make the letters more legible. I have no clue where to start.
Any other suggestions to improve the cropped image would be appreciated, maybe deskew cross, but you are only seeing one at a time, I am now sure it is important.
3rd requirement would be to remove the overlapping cross in background of last two sample images and replace with green grass.
thank you so much