please do help i have enhanced the fingerprint images and now i want to save them for matching how i can do this.

1 件のコメント

Johannes Rebling
Johannes Rebling 2020 年 5 月 5 日
First you can do this by providing a meaningful minimal example.

サインインしてコメントする。

 採用された回答

Cam Salzberger
Cam Salzberger 2020 年 5 月 5 日

0 投票

If you have the image as a matrix, use imwrite. If you have "enhanced" the image by using figure tools (axes, plotting, etc.), use print.
-Cam

6 件のコメント

uma
uma 2020 年 5 月 5 日
yes the images are in matrix form .Actually i want to save the enhanced image in a dataset. so that i can use them for matching.
Image Analyst
Image Analyst 2020 年 5 月 5 日
If they're floating point, you can use save() to save them and any other variables you want into a mat file. If they're uint8 or uint16, simply use imwrite() to save them to individual files. We don't know your definition of a "dataset" but if it's just a folder of images, then imwrite() will work. If you really want a database, then you'll need the Database Toolbox.
uma
uma 2020 年 5 月 15 日
編集済み: Walter Roberson 2020 年 5 月 15 日
please do help i have this following error. while executing the below code. I just want to save the 20 enhanced images in a folder.
Error using imwrite (line 528)
Unable to open file "C:\Users\Dell\Desktop\python tutorials\matlab\myfiles\matlab\myfiles\Dataset 2\Enhanced images\101_1.tif" for writing. You might not have write permission.
Error in tess2 (line 38)
imwrite(p,path);
for i=1:length(srcFile)
filename=strcat('C:\Users\Dell\Desktop\python tutorials\matlab\myfiles\matlab\myfiles\Dataset 2\',srcFile(i).name);
a=imread(filename);
path=strcat('C:\Users\Dell\Desktop\python tutorials\matlab\myfiles\matlab\myfiles\Dataset 2\Enhanced images\',srcFile(i).name);
b=double(a(:));
lem=225;
minim=min(b(:));
maxim=max(b(:));
[m,n]=size(a);
x=zeros(1,225);
q=zeros(1,225);
w=zeros(1,225);
r=zeros(1,225);
E=zeros(1,225);
u=zeros(1,225);
for i=1:m
for j=1:n
g=a(i,j);
x(i,j)=((g-minim)./(maxim-minim));
q(i,j)=((1+lem)*x(i,j))./(1+lem*x(i,j));
w(i,j)=(1-x(i,j))./(1+(3*lem*x(i,j))+(lem^2*x(i,j))+x(i,j));
r(i,j)=1-q(i,j)-w(i,j);
E(i,j)=(1./x(i,j))*(sum(sum(r(i,j)*exp(1-r(i,j)))));
u(i,j)=maxim*(E(i,j)+lem);
t=q(i,j)^1.25;
for y=0:0.1:1
if t<=0.5
p(i,j)=2*(t^2);
else
p(i,j)=1-2*((1-t)^2);
end
end
end
end
figure, imshow(p);
imwrite(p,path);
end
Walter Roberson
Walter Roberson 2020 年 5 月 15 日
Use Windows Explorer to examine the security settings of the file and directory to ensure that you have write permission.
uma
uma 2020 年 5 月 15 日
Is there any other option to save these images in a folder?
Walter Roberson
Walter Roberson 2020 年 5 月 16 日
No, there is no other way to save the images in a folder. No matter which folder you make your current folder, and no matter whether you use a relative path or a complete path, you still end up using imwrite() or equivalent, and you still risk being denied write access.
You need to figure out why it is not permitting you to save in that location.
I have to wonder why you have matlab\myfiles\matlab\myfiles in your path instead of just matlab\myfiles
create_missing = false;
parts = {'C:\', 'Users', 'Dell', 'Desktop', 'python tutorials', 'matlab', 'myfiles', 'matlab', 'myfiles', 'Dataset 2', 'Enhanced images'};
if ~exist(parts{1}, 'dir')
error('You do not have a C: drive. Giving up.');
end
failed = false;
for K = 2 : length(parts)
thispath = fullfile(parts{1:K});
if exist(thispath, 'dir')
fprintf('Okay we already have directory %s\n', thispath);
elseif create_missing
try
mkdir(thispath);
fprintf('Was able to create missing directory %s\n', thispath);
catch
fprintf('Failed trying to create missing directory %s', thispath);
oldpath = fullfile(parts{1:K-1});
p = fileattrib(oldpath);
fprintf('Attributes of parent directory %s are:\n', oldpath);
disp(p);
failed = true;
break
end
else
fprintf('Directory %s does not exist and you asked that missing directories not be created. Set the variable create_missing to true if you want the directory created\n', thispath);
failed = true;
break
end
end
if failed
fprintf('Some directory not created. Not ready to use\n');
else
fprintf('Okay, should be ready to use directory %s\n', fullfile(parts{:}) );
end

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSearch Path についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by