0

I have attached my picture and I have many pictures of the same plant captured over time, but the angle of all the pictures is same,it's because camera is held onto a pole which looks over these plants. From this image, I want to know the height of the plant by calculating the distance between the camera and yellow spot (i.e. tip of plant) minus the distance between camera and red spot (i.e a point on ground), in short-plant:

height = dist(camera,yellow spot)-dist(camera,red spot)

I have gone through the MATLAB documentation and many papers, but I could not figure out how can I get the distance between the camera and those red and yellow spots in the image. Please somebody explain me. I have been struggling over it for many days.

EBH
  • 10,350
  • 3
  • 34
  • 59
annie
  • 111
  • 2
  • 10

1 Answers1

0

As cagatayodabasi pointed out in the comments, it can't be done in this ways:

1 - you have to horizontally translate your camera and take picture and obtain 2 different points of view,

2- use two cameras, better aligned in the horizontal axis.

In every case, you have to work with a stereo system. Maybe this link in Mathworks could help you.

In every case you should work first with the camera calibration, then with the disparity calculation, strongly linked with the distance from the camera, which is (or should be) your "scale factor" (the bigger the distance, the smaller the height is perceived).

In fact if you have a yellow spot on the top of the plant (I am trying to understand your method) and a red spot at the bottom, what you obtain with a difference is the "apparent height" of a plant in terms of pixel, but it is not the real height (it depends on the scale factor I mentioned above)

The "spot distance" method is unclear without an image, but maybe (as Mark Setchell pointed out, if you can not post an image) you can link the paper or the page from you took inspiration for your code.

marcoresk
  • 1,837
  • 2
  • 17
  • 29