比较面部照片和图像

时间:2019-05-04 07:58:47

标签: matlab

我想比较一个人的素描和他/她的形象。我正在努力实现这一目标

速写图像

  • 拍摄草图并将其转换为
  • 黑白->双重图像->卷积->分离

我的代码

%Get mugshot from the folder%
mug_shot=imread('F:\Mtech_Final\mugShot_DB\f1-001-01-sz1.jpg');
figure, imshow(mug_shot), title('ARTIST PREDICTION');

%Converting the mug_shot to black and white%
grey_threshold = graythresh(mug_shot);
mug_shot_bw =~im2bw(mug_shot,grey_threshold);
% figure, imshow(mug_shot_bw), title('BLACK AND WHITE IMAGE');

%Converting Image to Matrix%
mug_shot_mx=mat2gray(mug_shot_bw);
% figure, imshow(mug_shot_mx), title('DOUBLE IMAGE');

%Generating Convoluted Image%
mug_shot_cnv=conv2(mug_shot_mx,[1 1;1 1]);
% figure, imshow(mug_shot_mx), title('CONVOLUTED IMAGE');

%Adjusting the image%
mug_shot_adj=imadjust(mug_shot_cnv,[0.5 0.7],[0 1],0.1);
% figure, imshow(mug_shot_adj), title('ADJUSTED IMAGE');

mug_shot_seg = bwareaopen(mug_shot_adj,200); 
pause(1)

figure, imshow(~mug_shot_seg), title('INPUT IMAGE BOUNDING);

照片

  • 拍摄图像
  • RGB->黑白->双重图像->锐化->分离

我的代码

%Get mugshot from the folder%
suspect_image=imread('F:\Mtech_Final\images_DB\f1-001-01.jpg');
figure, imshow(suspect_image), title('ARTIST PREDICTION');

%Converting Color Image to GreyScale%
suspect_image_grey = rgb2gray(suspect_image);
% figure, imshow(suspect_image_grey), title('GREYSCALE IMAGE');

%Converting the suspect_image to black and white%
% grey_threshold = graythresh(suspect_image_grey);
suspect_image_bw =~im2bw(suspect_image_grey,.6);
% figure, imshow(suspect_image_bw), title('BLACK AND WHITE IMAGE');

%Converting Image to Matrix%
suspect_image_mx=mat2gray(suspect_image_bw);
% figure, imshow(suspect_image_mx), title('DOUBLE IMAGE');

%Sharpning the Image%
suspect_image_sharp = imsharpen(suspect_image_mx,'Radius',2,'Amount',1);
% figure, imshow(suspect_image_sharp), title('Sharpened Image');

%Generating Convoluted Image%
% suspect_image_cnv=conv2(suspect_image_sharp,[1 1;1 1]);
% figure, imshow(suspect_image_cnv), title('CONVOLUTED IMAGE');

%Adjusting the image%
suspect_image_adj=imadjust(suspect_image_sharp,[0.5 0.7],[0 1],0.1);
% figure, imshow(suspect_image_adj), title('ADJUSTED IMAGE');

suspect_image_seg = bwareaopen(suspect_image_adj,1); 
pause(1)

figure, imshow(~suspect_image_seg), title('INPUT IMAGE BOUNDING BOX')

我遵循的步骤正确吗?我如何从这里继续?

0 个答案:

没有答案