カメラを使って物体の高さと幅を計算したい。私はiPhoneでカメラとオブジェクトの間の角度を見つけようとしましたが、オブジェクトの寸法を取得するのに役立つと思います!
助言がありますか?
ありがとう。
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.