필터 지우기
필터 지우기

Can I move an object in an image to the center of FOV?

조회 수: 1 (최근 30일)
Chockalingam Kumar
Chockalingam Kumar 2018년 12월 27일
댓글: Image Analyst 2018년 12월 27일
I have a NxN matrix defining the FOV of a camera. Approximately in the middle of FOV is an object that generates a height profile. I want to be able to move the centroid of the object to the exact center of the FOV matrix. I really don't care about the NaNs created by the translation of object. I will fill the NaNs generated by this translation to zeros. What is the best way to accomplish this.Thanks in advance.

채택된 답변

Image Analyst
Image Analyst 2018년 12월 27일
I'd first segment the image to find the object. This really depends on what the object looks like. Then you can get a new image (not a live one though) that has the object at the center by using imtranslate().
  댓글 수: 2
Chockalingam Kumar
Chockalingam Kumar 2018년 12월 27일
Thanks for the quick response. Let me try it and I will let you know how it works.
Image Analyst
Image Analyst 2018년 12월 27일
Use
props = regionprops(mask, 'Centroid');
hold on;
% Plot red crosses at the centroid location(s).
for k = 1 : length(props)
plot(props(k).Centroid(1), props(k).Centroid(2), 'r+', 'MarkerSize', 20, 'LineWidth', 2);
end
to get a list of the centroids of all blobs in your segmented image.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for USB Webcams에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by