After using the comparison method between two image, i want to detect the real length value of the red Lines. For example 5 cm. So i can know the distance the object has moved. Is it doable automatically ?

댓글 수: 2

jonas
jonas 2018년 8월 9일
편집: jonas 2018년 8월 10일
Obviously you are going to need the scale. One pixel can be 1 km long, for all we know.
Oh, I didnt see the scale. It blends in with the background. Will be almost impossible to use in my layman opinion.
Theodor Al Saify
Theodor Al Saify 2018년 8월 12일
For example in the photo attached, can i detect the scale automatically ?

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2018년 8월 12일

1 개 추천

See my spatial calibration demo. It can do what you want. Adapt it as necessary.

댓글 수: 1

Theodor Al Saify
Theodor Al Saify 2018년 8월 13일
i already used it, but i don't know how to do it automatically, in your code the user draw a line to calibrate. in my case i want to detect the scale and auto-calibrate. I don't have the knowledge to do it, i am new to Matlab. Sorry for bothering.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Florian Morsch
Florian Morsch 2018년 8월 10일
편집: Florian Morsch 2018년 8월 10일

0 개 추천

With a given reference its possible. Either calibrate your camera to that reference and dont move it afterwards or have a known scale on each image. That way you can tell what distance equals a pixel. Now you just have to count the pixels and can convert that to your distance.
And yes, you can do it automatically. If the camera is calibrated to the reference, just count the pixels and convert them. If you have a scale on each image, detect that scale, count the pixels and (since you know the real dimensions of the scale) use that to calculate the distance.

댓글 수: 6

Theodor Al Saify
Theodor Al Saify 2018년 8월 10일
that what i am trying to do. i can do it manually to detect a scale and convert the distance to real value. I drew a scale(attachment) and it is present in the image But i am not able to detected automatically to count the number of pixel of the line.
jonas
jonas 2018년 8월 10일
What you are trying to do is definitely possible. You say that the scale is present in the figure, however not in the one you attached. However you insert this scale (can be a physical scale in the photo), make sure it is clearly distinguishable from the background so as to make the detection easier. Even better if it's a distinct color, like bright red on a dark background.
Theodor Al Saify
Theodor Al Saify 2018년 8월 10일
yes this is what i am doing. But how can i detect it in the photo ?
jonas
jonas 2018년 8월 10일
편집: jonas 2018년 8월 10일
Going to need the photo (with the scale) to tell you that...
EDIT: Oh, I didnt see the scale at first. It blends in with the background. Will be almost impossible to use it in my layman opinion, unless you define it manually...
Theodor Al Saify
Theodor Al Saify 2018년 8월 13일
For example in the picture attached , are the condition right ? the scale is different color than the background, and also the camera is always at the same position and height.
jonas
jonas 2018년 8월 13일
Yes, now you should be able to detect the scale. If I were you, I would pass the question to Image Analyst, as he will be able to give you the best guidance on what method to use. If you can segment the red color, then it should be easy to find the axes and count the number of pixels in the y- and x-directions.
You can start by looking at the demo on color segmentation by IA.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

질문:

2018년 8월 9일

댓글:

2018년 8월 13일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by