Trim left and top based on index image
Posted: 2016-07-18T16:40:48-07:00
Hi Guys... I'm trying to trim the top and left of a registration based on a barcode and block rectangle. See image...
https://goo.gl/photos/rFDiKzzhUeKoWWiu7
Here is the code I'v tried, but have gotten inconsistent behavior...
Here is an image of what I am looking to achieve...
https://goo.gl/photos/zitxKiGLKhNbg76SA
ImageMagick version...
https://goo.gl/photos/rFDiKzzhUeKoWWiu7
Here is the code I'v tried, but have gotten inconsistent behavior...
Code: Select all
convert input.jpg -gravity NorthWest -crop \
`convert input.jpg -canny 0x1+10%+30% -virtual-pixel edge -blur 0x5 -fuzz 10% -trim \
-format '%[fx:w-20]x%[fx:h-20]+%[fx:page.x-10]+%[fx:page.y-10]' \
info:` +repage output_trimmed.jpg
https://goo.gl/photos/zitxKiGLKhNbg76SA
ImageMagick version...
Any assistance would be appreciated...Version: ImageMagick 6.9.5-2 Q16 x86_64 2016-07-13 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib