Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Distance Calculation

Subject: Distance Calculation

From: Bernard

Date: 2 Dec, 2008 11:51:02

Message: 1 of 5

I am a beginner in Matlab. i have to find the minimum distance between 2 boundries in different images in different orientations.
Can somebody help me by giving me the skeleton codes so that i can follow them.
I have started by changing it to binary and placing a disk strel and a imopen filter.
Is there anything else i should do?

Subject: Distance Calculation

From: ImageAnalyst

Date: 2 Dec, 2008 16:40:11

Message: 2 of 5

On Dec 2, 6:51=A0am, "Bernard " <mohinder_...@yahoo.com> wrote:
> I am a beginner in Matlab. i have to find the minimum distance between 2 =
boundries in different images in different orientations.
> Can somebody help me by giving me the skeleton codes so that i can follow=
 them.
> I have started by changing it to binary and placing a disk strel and a im=
open filter.
> Is there anything else i should do?

---------------------------------------------
Bernard:
Does each image have two boundaries in it, and you have many images
like that, or does each image have one boundary?
MATLAB has a skeletonization routine included in the image processing
toolkit (which you have). It's an option of the bwmorph() function.
Skeletonization has nothing to do with morphological opening, so
you're starting down the wrong path. Just use the built-in
skeletonization function. After that, call bwboundaries to get the
boundaries, and then just use brute force to scan each boundary to
calculate the distance of each boundary pixel to each boundary pixel
of the other boundary.
Regards,
ImageAnalyst

Subject: Distance Calculation

From: Bernard

Date: 9 Dec, 2008 02:23:02

Message: 3 of 5

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <c88400e0-ee3a-4066-9ec3-8cf1f82eb173@d32g2000yqe.googlegroups.com>...
> On Dec 2, 6:51=A0am, "Bernard " <mohinder_...@yahoo.com> wrote:
> > I am a beginner in Matlab. i have to find the minimum distance between 2 =
> boundries in different images in different orientations.
> > Can somebody help me by giving me the skeleton codes so that i can follow=
> them.
> > I have started by changing it to binary and placing a disk strel and a im=
> open filter.
> > Is there anything else i should do?
>
> ---------------------------------------------
> Bernard:
> Does each image have two boundaries in it, and you have many images
> like that, or does each image have one boundary?
> MATLAB has a skeletonization routine included in the image processing
> toolkit (which you have). It's an option of the bwmorph() function.
> Skeletonization has nothing to do with morphological opening, so
> you're starting down the wrong path. Just use the built-in
> skeletonization function. After that, call bwboundaries to get the
> boundaries, and then just use brute force to scan each boundary to
> calculate the distance of each boundary pixel to each boundary pixel
> of the other boundary.
> Regards,
> ImageAnalyst

got yr msg..but wad i meant was,i got 2 images of animals,i need to find the minimum distance between them. i knw i shd go ahead by using eculidean distance method.but i wan to knw the procedure on how to go abt doin so.i did strel disk and imopen function. then im lost.i need to knw the codes to continue till i get the minimum distance.im really bad at this.if you hve an e-mail,it would be helpful so that i can commounicate better wif u.

Subject: Distance Calculation

From: ImageAnalyst

Date: 9 Dec, 2008 03:51:22

Message: 4 of 5

On Dec 8, 9:23=A0pm, "Bernard " <mohinder_...@yahoo.com> wrote:
> ImageAnalyst <imageanal...@mailinator.com> wrote in message <c88400e0-ee3=
a-4066-9ec3-8cf1f82eb...@d32g2000yqe.googlegroups.com>...
> > On Dec 2, 6:51=3DA0am, "Bernard " <mohinder_...@yahoo.com> wrote:
> > > I am a beginner in Matlab. i have to find the minimum distance betwee=
n 2 =3D
> > boundries in different images in different orientations.
> > > Can somebody help me by giving me the skeleton codes so that i can fo=
llow=3D
> > =A0them.
> > > I have started by changing it to binary and placing a disk strel and =
a im=3D
> > open filter.
> > > Is there anything else i should do?
>
> > ---------------------------------------------
> > Bernard:
> > Does each image have two boundaries in it, and you have many images
> > like that, or does each image have one boundary?
> > MATLAB has a skeletonization routine included in the image processing
> > toolkit (which you have). =A0It's an option of the bwmorph() function.
> > Skeletonization has nothing to do with morphological opening, so
> > you're starting down the wrong path. =A0Just use the built-in
> > skeletonization function. =A0After that, call bwboundaries to get the
> > boundaries, and then just use brute force to scan each boundary to
> > calculate the distance of each boundary pixel to each boundary pixel
> > of the other boundary.
> > Regards,
> > ImageAnalyst
>
> got yr msg..but wad i meant was,i got 2 images of animals,i need to find =
the minimum distance between them. i knw i shd go ahead by using eculidean =
distance method.but i wan to knw the procedure on how to go abt doin so.i d=
id strel disk and imopen function. then im lost.i need to knw the codes to =
continue till i get the minimum distance.im really bad at this.if you hve a=
n e-mail,it would be helpful so that i can commounicate better wif u.- Hide=
 quoted text -
>
> - Show quoted text -

------------------------------------------
Bernard:
Why didn't you answer my first question? OK there are only two
images. But how many animals are in image1 and how many are in image
2, and precisely what distance between what two (or more) animals are
you trying to find the distances for? Are the animals in the same
image or different images? For example, image 1 had two baboons and
image 2 has 42 meerkats and you want to find the distance between the
two baboons and the distance between all permutations of the 42
meerkats? Or image 1 has 3 lions and image 2 has the same 3 lions
that have walked somewhere else in the scene and you want to find out
how far each one walked. What you've said is ambiguous - you need to
be more clear.

Anyway, here is some demo code from an earlier post of mine that shows
some simple blob analysis.
http://tinyurl.com/5jntgr
Regards,
ImageAnalyst

Subject: Distance Calculation

From: Walter Roberson

Date: 9 Dec, 2008 04:20:34

Message: 5 of 5

Bernard wrote:

> if you hve an e-mail,it would be helpful so that i can commounicate better wif u.

Historically, the person you were addressing has expressed considerable disinterest
in communicating with anyone who uses text-messaging style postings.

I would suggest that when you are communicating with a professional, seeking the
professional's assistance, that it is ill-done on your part not to spell
out words to the best of your ability. If your native language is not English,
then allowances are made for that -- but no reputable school would teach
anyone to use phrases such as "i knw i shd".

--
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?

Tags for this Thread

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.

Contact us