|
@@ -7,8 +7,7 @@ if nargin < 4
|
|
|
end
|
|
|
|
|
|
if nargin < 3,
|
|
|
- partcolor{1} = [255,0,0];
|
|
|
- partcolor(2:20) = num2cell(repmat( [0,0,255], [19,1]),2);
|
|
|
+ partcolor = [255,0,0];
|
|
|
end
|
|
|
|
|
|
|
|
@@ -24,7 +23,7 @@ if ( nargout == 0)
|
|
|
y1 = boxes(:,2+(i-1)*4);
|
|
|
x2 = boxes(:,3+(i-1)*4);
|
|
|
y2 = boxes(:,4+(i-1)*4);
|
|
|
- line([x1 x1 x2 x2 x1]',[y1 y2 y2 y1 y1]','Color',partcolor{i},'linewidth',i_linewidth);
|
|
|
+ line([x1 x1 x2 x2 x1]',[y1 y2 y2 y1 y1]','Color',partcolor,'linewidth',i_linewidth);
|
|
|
end
|
|
|
end
|
|
|
drawnow;
|
|
@@ -63,21 +62,22 @@ else
|
|
|
i_minBottom = max ( 1 , y1-i_offset );
|
|
|
i_maxTop = min ( height, y2+i_offset);
|
|
|
%
|
|
|
- imWithBoxes( i_minBottom:y2+i_offset, i_minLeft:x1+i_offset, 1) = partcolor{i}(1);
|
|
|
- imWithBoxes( i_minBottom:y2+i_offset, i_minLeft:x1+i_offset, 2) = partcolor{i}(2);
|
|
|
- imWithBoxes( i_minBottom:y2+i_offset, i_minLeft:x1+i_offset, 3) = partcolor{i}(3);
|
|
|
+size ( imWithBoxes )
|
|
|
+ imWithBoxes( i_minBottom:y2+i_offset, i_minLeft:x1+i_offset, 1) = partcolor(1);
|
|
|
+ imWithBoxes( i_minBottom:y2+i_offset, i_minLeft:x1+i_offset, 2) = partcolor(2);
|
|
|
+ imWithBoxes( i_minBottom:y2+i_offset, i_minLeft:x1+i_offset, 3) = partcolor(3);
|
|
|
%
|
|
|
- imWithBoxes( i_minBottom:i_maxTop, x2-i_offset:i_maxRight, 1) = partcolor{i}(1);
|
|
|
- imWithBoxes( i_minBottom:i_maxTop, x2-i_offset:i_maxRight, 2) = partcolor{i}(2);
|
|
|
- imWithBoxes( i_minBottom:i_maxTop, x2-i_offset:i_maxRight, 3) = partcolor{i}(3);
|
|
|
+ imWithBoxes( i_minBottom:i_maxTop, x2-i_offset:i_maxRight, 1) = partcolor(1);
|
|
|
+ imWithBoxes( i_minBottom:i_maxTop, x2-i_offset:i_maxRight, 2) = partcolor(2);
|
|
|
+ imWithBoxes( i_minBottom:i_maxTop, x2-i_offset:i_maxRight, 3) = partcolor(3);
|
|
|
%
|
|
|
- imWithBoxes( i_minBottom:y1+i_offset, x1:x2, 1) = partcolor{i}(1);
|
|
|
- imWithBoxes( i_minBottom:y1+i_offset, x1:x2, 2) = partcolor{i}(2);
|
|
|
- imWithBoxes( i_minBottom:y1+i_offset, x1:x2, 3) = partcolor{i}(3);
|
|
|
+ imWithBoxes( i_minBottom:y1+i_offset, x1:x2, 1) = partcolor(1);
|
|
|
+ imWithBoxes( i_minBottom:y1+i_offset, x1:x2, 2) = partcolor(2);
|
|
|
+ imWithBoxes( i_minBottom:y1+i_offset, x1:x2, 3) = partcolor(3);
|
|
|
%
|
|
|
- imWithBoxes( y2-i_offset:i_maxTop, x1:x2, 1) = partcolor{i}(1);
|
|
|
- imWithBoxes( y2-i_offset:i_maxTop, x1:x2, 2) = partcolor{i}(2);
|
|
|
- imWithBoxes( y2-i_offset:i_maxTop, x1:x2, 3) = partcolor{i}(3);
|
|
|
+ imWithBoxes( y2-i_offset:i_maxTop, x1:x2, 1) = partcolor(1);
|
|
|
+ imWithBoxes( y2-i_offset:i_maxTop, x1:x2, 2) = partcolor(2);
|
|
|
+ imWithBoxes( y2-i_offset:i_maxTop, x1:x2, 3) = partcolor(3);
|
|
|
end
|
|
|
end
|
|
|
end
|