Shape Recognition

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Shape Recognition

Christian Mayer CFN
Hi
1) I have a lot of pictures from not ideal dots and squares. They are
done by a ebeam-writer and wet chemical etching and because of that they
differ slightly in their shape,size,angle,etc and also their edges are
not 100% straight and smooth.
Also the dots are elliptical sometimes because of stigmation.
I need to measure the size/diameter and the aspect ratio (major divided
by minor axis) of the dots/squares and I want to have the discrepancy of
the ideal shape(see the red area in the picture) with the measured
shape(blue).So it would be great if there is something like the
discrepancy = red_area minus blue_area divided by red_area so that I can
quantify that the red Square looks much better than the left one.
2)As I have to do this with thousands of pictures it would be really
great if the program/script could do that automatically and I just have
to say to it which folder it has to use and saves the measured data with
the name of the picture as txt or xls or whatever.

Im pretty sure that this is possible with Imagej, but as I cant program
Im hoping that one of you could help me.
Thanks alot!!

Greets
Christian




imagej.GIF (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Shape Recognition

dscho
Hi Christian,

On Mon, 12 Sep 2011, Christian Mayer CFN wrote:

> 1) I have a lot of pictures from not ideal dots and squares. They are
>    done by a ebeam-writer and wet chemical etching and because of that
>    they differ slightly in their shape,size,angle,etc and also their
>    edges are not 100% straight and smooth.

A picture says more than a thousand words, they say. Or: could you send an
example image? It is hard to assess the situation from textual information
only.

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: Shape Recognition

Michael Schmid
In reply to this post by Christian Mayer CFN
Hi Christian,

if your rectangles are unrotated, you have everything in 'Analyze  
Particles' with suitable Measurement options: Bounding Rectangle and  
Area

If they are all rotated the same direction (which they probably  
should be?), get the Feret angles, and find the preferred direction.  
You can use all objects to get a statistical average of all Feret  
angles:
Feret angles are ambiguous, in your case with rectangles you can add/
subtract multiples of 90 degrees and still have the objects aligned  
correctly.

So you could try this:

x = cos(4*FeretAngle_in_radians)
y = sin(4*FeretAngle_in_radians)
rotation angle = atan2(sum of all y, sum of all x)e

Then unrotate the image, and proceed with measuring Bounding  
Rectangles and Areas

If you want, you can even apply statistical weights to the individual  
rectangles, depending on how sure you are about the Feret Angle of  
each (e.g. the closer it is to MaxFeret/MinFeret = sqrt2, and area =  
minFeret^2 the more it looks like a perfect square).

Michael
________________________________________________________________

On 12 Sep 2011, at 14:16, Christian Mayer CFN wrote:

> Hi
> 1) I have a lot of pictures from not ideal dots and squares. They  
> are done by a ebeam-writer and wet chemical etching and because of  
> that they differ slightly in their shape,size,angle,etc and also  
> their edges are not 100% straight and smooth.
> Also the dots are elliptical sometimes because of stigmation.
> I need to measure the size/diameter and the aspect ratio (major  
> divided by minor axis) of the dots/squares and I want to have the  
> discrepancy of the ideal shape(see the red area in the picture)  
> with the measured shape(blue).So it would be great if there is  
> something like the
> discrepancy = red_area minus blue_area divided by red_area so that  
> I can quantify that the red Square looks much better than the left  
> one.
> 2)As I have to do this with thousands of pictures it would be  
> really great if the program/script could do that automatically and  
> I just have to say to it which folder it has to use and saves the  
> measured data with the name of the picture as txt or xls or whatever.
>
> Im pretty sure that this is possible with Imagej, but as I cant  
> program Im hoping that one of you could help me.
> Thanks alot!!
>
> Greets
> Christian
>
>
>
> <imagej.GIF>