필터 지우기
필터 지우기

whats wrong with this code when it read images from folder it gives me the following error. Error in Untitled8 (line 14) filename2 = strrep(fil​ename,path​name);

조회 수: 2 (최근 30일)
clear all;
clc;
close all;
[filenameList, pathnameList] = uigetfile(...
{'*.jpg;*.tif;*.png;*.gif;*.bmp','All Image Files'},'mytitle',...
'MultiSelect', 'on', ...
'c:/DatasetResultsNew/');
pathname = pathnameList;
for iFile=8:10 % 1:28 %check out here
filename = filenameList{iFile-7};
filename2 = strrep(filename,pathname);
fprintf('Processing image %s\n', filename);
im_GroundTruth = imread([pathname,filename]); % object=1; backgroud = 0;
im_GroundTruth(im_GroundTruth>0)=255;
im_segmentaion = im2uint8(imread([pathname,filename2])); % object=1; backgroud = 0;
Conf = confusionmat(im_GroundTruth(:),im_segmentaion(:));
recall = Conf(2,2)/sum(Conf(2,:))*100;
precision = Conf(2,2)/sum(Conf(:,2))*100;
f_measure = 2*recall*precision/(recall+precision);
metricsMatrix(iFile).recall=recall;
metricsMatrix(iFile).precision=precision;
metricsMatrix(iFile).f_measure=f_measure;
end
  댓글 수: 3
Arshad Ali
Arshad Ali 2019년 1월 14일
편집: Arshad Ali 2019년 1월 14일
i want to read all images from the folder to compare the mask which i created with the given mask to find precision, recall and f-measure. this code will find precision, recall and f-measure and create a matrix for every record
Arshad Ali
Arshad Ali 2019년 1월 14일
filename2 = strrep(filename,'file_1_', 'newfile_');
i change it but now i am getting this error
Error using confusionmat (line 52)
G and GHAT need to be the same type.
Error in Untitled8 (line 20)
C = confusionmat(im_GroundTruth(:),im_segmentaion(:));

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by