Page 2 of 3

Re: getting the edges of an image

Posted: 2011-05-14T08:27:22-07:00
by Bonzo
Are you running the same code posted and using the same image?

Re: getting the edges of an image

Posted: 2011-05-14T09:20:07-07:00
by HugoRune
perhaps the output file is opened in another program, so convert cannot write to it?
check the last-changed date of "christmas_tree_01_alpha_edge2n.png" to make sure convert actually writes to the file.
Or delete the output file first, and rerun the command.

also
type

convert -version

what does it tell you?

Re: getting the edges of an image

Posted: 2011-05-16T01:33:00-07:00
by sin
http://img852.imageshack.us/img852/1784/sneg.png

the above image has some blur and unwanted stuff. how should i clean up this image so that i can get only the outline of the image??

Re: getting the edges of an image

Posted: 2011-05-16T02:46:58-07:00
by sin
http://img852.imageshack.us/img852/1784/sneg.png

please tel me how can i clean up this image(like the black ones at the top and around the image.everything should be white except the image) so that i cna get only the outline of the image and i dont want the unwanted stuff around it.

Re: getting the edges of an image

Posted: 2011-05-16T02:48:15-07:00
by sin
Bonzo wrote:Are you running the same code posted and using the same image?
yes sir.i ma using the same image.

Re: getting the edges of an image

Posted: 2011-05-16T06:43:07-07:00
by HugoRune
sin wrote:http://img852.imageshack.us/img852/1784/sneg.png

the above image has some blur and unwanted stuff. how should i clean up this image so that i can get only the outline of the image??
If that is the image you are starting with, you could use the conditional erode method used in this thread:
viewtopic.php?f=1&t=18707

However there seems to be little point in tackling that entirely new problem before your old one is solved.
Did you try the suggestions above, and what where the results?

Re: getting the edges of an image

Posted: 2011-05-16T07:04:22-07:00
by sin
HugoRune wrote:
sin wrote:http://img852.imageshack.us/img852/1784/sneg.png

the above image has some blur and unwanted stuff. how should i clean up this image so that i can get only the outline of the image??
If that is the image you are starting with, you could use the conditional erode method used in this thread:
viewtopic.php?f=1&t=18707

However there seems to be little point in tackling that entirely new problem before your old one is solved.
Did you try the suggestions above, and what where the results?

no sir.
i have tried for the chistmas tree example also but it is not working :( . the result is complete white or complete black(depending on the background). So i started working in the other way(this is the other way) using "monochrome" and getting the edges(without alpha extraction--because extracting alpha is just giving me the blank image). The recently posted image is the result of getting the edges but you can see there is some noise. the problem in finding the edges without alpha extraction is "it dependent on the design of the dress the person is wearing in the image(hope this won't be a problem with alpha extraction). In the image i have sent you the person is wearing a plane dress."

so please show me a way to overcome these two problems

Re: getting the edges of an image

Posted: 2011-05-16T08:12:07-07:00
by HugoRune
The noise from sneg.png is mostly removed with
convert sneg.png -morphology close diamond sneg_cleaned.png
( http://www.imagemagick.org/Usage/morphology/#basic for details )

however, depending on the original image there are probably better options to get the outline that do not produce that much noise to begin with.

As for the previous problem, please try the sugestions above and report back, in particular these ones:
type

convert -version

what does it tell you?
What is your exact command and what is the exact error message?
check the last-changed date of "christmas_tree_01_alpha_edge2n.png" to make sure convert actually writes to the file.
Or delete the output file first, and rerun the command.

Re: getting the edges of an image

Posted: 2011-05-17T11:12:44-07:00
by Werty
Works on my Win7 32-bit with IM 6.6.3.0.

Re: getting the edges of an image

Posted: 2011-05-18T00:22:12-07:00
by sin
Werty wrote:Works on my Win7 32-bit with IM 6.6.3.0.

really?
can you please send me the download link for the above IM version ?

please.

Re: getting the edges of an image

Posted: 2011-05-19T12:13:16-07:00
by sin
hi,

please give the download link for IM 6.6.3.0 for windows 7(32-bit).

it seems that the alpha extraction is working well in that version. i am using latest version of imagemagick 6.6.9(windows 7) but i don't understand why it is not working in my pc :( :(

please solve my problem.!!!!

all my work has been halted because of this :(

Re: getting the edges of an image

Posted: 2011-05-19T12:57:34-07:00
by fmw42

Re: getting the edges of an image

Posted: 2011-05-24T04:37:07-07:00
by sin
thank you. it is working for the previous version.

but the problem is it is not working only for the images with plane backgrounds or plane transparent ones.
can i get the image outline(like christmas tree) for the following images??

http://img807.imageshack.us/img807/8774/ihbhju.jpg

http://img542.imageshack.us/img542/244/nkjdc.png

Re: getting the edges of an image

Posted: 2011-05-24T10:34:10-07:00
by fmw42
sin wrote:thank you. it is working for the previous version.

but the problem is it is not working only for the images with plane backgrounds or plane transparent ones.
can i get the image outline(like christmas tree) for the following images??

http://img807.imageshack.us/img807/8774/ihbhju.jpg

http://img542.imageshack.us/img542/244/nkjdc.png

Those images will be very hard to remove the background as the background is not uniform. You will likely need to trace the outline manually. Alternately, see background removal at http://www.imagemagick.org/Usage/masking/#bg_remove

Re: getting the edges of an image

Posted: 2011-09-03T22:34:31-07:00
by sin
fmw42 wrote:

Code: Select all

Not Found

The requested URL /openclipart/clipart/recreation/holiday/christmas/christmas_tree_02_l.png was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I searched google and found another image. So here are two possible approaches.

Image

Convert to grayscale, extract edges, flatten alpha channel to black:
convert christmas_tree_01.png -colorspace gray -edge 2 -background black -flatten christmas_tree_01_gray_edge2_flat.png
Image

Extract alpha channel, extract edge from alpha channel:
convert christmas_tree_01.png -alpha extract -edge 2 christmas_tree_01_alpha_edge2.png
Image

see
http://www.imagemagick.org/script/comma ... s.php#edge
http://www.imagemagick.org/Usage/transform/#edge
http://www.imagemagick.org/Usage/masking/#alpha_extract



can you please tell me the perlmagick code for these commands?