Я хочу сравнить и сопоставить эскиз человека с его / ее изображением.Я пытаюсь добиться этого примерно так:
Sketched Image
- Возьмите эскиз и преобразуйте его в
- Черно-белое -> Двойное изображение -> Свернутый ->Сегрегированный
Мой код
%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 -> Черно-белое -> Двойное изображение-> Sharped -> Segregated
Мой код
%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')
Правильны ли выполняемые мной действия?Как мне продолжить отсюда?