I want to calculate Height and width of object using camera. I have tried for finding angle between camera and object in iphone, i think it will help to get object dimensions!
Any suggestions?
Thanks.
The best way of doing this is to use a reference object. That can be a piece of paper or your id card whose actual dimensions are known to you. Place the reference card near to the object whose dimensions you need to calculate. Take snapshot of both. Somehow calculate the number of pixels covered by card whose actual dimensions are known (I used it using openGL in my iOS Application). Then calculate the number of pixels of the object you want to find dimensions. Comparing both values you can device a formula to get height and width of object.
Above is one solution that might help you. Else you need to calculate distance between object and camera (which is not possible with iPhone, as it has only one camera) and then proceed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With