필터 지우기
필터 지우기

How can I make the centroid of bounding box to react to the line drawn inside a "LIVE" video?

조회 수: 1 (최근 30일)
Greetings,
As stated in the question title, I have a program that will help track object and have already draw a line so that it will show up a video only if the object was detected. However, no matter what I do, the centroid of the bounding object will not react to the line, any ideas on how to solve this? The figure below will show you a better idea on what I am trying to do. Here, I am trying to make a counter in such a way that, when an object(centroid of object) was crossing the green line, it will add 1 to the counter. I tried putting when the X-coordinate is less than 50, then the line will turn purple while it adds a counter. Of course, seeing that I posted it here means that it is a failure.
Thank you very much.
Regards,
Chan
  댓글 수: 2
Image Analyst
Image Analyst 2014년 5월 5일
Well, not much we can do with what you have given us so all I can do is to give you encouragement that if you learn how to debug with this link that you'll eventually figure it out.
Akira Chan
Akira Chan 2014년 5월 5일
Oh sorry, I got it now, I am very stupid. Thank you for your time Image Analyst. However, now that I can detect the line with centroid, I have faced another problem. Can you suggest a way so that I can increase my frame per second so that it is smooth? Because my detection when crossing the line is poor, i think it might be the smoothness of the video.

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

채택된 답변

Image Analyst
Image Analyst 2014년 5월 5일
Your video adapter might have a frame rate property you can set. Run imaqtool and see what's there.

추가 답변 (1개)

haseeb zia
haseeb zia 2018년 3월 21일
hi i am also working on such type of project , kindly tell me how to change the color of line if centroid of bounding box is above the line. there is multiple object in my video
  댓글 수: 1
Image Analyst
Image Analyst 2018년 3월 21일
Something like
if yTop + height/2 > rows/2
% Above middle
rectangle('Position', [xLeft, yTop, width, height], 'EdgeColor', 'r');
else
% Below middle
rectangle('Position', [xLeft, yTop, width, height], 'EdgeColor', 'b');
end

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

Community Treasure Hunt

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

Start Hunting!

Translated by