Doubt provided to the calculation of the area

Asked

Viewed 97 times

3

I was testing an algorithm that returns to me the area of objects based on a reference, a priori this gave me results quite close to the real, when the reference was the same height of the measured object, but I decided to observe at a different time, with that I found that the given area was larger than I expected.

Referência é o circulo a esquerda e o objeto esta a direita sobre o tubo de 11cm de diâmetro

Reference is the left circle and the object is right on the 11cm diameter tube.

I imagined it was due to the curvature of the tube, but as it was quite high I imagined it was due to the proximity of the camera, and as I am using a pixel counting method may have occurred this problem.

I wonder if there is another way to get this area other than by counting the pixels or some way to reverse this difference?

  • 2

    Post the code you use and explain how you do the calculation. If your reference object has not changed in size, there is no reason to stop working (if you did it right: knowing the size of the reference object in cm, just find it in the image and measure its size in pixels to know the "scale" in which the image is; this same ratio is then applied to the new object you want to measure, and that is why there is the reference object).

  • 1

    Obviously the proximity of an object to the camera will make it bigger. Its calculation is valid only with captures in similar conditions, objects at the same distance. The camera cannot capture the distance between the objects on the Z axis.

  • 1

    Besides, what do you mean "different height"? If the objects were not photographed by the same camera and at the same distance (as our colleague @Celsomarigojr said), it makes no sense to apply this ratio.

  • different height I meant that what I wanted to measure was on another object.

  • 1

    but had not really thought about this discrepancy with the Z axis, I will redo my code here, thanks for the help Celso Marigo and Luiz Vieira

  • 1

    Not at all. Remember that if the objects are at different distances, the ratio (pixel-in-image x cm-in-real-life) does not apply because they are no longer on the same "scale" (of size in the image, even). If you had two cameras you could even try to estimate size based on the calculated distances from the effect Parallax, but it is more usual (and easier) to keep the single camera perpendicular to the scene and the items (reference and interest) at the same distance.

  • Got it, thank you very much

  • Not at all. I voted to close as out of scope because there’s not much to answer involving programming, actually. In addition, a possible hint of the problem has already been given in comments. But if the problem is something different, edit it or open a new question. :)

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.