How to save the enhanced fingerprint images

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

1 Kommentar

First you can do this by providing a meaningful minimal example.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Cam Salzberger
Cam Salzberger am 5 Mai 2020

0 Stimmen

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 Kommentare

uma
uma am 5 Mai 2020
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.
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 am 15 Mai 2020
Bearbeitet: Walter Roberson am 15 Mai 2020
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
Use Windows Explorer to examine the security settings of the file and directory to ensure that you have write permission.
uma
uma am 15 Mai 2020
Is there any other option to save these images in a folder?
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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by