getting correct mask

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
ashwini
Posts: 10
Joined: 2012-01-30T05:55:49-07:00
Authentication code: 8675308

getting correct mask

Post by ashwini »

hi all..
thanks for viewing..

i am working on region identification of image. i am using Fred's magic wand script .i am working on windows so i extracted the commands of the script and i got satisfactory result as below:
Image

i am giving x,y co-ordinates for selecting region as u can see the black circle mark and 29% tolerance value and got this output which is perfect..
getting exact mask.
Image

but when i tried for below image the results are not satisfactory
Image
for 20% tolerance
output:
Image
i want only the mask of selected furniture right hand sofa .
if i am decresing the toleance value to 19% got the below output which is not giving whole area of right hand furniture which i am selecting
Image
same i faced problem while selecting other region as below
Image
for 21% tolerancefor 21% tolerance
Image
but it is also not proper mask as the curtains also get selected which i dont want only middle sofa should get selected.
what i come to know about magicwand script..that it selects contiguous region from specified x,y co-ordinates and this selection depends also tolerance value.

so can u please tell solution to my problem. Is there is way in magicwand script commands so that i get proper mask.


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

Re: getting correct mask

Post by fmw42 »

My magicwand script will only isolate individual objects not all separate objects of the same color. So you probably need to do it 3 times, once for each green furniture and combine the masks. That is if there is enough color separation between the furniture and the curtains.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: getting correct mask

Post by anthony »

Their are other ways of selecting as well. If you can find a color space that maximized the difference between the objects.

This is actually known as the segmentation problem, and is a major part of image processing which literally hundreds of techniques.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply