Vampyre Imaging Library Forum

Imaging Category => Help & Questions => Topic started by: jsoques on 6 August 2010, 22:37:41

Title: Measuring and object in an image.
Post by: jsoques on 6 August 2010, 22:37:41
Does anyone know how to use this library to get the measurements of an object in an image with a reference scale in the image? For example, I have an object known to be 5 cm wide, so another object's width beside it can be deduced.

Thanks
Javier
Title: Re: Measuring and object in an image.
Post by: Galfar on 11 August 2010, 16:25:27
I'm not really sure what are you trying to measure, maybe some illustrations could help?
Title: Re: Measuring and object in an image.
Post by: jsoques on 11 August 2010, 21:12:08
Let´s say I have an image of an insect and beside the insect I have also an object of know size (a dime , let´s say). So I know the size of the dime, from that size how would I go about calculating the size of the insect. Of course, I´m not looking for exact precision, but a close enough measurement would be good.

I hope that explains somewhat what I´m trying to achieve.

Thanks
Title: Re: Measuring and object in an image.
Post by: wp on 13 August 2010, 14:26:51
Simple math: if the true size of the insect is S(cm, ins), the true size of the dime S(cm, dime), the pixel size of the insect S(pixels, ins), and the pixel size of the dime is S(pixel, dime) then

S(cm, ins) = S(cm, dime) * S(pixel, ins) / S(pixel, dime)
Title: Re: Measuring and object in an image.
Post by: jsoques on 13 August 2010, 15:43:41
@wp, thanks. I suppose that's the math part, but I would also like to know how it would be done programatically with this imaging library.