Width and Height of Human Body

2019-08-27 23:51发布

How can I recognize the height and the width of a human body in an image?

3条回答
干净又极端
2楼-- · 2019-08-28 00:33

To expand on what others have said, you can break down this complicated task into several (still difficult) components.

  1. Identify the square of pixels containing the human.

  2. Identify the square of pixels containing a reference object of which you know its real-world dimensions. (e.g. a coke can, a ruler, etc.)

  3. Identify the 3D relation between the two objects, so you can translate pixels of the reference object into the same scale as the human's pixels.

  4. Calculate the human's dimensions using the formula:

    human.real_height = human.pixel_height*reference.real_height/reference.pixel_height

Granted, this process is far from foolproof, and still quite hard, but it should provide a reasonable approximation. I haven't played around with the existing toolkits much, but you might start with OpenCV, with has Python bindings. Also, the SIFT algorithm is an interesting technique that might work here, but I think there's only a C# implementation.

The third step would likely be the most difficult if you're only using a single image. People extract 3D image data through stereoscopy (i.e. we use images from both of our eyes to "deduce" depth), but even then it's not foolproof since color and shading can throw us off. I'd imagine it's possible to do using a single image, but would likely be even more error prone. This is an area of active research, so I'd lookup books on computer vision to get a better idea of what's currently practical.

查看更多
孤傲高冷的网名
3楼-- · 2019-08-28 00:34

You need some point of reference. A simple photo will not do, unless you know the camera setup (placement, zoom, lens distortion, etc.), and the location of the person relative to the camera.

If you do have a reference (like a grid in the background or something) then you can measure the grid and go from there. Doesn't sound like what you need though.

查看更多
Rolldiameter
4楼-- · 2019-08-28 00:41

As Brad pointed out, this isn't really doable, unless pictures are made in controlled conditions. If not, then you're probably out of luck, since forced perspective can trick even the best of algorithms that detect human height and width.

查看更多
登录 后发表回答