资源描述:
《视觉感知lab实验报告》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、edgedetector实验报告赵宏伟1实验要求LoadthethreereceptivefieldsDOG.mat,Gaborh.mat,andGaborv.mat(correspondingtothreedifferentneurons),inadditiontotheedgeimages(edges-mat)andtheEinsteinimage(einstein.mat)fromyouremails•(a)Plotthethreedifferentreceptivefieldssidebysidewithinthesamefigure
2、usingimagescandsubplotsoyoucanseewhattheylooklike.Usethescalingoptionforimagesctomakesurethatthegrayscaleforeachisequivalent・i.e.,sotheyaredirectlycomparable.(b)Showwhateachoftheedgeimageslookslikeinthesamemanner-i.e.,byshowingthemsidebysideinthesamefigureusingsubplot.Yoush
3、ouldseethattheyarejustedgesatdifferentpositionsandorientations.(c)Now,foreachofyourneurons,computetheinnerproductbetweenitsreceptivefieldandeachoftheedgeimages.Plotyourresultsforeachneuronasabarplot,withthepositionoftheedgeonthex-axisofeachbarplot.(d)Finally,forreceptivefie
4、ldsDOG,Gaborh,Gaborv,showwhatitwouldlookliketohaveanentirearrayoftheseneuronsprocessingtheEinsteinimage・Youcandothisbytypingpim=conv2(einstein,DOG,'samez);wherepimisyourresultimage・ComparedifferencesoftheresultsfromDOG,GaborhandGaborv.2实验环境(1)pc机:windows7ultimateX86(2)Matla
5、b(2009a)3实验内容A.(1)结果图图1(2)实验代码loadDOG.mat;loadedges,mat;loadeinstein.mat;loadGaborh.mat;loadGaborv.mat;colormap(gray);WS二[-0.20.2];subplot(1,3,1);imagesc(DOG,WS);axisimage;title(,DOG');%显示为第一幅图像并控制缩放,灰度显示subplot(1,3,2);imagesc(Gaborh,WS);axisimage;title('GaborhJ);%显示为第二幅图像并
6、控制缩放,灰度显示subplot(1,3,3);imagesc(Gaborv,WS);axisimage;title(*Gaborv,);%显示为第三幅图像并控制缩放,灰度显示B.(I)结果图QFigure1gleEditViewInsertlookDesktopWindowHelpwjI41qz⑥枳必・ai□s■口2424(2)实验代码»i=l;i);imagesc(edge(:,:,i));axisimage;i=i+l;>>while(i<=8)subplot(2,4,endc.(1)结果图图3DOG与edge的每个点做点积QFigur
7、e3file£dit辺ew[nsertToolsdesktopWindowHelpQdJfe弐头紳◎毀謠•凰□匡I■回❶Notenewtoolbarbuttons:d恥brushing&linkedplots詔电PlayvideoGaborvGabotvGaborvGaborv图4Gaborv与edge的每个点做点积图5Gaborh与edge的每个点做点积(2)实验代码loadDOG.mat;loadedges.mat;loadeinstein.mat;loadGaborh.mat;loadGaborv.mat;figure;fori=l:8
8、subplot(2,4,i);bar(dot(DOG,edge(:,:,i)));xlabel('DOG');endfigure;fori=l:8subplot(2