i want to Isolates a contiguous region of an image based upon a color determined from a user specified image coordinate.
exec("./magicwand.sh 160,200 -t 25 -f image -r outside -c wheat 1front.jpg 1frontcolor.jpg");
please provide correct way to write this code.
magicwand
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: magicwand
Code: Select all
convert image -fill red -fuzz 1% -draw 'color 10,10 floodfill' result
http://www.imagemagick.org/Usage/color_ ... dfill_draw
Also Draw Color Fill Primitives
http://www.imagemagick.org/Usage/draw/#color
However more detail of exactly what your situation is would help.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: magicwand
ratneshsoni wrote:i want to Isolates a contiguous region of an image based upon a color determined from a user specified image coordinate.
exec("./magicwand.sh 160,200 -t 25 -f image -r outside -c wheat 1front.jpg 1frontcolor.jpg");
please provide correct way to write this code.
There was a bug that was fixed recently. Please download the current version and try again with a current version of IM. You may also need to provide the full path to magicwand.sh and possibly your images if they are not in the same directory. Also see how to get error messages from the exec command. See Rubblewebs.com
Or use the more direct method pointed out by Anthony above in his examples.
Last edited by fmw42 on 2010-12-21T19:46:47-07:00, edited 1 time in total.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: magicwand
Apologies I did not realize you were talking about one of Fred Weinhaus's scripts.
For those trying to follow this discussion see the script provided at
http://www.fmwconcepts.com/imagemagick/magicwand/
For those trying to follow this discussion see the script provided at
http://www.fmwconcepts.com/imagemagick/magicwand/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: magicwand
I want to perform same task, but on multiple areas in the image, to isolate them (just like when you do "invert selection" after using "magic wand" in graphic programs).i want to Isolates a contiguous region of an image based upon a color determined from a user specified image coordinate.
exec("./magicwand.sh 160,200 -t 25 -f image -r outside -c wheat 1front.jpg 1frontcolor.jpg");
please provide correct way to write this code.
Can ImageMagick produce as output all the coordinates of the groups of pixels, in such a way I can process them to determine edges of each box which include each area?
I have a scanned text page; I want to"detect" each single word and save each one of them to a separate file.
I'm currently merging all letters of each word into single "blobs" using this command:
Code: Select all
convert test.gif -morphology Erode Rectangle:8x3 test2.gif
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: magicwand
What you want is to segment the image! Nothing to do with this topic.
Look in Users Forum. There is discussions on this there.
Look in Users Forum. There is discussions on this there.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: magicwand
You could try my script separate to get each segment as a separate binary image, then edge detect, then convert that to txt: format and read out all the edge pixels. See link below. But without seeing your image, I don't know if it is conducive to my script.
Re: magicwand
no, i want to select white background with magicwand and then invert selection: is this feasible?anthony wrote:What you want is to segment the image! Nothing to do with this topic.
.
@fmw42:
this pic shows how I "melt" all chars of a word into single blobs; then I want to enclose each one into a box. Can your scripts be used together to get this result?