フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Problem with sending image as argument to MAD_index() algorithm

2 ビュー (過去 30 日間)
Komali Usse
Komali Usse 2012 年 4 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Below is a part of my code for "Vehicle Tracking Using a Human-Vision-Based Model of Visual Similarity". The cropped images obtained in the last two steps are to be sent as arguments to MAD_index algorithm(ZIP file can be downloaded at http://vision.okstate.edu/mad/). But as soon as I pass these arguments MATLAB is shutting down. Please help me with solving the problem...
labbeled = zeros([size(background,1) size(background,2) 3 nframes], class(background)); noiseval=2; sedisk = strel('disk',noiseval); cform = makecform('srgb2lab'); hautoth = vision.Autothresholder('ThresholdScaleFactor',0.1); framevector(nframes,1)=struct('frame', [], 'featurevector', [], 'image',[],'noregs',[]); for i=1:nframes
curframe=read(videoobj,i);
diff=curframe-background; diff=im2single(rgb2gray(diff)); bin = step(hautoth,diff); filteredbin = imopen(bin,sedisk); conbin = bwconncomp(filteredbin); labelbin=labelmatrix(conbin); load regioncoordinates; stats=regionprops(labelbin,'Area','Centroid','Orientation','Image','BoundingBox');
numberofregions=size(stats); tempfv=0; tempfvimage=0; noregs=numberofregions(1,1) if noregs==0 continue; end fvimage(noregs,1)=struct('Image',[]); fv(noregs,1)=struct('Area',[],'Centroid',[],'Orientation',[],'Lmean',[],'amean',[],'bmean',[]); %pixelvalues for region=1:noregs region BB=stats(region).BoundingBox; xval=uint8(BB(1)); yval=uint8(BB(2)); wval=uint8(BB(3)); hval=uint8(BB(4)); roicurframe=imcrop(curframe,[xval yval xval+hval yval+wval]); ClrspcImg= applycform(roicurframe,cform); L=ClrspcImg(:,:,1); a = ClrspcImg(:,:,2); b = ClrspcImg(:,:,3); lmean=mean2(L); amean=mean2(a); bmean=mean2(b); fvimage(region,1).Image=roicurframe; fv(region,1).Area=stats(region).Area; fv(region,1).Centroid=stats(region).Centroid; fv(region,1).Orientation=stats(region).Orientation; fv(region,1).Lmean=lmean; fv(region,1).amean=amean; fv(region,1).bmean=bmean; end framevector(i,1).frame=i; framevector(i,1).featurevector=fv; framevector(i,1).image=fvimage; framevector(i,1).noregs=noregs; end frame=5; regioncur=1; regionnext=1; img=framevector(frame,1).image(regioncur,1).Image; img1=framevector(frame,1).image(regionnext,1).Image;

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by