i need urgent help to understant

조회 수: 4 (최근 30일)
samir mohamd
samir mohamd 2017년 2월 17일
댓글: samir mohamd 2017년 2월 18일
in code of tracking cars
in the last step in th code
stats = regionprops(noSmallStructures, {'Centroid','Area'});
if ~isempty([stats.Area])
areaArray = [stats.Area];
[junk,idx] = max(areaArray);
c = stats(idx).Centroid;
c = floor(fliplr(c));
width = 2;
row = c(1)-width:c(1)+width;
col = c(2)-width:c(2)+width;
taggedCars(row,col,1,k) = 255;
taggedCars(row,col,2,k) = 0;
taggedCars(row,col,3,k) = 0;
end
end
Step 5
i want to know why he assume that width = 2 and what mean by " width = 2;
row = c(1)-width:c(1)+width;
col = c(2)-width:c(2)+width;"
i will be thankful for helping me
  댓글 수: 2
Alexandra Harkai
Alexandra Harkai 2017년 2월 17일
To help people willing to help your problem, format the code using the '{} Code' button to make it readable.
samir mohamd
samir mohamd 2017년 2월 18일
thanks

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

답변 (1개)

Guillaume
Guillaume 2017년 2월 17일
"i want to know why he assume that width = 2 and what mean by " width = 2;"
How should we know? We didn't write the code. Ask whoever wrote the code why they chose that value.
Note however that the name is misleading. The code actually tags the centroid with a square whose side is 2*width+1, not width.

카테고리

Help CenterFile Exchange에서 Tracking and Motion Estimation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by