... ~isempty(r) xlow=floor(min(reshape(ttb(:, 1), 1,[ ])) ); xhigh=ceil(max(reshape(ttb(:, 1), 1,[ ])) ); xadd=ceil(ttb(size(ttb, 1), 3)) ; ylow=floor(min(reshape(ttb(:, 2), 1,[ ])) ); yadd=ceil(max(reshape(ttb(:, 4), 1,[ ])) ); ... yadd=ceil(max(reshape(ttb(:, 4), 1,[ ])) ); final1=H(ylow:(ylow+yadd+(floor(max(reshape(ttb(:, 2), 1,[ ])) )ylow )) , xlow:(xhigh+xadd )) ; [a2 b2]=size(final 1); final1=bwareaopen(final1,floor((a2/2 0)* (b2/2 0)) ); figure( 6) imshow(final 1) ... v=1:length(var) M(v)=NR(var(v) ,(2 *chk )) > =container( 1) && NR(var(v), (2 *chk )) ...