From: tomer flo on 19 May 2010 06:45 hey, I have a known closed polygon which represents diffrent pixels on the image. I need to calculate the area of the polygon in Cm. I can use the function 'polyarea' however I get the result in pixels which doesn't help me. I will appreciate any help I can get! thanking you in advance...
From: Sean on 19 May 2010 08:20 "tomer flo" <tomer_fl(a)yahoo.com> wrote in message <ht0fg3$li4$1(a)fred.mathworks.com>... > hey, > I have a known closed polygon which represents diffrent pixels on the image. > I need to calculate the area of the polygon in Cm. cm^2 ? > I can use the function 'polyarea' however I get the result in pixels which doesn't help me. Well what is the cm equivalent of a pixel side? Let's say a pixel is 2cm then each pixel has an area (2cm)*(2cm) = 4cm^2*polyarea_output. See Steven Lord's comment in this thread: http://www.mathworks.com/matlabcentral/newsreader/view_thread/281774#746021
From: Matt J on 19 May 2010 09:22 "tomer flo" <tomer_fl(a)yahoo.com> wrote in message <ht0fg3$li4$1(a)fred.mathworks.com>... > hey, > I have a known closed polygon which represents diffrent pixels on the image. > I need to calculate the area of the polygon in Cm. > I can use the function 'polyarea' however I get the result in pixels which doesn't help me. ======= Can't you just multiply by the area of 1 pixel? In any case, see also CONVHULLN. Assuming its a convex polygon, convhulln will compute the area for you, if you give the vertex coordinates in cm.
From: tomer flo on 19 May 2010 11:40 > Well what is the cm equivalent of a pixel side? Let's say a pixel is 2cm then each pixel has an area (2cm)*(2cm) = 4cm^2*polyarea_output. > > See Steven Lord's comment in this thread: > http://www.mathworks.com/matlabcentral/newsreader/view_thread/281774#746021 I read Steven Lord's comment and I understood I need some kind of known reference distance in the image in order to do convertion between pixels to cm. the problem is that I don't know the square of one pixel in cm.... my question is: if don't know any distance in the image (for example: distance between 2 objects in the image) is there other way to do the convertion? thanks
From: Matt J on 19 May 2010 12:01 "tomer flo" <tomer_fl(a)yahoo.com> wrote in message <ht10p8$oh$1(a)fred.mathworks.com>... > > my question is: if don't know any distance in the image (for example: distance between 2 objects in the image) is there other way to do the convertion? ====== No.
|
Pages: 1 Prev: Connecting PMSM block to SimMechanics Next: Problem with colorbar |