今天提取的方式为手动,后面或全自动找感兴趣区域
用数据游标找到兴趣区域的坐标
代码如下:
clc,clear,close all;
f=imread('face.jpg');
subplot(3,2,1),imshow(f);
%[h,w]=[y,x]
%f(左上角y:右下角y1,左上角x:右下角x1从上到下从左到右
%y1-y=h,x1-x=w
g=f(168:224,204:330);
subplot(3,2,2),imshow(g);
f(168:224,204:330)=255;
subplot(3,2,3),imshow(f);
l=imresize(g,0.3);
subplot(3,2,4),imshow(l);
%坐标本子上慢慢算
f(188:205,248:286)=l;
subplot(3,2,5),imshow(f);