get the coordinates of an image seperated in two parts

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
Noks

get the coordinates of an image seperated in two parts

Post by Noks »

Hello Everyone,
I am a noob as far as ImageMagic is concerned.I am Using ImageMagick-6.6.4-8-Q16-windows-dll.exe.
I have an image in which there is a green continuous part and a red continuous part.I need to get the coordinates of the line seperating those colors; can some one give me the exact command.And could you people suggest a tutorial to get started with Image MAgic on Windows.
Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: get the coordinates of an image seperated in two parts

Post by fmw42 »

for general reading see http://www.imagemagick.org/Usage/

better to post a link to your image so others can see what you are describing and see if there is some solution.
Noks

Re: get the coordinates of an image seperated in two parts

Post by Noks »

The image is as
http://img841.imageshack.us/img84
i need to get the coordinates of the line seperating the white and the brown part...How do i do that?
Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: get the coordinates of an image seperated in two parts

Post by fmw42 »

Noks wrote:The image is as
http://img841.imageshack.us/img84
i need to get the coordinates of the line seperating the white and the brown part...How do i do that?
Thanks
I don't see anything meaningful at that link. It says 1x1 pixels.
Noks

Re: get the coordinates of an image seperated in two parts

Post by Noks »

Sorry for that Crap...please check this link:
http://postimage.org/image/2v2jfch1g/
thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: get the coordinates of an image seperated in two parts

Post by fmw42 »

see txt: format at http://www.imagemagick.org/Usage/files/#txt

The following converts your image to txt: format, then uses unix to find all pixels that are black, then selects the x,y coordinates and sorts according the the x coordinate.

convert OLV2J-46acc24e.png txt:- | grep "black" | sed -n 's/^\(.*\):.*$/\1/p' | sort -t , -k 1 -n
Noks

Re: get the coordinates of an image seperated in two parts

Post by Noks »

As i told in the first post i am using ImageMagick-6.6.4-8-Q16-windows-dll.exe.On runnning this command in Windows CMD i get an error as:
grep not found...But convert works fine...Which version supports such commands on windows....anyways thanks for the rep...i will use linux and get the work done...
Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: get the coordinates of an image seperated in two parts

Post by fmw42 »

Sorry, I am on a Mac and only know unix. Perhaps one of the Windows users can give you the equivalent commands.

Also see http://www.imagemagick.org/Usage/windows/

Or you can install Cygwin and the IM version for Cygwin. See http://www.imagemagick.org/script/binary-releases.php
Post Reply