Stuck? Need help? Ask questions on our forums.

Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 553
Number of posts: 958

This Forum Only
Post New Thread

Report
Image Processing...Please Help Posted by warer on 15 Jul 2009 at 9:03 PM
Hello,

I am trying to write a matlab code to calculate the area of a specific region of a jpeg image using pixel size. To do so, I have two user defined functions. Users select these points by clicking on the image. The coordinates are then stored. I need to then apply a 2D median filter to create a binary image. I then need to use something (probably a while loop?) to detect the intensity edge of the image. The cut off intensity value would be the mean intensity of the image at the second user defined clicking point plus or minus 2 standard deviations. Intensity values below would be those found in this region. Intensity values above this cut off value would indicate the border/edge of the intensity at that particular y value. Then, it would record the x value at which the intensity difference happened in an array and move on to the next y coordinate value until reaching the upper y-coordinate limit (defined by the user click).

After obtaining this array between points (x1, y1) and (x2, y2), the distance between point (x1, y1) and (xa,ya) would be calculated using the distance formula (sqrt((x2-x1)^2=(y2-y1)^2)) until the distance reached an arbitrary value of 20 pixels. The value at which the distance is 20 pixels would be defined as the radius. The image should then be rotated by an angle defined by tan-1(|Yradius-y1|/|Xradius-x1|), to place this radius on a horizontal line with the initial user defined click.

After rotation, the same iteration process to find the intensity should be done for the image in this newly rotated state, except with the initial array varying in the x direction, and edge detection in the y-direction. Because here I need to calculate the area, after reaching the differing (higher) intensity value, I will need to count the number of pixels it took to get to this newly defined edge (in both the positive and negative direction). This will be done for each x value between the range of x1 of the user defined click, and the new radius coordinate point X. Then, to get the total distance (number of pixels) at each x value, I must find the distance between the y values.

Would anyone be able to tell me how to do/start tackling this task? I’m kind of new at this MATLAB thing.

Thanks.

Report
Re: Image Processing...Please Help Posted by siti_mam on 27 Oct 2009 at 6:31 PM
Hi..

maybe this might help..
try to download the toolbox from this link
http://www.mathworks.com/matlabcentral/fileexchange/1596-imroi

i assume that you have already know on how to implement the toolbox in the matlab environment.

This toolbox helps me a lot when i'm tried to calculate the actual area of a specific regions. First, you have to try with your own image, then you have to click on the region or area that you want to trace. The final results will show you the area (in terms of pixels), mean, median and some statistics values based on the traced regions.

In my case, I have made some modification on the source code so that it fits to my image.. some unnecessary part is also removed.

OK, good luck!!!

-Salmah Yasiran-



 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A bootstrapLabs project.