Error in writing image to folder

조회 수: 1 (최근 30일)
kash
kash 2013년 1월 12일
I have a code below in which the image is not writtten into the specified folder please tell where isthe mistake
for k=1:length(TestFiles)
x=imread([FullPath '\' TestFiles(k).name]);
% figure,imshow(S)
if (size(x,3)>1)%if RGB image make gray scale
try
x=rgb2gray(x);%image toolbox dependent
catch
x=sum(double(x),3)/3;%if no image toolbox do simple sum
end
end
x=double(x);%make sure the input is double format
[output,count,m,svec]=facefind(x);%full scan
f = figure, imagesc(x);colormap(gray)%show image
plotbox(output,[],3)
strtemp=strcat('C:\newframes9\',int2str(k),'.',pickind);
saveas(f, 'strtemp', 'bmp' )
end
I have 10 images,i want to write plotted result into folder
  댓글 수: 1
Jan
Jan 2013년 1월 12일
Please explain what happens instead of your expectations. It is much easier to solve a problem, when you do not have to guess at first, what the problem is.

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

채택된 답변

Walter Roberson
Walter Roberson 2013년 1월 12일
Change
saveas(f, 'strtemp', 'bmp' )
to
saveas(f, strtemp, 'bmp' )
  댓글 수: 1
Jan
Jan 2013년 1월 12일
Only the save commands want the variable as string, but saveas wants the variable itself. A strange idea, but I think this decision was made 1984 and it cannot be changed anymore.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by