exist an method for find extreme points in imagemagick?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

exist an method for find extreme points in imagemagick?

Post by diegomage »

like this

Image

Please help me
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

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

Post by diegomage »

yes i see better draw a rectangle for contain the image and use compare for compare points
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

That link pertains more to your other question.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

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

Post by diegomage »

very thanks
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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?
snibgo's IM pages: im.snibgo.com
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

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

Post by diegomage »

the instersection points between the convex hull and the countour of this hand
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

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

Post by diegomage »

the red points of this image for example

Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply