- MATLAB. Inverse crop images.
- I=imread('img_9.tif');
- I2=imcrop(I,[60,50,85,85]);
- n_big=size(I);
- n_small=size(I2);
- for j1=1:(n_big(1)-n_small(1))
- for j2=1:(n_big(2)-n_small(2))
- Itest=I(j1:j1+n_small(1)-1,j2:j2+n_small(2)-1,:);
- if ( Itest == I2)
- I(j1:j1+n_small(1)-1,j2:j2+n_small(2)-1,:) = zeros(n_small(1),n_small(2),3);
- end
- end
- end
- figure(1);
- imshow(I);
- figure(2);
- imshow(I2);