Kindly Help me to resolve the error.Error using imwrite (line 541) Unable to open file "H:\VFGLE_​DemoReleas​e\save\T2.​jpg" for writing. You might not have write permission. Error in demo (line 27) imwrite(I,path);

2 次查看(过去 30 天)
clc;
clear all
close all
srcFile=dir('H:\sample data\*.jpg');
for i=1:length(srcFile)
filename=strcat('H:\VFGLE_DemoRelease\',srcFile(i).name);
I=imread(filename);
% % % Parameters setting
alpha = 0.5;
beta = 0.5;
gamma = 1;
tao = 0.02;
iterNum = 20;
% Processing with our method
img_out = VFGLE(I,alpha,beta,gamma,tao,iterNum);
% Show results
figure,imshow((img_out));
path=strcat('H:\VFGLE_DemoRelease\save\',srcFile(i).name);
imwrite(I,path);
end

采纳的回答

Walter Roberson
Walter Roberson 2020-9-19
The destination directory does not exist or else you do not have permission to write files there.
Question: why are you getting file names from one directory and assuming that the same name exists in a different directory??

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by