Thread Subject: image processing basic

Subject: image processing basic

From: Mathew Thomas

Date: 21 Sep, 2009 15:08:06

Message: 1 of 3

Hello,

I have a binary image with just one object in it. For example, two balls connected together... i want to find the shortest distance (go from row to row and find the row that has least number of white pixels in a line).

Thanks in advance for any help

Mathew

Subject: image processing basic

From: ImageAnalyst

Date: 21 Sep, 2009 15:56:51

Message: 2 of 3

On Sep 21, 11:08 am, "Mathew Thomas" <mathe...@gmail.com> wrote:
> Hello,
>
> I have a binary image with just one object in it. For example, two balls connected together... i want to find the shortest distance (go from row to row and find the row that has least number of white pixels in a line).
>
> Thanks in advance for any help
>
> Mathew

-----------------------------------------------------------------------------------------
Matthew:
Just sum horizontally with the sum() function:
verticalProfile = sum(binaryImage, 2);
Then use the min and find functions to find the index which is
minimum, something like (untested)
nonZeroIndexes = find(verticalProfile > 0)
minValue = min(verticalProfile(nonZeroIndexes))
minIndexes = (verticalProfile == minvalue)

Or something close to that - I didn't test the above code but
something like that should work.
Good luck,
ImageAnalyst

Subject: image processing basic

From: Mathew Thomas

Date: 21 Sep, 2009 18:11:05

Message: 3 of 3

Thank you so much. I will try it out right now...

Mathew

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <e6b4f306-6bb5-4a5e-ba7d-85176648f8da@e18g2000vbe.googlegroups.com>...
> On Sep 21, 11:08?am, "Mathew Thomas" <mathe...@gmail.com> wrote:
> > Hello,
> >
> > I have a binary image with just one object in it. For example, two balls connected together... i want to find the shortest distance (go from row to row and find the row that has least number of white pixels in a line).
> >
> > Thanks in advance for any help
> >
> > Mathew
>
> -----------------------------------------------------------------------------------------
> Matthew:
> Just sum horizontally with the sum() function:
> verticalProfile = sum(binaryImage, 2);
> Then use the min and find functions to find the index which is
> minimum, something like (untested)
> nonZeroIndexes = find(verticalProfile > 0)
> minValue = min(verticalProfile(nonZeroIndexes))
> minIndexes = (verticalProfile == minvalue)
>
> Or something close to that - I didn't test the above code but
> something like that should work.
> Good luck,
> ImageAnalyst

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
shortest distan... Mathew Thomas 21 Sep, 2009 11:09:24
rssFeed for this Thread

Contact us at files@mathworks.com