图像处理基于参考英寸获得对象的每英寸像素数 [英] Image processing getting the pixels per inch of an object based on referential inches

查看:141
本文介绍了图像处理基于参考英寸获得对象的每英寸像素数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单地说:

我有一个人体图像。我有两个参考点,左右腰部位置。比如说:(100,100)和(200,100)分别是左右腰部位置。

I have a image of a human body. I have two reference points which are the left and right waist locations. Let's say for example: (100,100) and (200,100) are the respective left and right waist locations.

除了这两点之外,我也知道现实生活 腰部的英寸值。

In addition to those two points, I also know the "real life" inches value of the waist.

我试图获取这三个数据点并推断出真实生活中有多少像素=一英寸。这应该不是那么难,但我对此有一些类型的脑阻滞。

I am trying to take those three data points and extrapolate how many pixels = one inch in "real life". This shouldn't be that hard, but I'm having some type of brain block on this.

寻找简单的公式。我开始的那个是:

Looking for the simple formula. The one I started with is:

(RightPoint.X - LeftPoint.X)/ 34

(RightPoint.X - LeftPoint.X) / 34"

这个不起作用。腰部越小,每英寸像素值就越大。在上面,它将是2.9像素== 1。

This does not work. The smaller the waist gets, the larger the pixels per inch value. In the above, it would be 2.9 pixels == 1".

如果我改变34到10,它最多可以拍摄10个像素== 1。或者也许这是正确的?呃......大脑你今晚在哪里!?!?

If I change the 34" to 10", it shoots up to 10 pixels == 1". Or maybe that's correct? Ugh...brain where are you tonight!?!?

问题:

我正在寻找基于这三个参考数据点的正确公式,这将允许我确定图像中有多少像素== 1。因此,如果我在现实生活中知道这个人的腰部是34英寸,我想确定图像中的...相对于图片说2.5像素== 1英寸。

I'm looking for the correct formula that based on those three referential data points will allow me to determine how many pixels in the image == 1". So if I know in real life that the person's waist is 34 inches, I want to determine that in the image...let's say 2.5 pixels == 1 inch relative to the picture.

推荐答案

很遗憾,您没有足够的信息来解决这个问题。首先,现实生活中的腰围测量是三维的,并且一直围绕着身体,因此首先你需要将它除以2,以便在整个前后两侧进行卷尺测量。身体 - 所以你的34英寸腰部意味着你的100个像素对应17 - 如果身体是扁平的 - 它不是!这就是问题所在。

Unfortunately you don't have enough information to work it out. Firstly, the waist measurement in real life is 3-D and goes all the way around the body, so for a start you would have to divide it by 2 to allow for the tape-measure going both across the front and the back of the body - so your 34" waist would mean your 100 pixels correspond to 17" - if the body was flat - which it isn't! And that is the problem.

想象一下,这个人的裤子前面有两个厚厚的枕头......这会影响他们的腰围(让它更大)但是,因为它们位于裤子的前面,它不会影响像素宽度。

Imagine the person had two thick pillows down the front of their trousers... that would affect their waist measurement (make it miles bigger) but, as they are down the FRONT of their trousers, it wouldn't affect the pixel width.

对不起,你不能准确地做到这一点。你可以假设他们的腰部是完美的圆形,然后100个像素对应于他们腰部的投影,所以34将是腰围,即pi x d。所以你会说100像素= 34 / pi或者大约11。

Sorry, you can't do it accurately. You could assume their waist was perfectly circular, then the 100 pixels would correspond to the projection of their waist, so 34" would be the circumference of the waist, which is pi x d. So you would say that 100 pixels = 34/pi or around 11".

所以,具体而言:

34/pi inches = 100 pixels
10.8 inches = 100 pixels
1 inch = 100/10.8 pixels
1 inch = 9.25 pixels

但请记住,这是基于腰部为圆形的近似值。

But remember this is an approximation based on the waist being circular.

这篇关于图像处理基于参考英寸获得对象的每英寸像素数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆