The GetDPI Photography Forum

Great to see you here. Join our insightful photographic forum today and start tapping into a huge wealth of photographic knowledge. Completing our simple registration process will allow you to gain access to exclusive content, add your own topics and posts, share your work and connect with other members through your own private inbox! And don’t forget to say hi!

Computing Box Dimensions using relative object

E

ebij

Guest
Hi every one, im actually new in image processing, i want to make an algorithm im Matlab which allows me to get the dimensions of the box out of image using a relative object so with knowing the length of that object i get all dimensions of the box. how do you think its possible to do this? i would appropriate your cooperation in advance :)
 

MGrayson

Subscriber and Workshop Member
Disclaimer: I don't know the answer. But I know how I would figure it out. One problem you have is that you have to know relatively how far away the box and the object are. Otherwise the box could be twice as big and twice as far away and the picture would look exactly the same (I'm discounting DoF effects.)

You're trying to back out 3-dimensional data from a 2-dimensional projection, which is ordinarily impossible. Fortunately, you have the extra information that the box is rectangular. I'd use a symbolic manipulator (Mathematica, Maple, or their ilk) and work out the formulas for the projection of the corners of an arbitrarily rotated box. Yes, this is doable by hand, but I've gotten lazy and computers are powerful. Then solve for the original box dimensions given the positions of the visible corners in your photograph. There will be a single undetermined scale factor that you'll have to get from the object (see the paragraph above), but that's the easy part.

Good luck, and have fun!

Matt
 
Top