I have an image in which there is a rectangle with custom border (anyhow I want). There is an image drawn inside the rectangle.I need to crop the outer image to the rectangle border.So I need to detect the rectangle border inside the image.Any ideas how do I do that? I've looked at 'Imagick' but I cant seem to find out a solution. Any help would be appreciated
I want to then crop the image inside the rectangle.
How to detect a custom border (rectangle) inside an image?
Re: How to detect a custom border (rectangle) inside an image?
I would suggest you upload an image somewhere and share a link here.
Also what version of Imagemagick you are using along with your preferred code - you want to use Imagick?
Also what version of Imagemagick you are using along with your preferred code - you want to use Imagick?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to detect a custom border (rectangle) inside an image?
If your custom border is visually distinctive, this is possible. For example, the border contains a distinctive colour such as pure red that does not occur elsewhere. Then you can simply turn all non-red pixels white, and "trim" gives the location of the border.
The same principle applies to any distinctive marking.
I'm moving this to the Users forum.
The same principle applies to any distinctive marking.
I'm moving this to the Users forum.
snibgo's IM pages: im.snibgo.com