Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am profoundly disturbed by a request that asks me to develop an iPad app to measure the actual size of an object using camera.

It is simply not practical.

Translating 2D object into 3D is never easy. I either need extra hardware, or have to make a lot of assumptions (which will almost never hold true). Regardless I will need time.

However, the person who requested me to develop the app is adamant of his vision. And he tries to show that he is right by listing a number of existing apps that do similar jobs. He does not realize that all the apps he refers to has a rating lower than three stars, which means they probably do not do their job.

How can I convince this person that such an app simply cannot be done in a practical, single developer fashion? Is there a PhD thesis I can use as my defense?

share|improve this question

closed as not constructive by Robert Harvey, Yannis, MainMa, Josh K Jan 30 '12 at 19:52

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Why do you have to convince them so much? Is it not possible to simply say "No, I'm not going to take this project, good luck with it" ? – FrustratedWithFormsDesigner Jan 30 '12 at 19:12
Why not hold an ipad from an object 3 feet away, ask how big it is, then walk 2 feet closer and ask? I don't see how this could be successful without a meaningful, accurately known, distance from the object and there isn't an hardware build in I could see providing that... – Rig Jan 30 '12 at 19:12
Did you actually download the apps in question and take a look for yourself? Did you see how accurate they are, or are you just looking at a star rating based on opinions of others? Remember, most people don't leave reviews unless they are unhappy with a product. – Tyanna Jan 30 '12 at 19:31
I have discovered a truly remarkable method to do this which this comment is too small to contain. – Dave Nay Jan 30 '12 at 19:32
Put it on rentacoder. I bet the guy who offered to solve P = NP for $500 will take it. – Paul Tomblin Jan 30 '12 at 19:48
up vote 15 down vote accepted

It's called "Forced Perspective"

Step 1. Go outdoors with a friend. Stand in front of a building.

Step 2. Take a picture so that the friend is really close to you and the building is really far away. Assure that the friend's head lines up with the top of the building.

Step 3. Ask your customer how tall it is, given just the photograph.

Do not specify what "it" is that the customer must define the height of. Let them assume -- or guess -- what part of the picture is relevant.

share|improve this answer
1… has numerous examples. – S.Lott Jan 30 '12 at 20:43
@blunders: The point is that none of that is known. The bottoms are never aligned when taking forced perspective pictures. Therefore, the picture is utterly useless. The estimation of size from an image is impossible. All forced perspective pictures are ample proof that an image -- by itself -- is utterly unusable. Please look at some forced perspective pictures. Do your own Google search. – S.Lott Jan 31 '12 at 10:40
@blunders: But you don't know the height of the person or the building. Therefore, you have zero basis for guessing the height of either. – S.Lott Jan 31 '12 at 12:40
@blunders: Also. If it's possible, please provide a photo of a random object and judge the size from the content of photo alone. No additional facts (i.e., diameter of a quarter) can be imposed. Please post the solution, rather than claim that it may be possible. That way I can revise my answer based on your results. – S.Lott Jan 31 '12 at 12:42
@blunders: I'm glad you have such a good insight into the question. It does not say any additional information will be input. I'm sure you think it's important to add requirements like that, but I failed to see them. Since you know so much more about the question -- as asked -- I'm sure you will have a much better answer. That's the point. You could (if this wasn't closed) provide your own answer based on whatever other information you feel should have been part of the question. – S.Lott Jan 31 '12 at 13:06

Instead of trying to convince someone that something cannot be done try to analyze and determine what it would take to get this done.

When you calculate that it would take you alone 10 years and $1 billion the solution of what to do with the project will become obvious.

share|improve this answer

It's possible - plus, you could always do the processing remotely, only using the phone to collect data and display results. Beyond that, there's also nothing that says you're not able to mount a device to the phone's camera to split and offset 2D input, and then convert those two inputs into a 3D input.

As for app ratings, that's not really a solid basis for understanding the feasibility of a concept, or it's complexity.

Just have fun with the challenge, it's not the end of the world.

share|improve this answer

Why not force the user to take the picture with a clearly displayed item of standard size next to the item being measured; a penny for example.

It's probably not as good of a solution as your employer wants but explaining a solution like this would at least show you can make something happen.

As you start listing the limitations and compromises needed, he will surely back away from a project like this (unless you have very good and sizable team behind you)

share|improve this answer
That's what I mean by extra hardware. But even so, the result would be dependent on how the user uses the reference. Moreover, the things the app tries to measure include those long incandescent light bulbs. The user cannot simply stick a reference on the ceiling. – YoYoMyo Jan 30 '12 at 19:52

Actually I'm not sure you are correct.
Provided the user assist the app it should be possible.

For example of a 1D measurement. Stand 1meter away from 1dm high object. Add this as user input to your app. Stand 1km from a mountain, add this as user input. Keep the same angle from the camera with both your 1dm object and the mountain. The app should calculate the height of the mountain easily.

I would suggest further studding Triangulation for implementation details.

You can take this further by placing your phone in a tripod and and have the object to be measured always at a known distance. This way everything can be pre calibrated and your app could by only counting the pixels in height and width tell you the 2d measurements of the object under inspection.

share|improve this answer
I agree, I can think of several different solutions. – zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz Jan 30 '12 at 19:15
this is an extremely fragile solution – Ryathal Jan 30 '12 at 19:36
In the case of measuring the mountain would the user have to stand exactly 1km away from the edge of the mountain? Or the exact center of the mountain? I really don't think this would work at all.It's easy to stand exactly 1m away from something that is rather small but scaling it up to a mountain does not seem feasible. – stuartmclark Jan 31 '12 at 9:41
@stuartmclark The user should stand 1km away, cathetus not hypotenuse, from the mountain top as that is what he is measuring. – Farmor Jan 31 '12 at 10:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.