Page 1 of 1

exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T17:59:30-07:00
by diegomage
like this

Image

Please help me

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T18:24:31-07:00
by fmw42
If you threshold your hand image and make it white on black showing the hand properly thresholded, then you do -morphology edgein and get the hand outline. Then convert that to txt and filter using grep "white". You will get all edge pixels that way.

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T18:45:40-07:00
by diegomage
yes i see better draw a rectangle for contain the image and use compare for compare points

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T19:09:35-07:00
by snibgo
I think diegomage wants the top-most point of the hand, and the left-most and right-most and bottom-most points.

If so, then make a white hand on a black background. "-trim" finds the bounding rectangle. The first white pixel in that image is the top-most point of the hand. Crop to the first column, and any white pixel in that crop if the left-most point of the hand.

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T19:15:36-07:00
by fmw42
But that does not find the cyan dot in at the lower left of the hand. I think he would need the convex hull corner points. So perhaps see http://www.imagemagick.org/Usage/morpho ... convexhull

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T19:17:05-07:00
by diegomage
i see an example in this post

http://stackoverflow.com/questions/3156 ... -in-opencv


The answer is in imagemagick the title may confuse

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T19:57:13-07:00
by fmw42
That link pertains more to your other question.

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T19:59:59-07:00
by fmw42
You can get the convex hull from the link I provided after thresholding. Then you could try my script corners to find the line vertices of the convex hull. Alternately, use -canny to get the edges and -hough-lines to get straight lines for the edges of the convex hull, then from the straight lines you could find the intersections of the lines. See

viewtopic.php?f=4&t=25405
viewtopic.php?f=4&t=25476

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T20:03:52-07:00
by diegomage
very thanks

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T20:06:47-07:00
by snibgo
I don't know exactly what is wanted. Perhaps the cyan dot is (one of) the bottom-most pixels in the hand.

True, it could be the most south-west point. But the most south-east point isn't wanted?

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T20:17:37-07:00
by diegomage
the instersection points between the convex hull and the countour of this hand

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T20:20:32-07:00
by diegomage
the red points of this image for example

Image

Re: exist an method for find extreme points in imagemagick?

Posted: 2017-03-23T20:29:02-07:00
by snibgo
These are two different problems.
diegomage wrote:the instersection points between the convex hull and the countour of this hand
This would be about 20 pixels. Okay, then get the convex hull (see http://www.imagemagick.org/Usage/morphology/ ) and the edge, and find the intersection.
diegomage wrote:the red points of this image for example
This would be seven pixels. Perhaps these are the vertices of the convex hull.