... NhậnDạngKhuônMặt*Matlab2013cóhàmhỗtrợnhậndạngkhuônmặt.tacóthểsửdụnghàmhỗtrợnàynhưsau:functionbai10()%Example1:Facedetection%faceDetector=vision.CascadeObjectDetector();%Default:findsfacesOrigin=imread('path_image\.jpg');bboxes=step(faceDetector,Origin);%Detectfaces%AnnotatedetectedfacesIFaces=insertObjectAnnotation(Origin,'rectangle',bboxes,'Face');figure,imshow(IFaces),title('Detectedfaces');end*Ýtưởngthựchiệnviếtchươngtrình(khôngsửdụnghàmhỗtrợ):Sơđồkhốicho bài toánTạo1cơsởdữliệugồmn ảnh, mỗi ảnh đượcđặttêntheothứtựlàcácsónguyêntừ1đếnnđểtiệnchoviệcquản lý tập ảnh này(ntùyvào số lượng ảnh) . Ảnh đượcđưavào tập cơsởdữliệusẽđượcdùngđểhuấnluyện,từđâysửdụngcácphươngpháptríchrútđặctrưngvàđưaravectođặctrưngchoviệcnhậndạng. ... kenhR=origin(:,:,1);subplot(3,2,3),imshow(kenhR),title('Red');kenhG=origin(:,:,2);subplot(3,2,4),imshow(kenhG),title('Green');kenhB=origin(:,:,3);subplot(3,2,5),imshow(kenhB),title('Blue');trungviR=medfilt2(kenhR,[33]);trungviG=medfilt2(kenhG,[33]);trungviB=medfilt2(kenhB,[33]);rgb_filtered=cat(3,trungviR,trungviG,trungviB);gray_filtered=medfilt2(gray,[33]);gray_RGB=rgb2gray(rgb_filtered);d=abs(gray_RGBgray_filtered);subplot(3,2,6),imshow(d,[]),title('saikhac');endViếtchươngtrìnhMatlabthựchiệnnhậndạngmộtđốitượngtùyý(1chữcái,chữ số, vậtthểbấtkỳ,…) BÀITẬPXỬLÝ ẢNH SỐ1) Lọc ảnh (sửdụngphéptươngquan)trênmiềnkhônggianfiltered=spatial_filter(image,mask)Trongđóimagelà ảnh xámcầnlọc,masklàmặtnạlọc(kíchthướcmỗichiềulà số lẻ),filteredlà ảnh saukhilọc. Bài làm:functionloc_anh=spatial_filter(image,mask)clc;closeall;[row_image,colum_image]=size(image);[row_mask,colum_mask]=size(mask);fori=1:row_image+2*floor(row_mask/2)forj=1:colum_image+2*floor(colum_mask/2)loc_anh(i,j)=0;endendfori=1:row_imageforj=1:colum_imageloc_anh(i+floor(row_mask/2),j+floor(colum_mask/2))=image(i,j);endendfori=1:row_imageforj=1:colum_imagebientam=0;foru=1:row_maskforv=1:colum_maskbientam=bientam+loc_anh(ifloor(row_mask/2)+u,jfloor(colum_mask/2)+v)*mask(u,v);endendimage(i,j)=bientam;endendloc_anh=image;endThaotác:(tacómatrậnAlà ảnh vàmlàmặtnạlọctùyý)>> ... Thựchiệnlọctrungvịcho ảnh xámgray,gánkếtquảvàobiếngray_filtered.● Hiểnthịđộsaikháctạimỗiđiểm ảnh giữa ảnh xámcủa ảnh rgb_filteredvàgray_filtered. Bài làm:functiond=bai9(file)clc;closeall;origin=imread('D:\Game\anh\Kayle.jpg');subplot(3,2,1),imshow(origin),title('origin');gray=rgb2gray(origin);subplot(3,2,2),imshow(gray),title('gray');...