Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How do I extract the coordinates of 2 white points of a USB camera?

조회 수: 1 (최근 30일)
David Pereira
David Pereira 2017년 2월 10일
마감: MATLAB Answer Bot 2021년 8월 20일
I have an USB camera connected to the computer. It shows the image of a circle and 2 points.One of them is fixed, and the other moves continuously. The idea is to centralize the 2nd point, in order for both to be concentric.
I would like to extract the coordinates of both points and, with that, I will control a motor that acts on the position of the 2nd point. This iteration will only stop when the coordinates match.
I would really appreciate some help, since I am very new to image processing method. Thank you
  댓글 수: 2
Philip G
Philip G 2017년 2월 10일
편집: Philip G 2017년 2월 10일
If the object you are looking for is very bright compared to the background, I would just use an intensity threshold to find spots (if you have a color camera - consider converting the image to black and white by just summing up all three color channels) like
img_binary=img>threshold;
After that you can easily find the positions where your bright spots are. Consider the functions bwlabel (that will group all connected "ones" in your binary matrix img_binary). Now you could just take the mean position of the identified groups by bwlabel to get the positions of your two spots. If your image is too noisy - consider imdilate before running bwlabel.
David Pereira
David Pereira 2017년 2월 10일
I see! Thank you, that was extremely helpful!

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by