Skip to content

Commit

Permalink
Merge pull request pdollar#2 from jltmtz/master
Browse files Browse the repository at this point in the history
bbapply-embed boundary condition check (thanks Julieta!)
  • Loading branch information
pdollar committed Feb 10, 2015
2 parents 0a03b3f + 65d9b06 commit 612f9a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion detector/bbApply.m
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
for b=1:n
M=char2img(sprintf('%.4g',bb(b,5)),fh); M=M{1}==0; [h,w]=size(M);
y0=bb(b,2); y1=y0+h-1; x0=bb(b,1); x1=x0+w-1;
if( x0>=1 && y0>=1 && x1<=size(I,2) && y1<=size(I,2))
if( x0>=1 && y0>=1 && x1<=size(I,2) && y1<=size(I,1))
Ir=I(y0:y1,x0:x1,1); Ig=I(y0:y1,x0:x1,2); Ib=I(y0:y1,x0:x1,3);
Ir(M)=fcol(b,1); Ig(M)=fcol(b,2); Ib(M)=fcol(b,3);
I(y0:y1,x0:x1,:)=cat(3,Ir,Ig,Ib);
Expand Down

0 comments on commit 612f9a0

Please sign in to comment.