Using new images in matlab code

3 ビュー (過去 30 日間)
Gurwinder pal singh Bhinder
Gurwinder pal singh Bhinder 2020 年 12 月 3 日
編集済み: Image Analyst 2020 年 12 月 8 日
hello everyone,
i tried many times, but i cant do the changes i want.
In the code below, i want to use some new images in this code, i want to use only the 6 new images, not current image and iamges from database:
clear all; clc; addpath(genpath(pwd));
%% EXTRACT FEATURES FROM AN ARBITRARY FINGERPRINT
filename='101_1.tif';
img = imread(filename);
if ndims(img) == 3; img = rgb2gray(img); end % Color Images
disp(['Extracting features from ' filename ' ...']);
ffnew=ext_finger(img,1);
%% GET FEATURES OF AN ARBITRARY FINGERPRINT FROM THE TEMPLATE AND MATCH IT WITH FIRST ONE
load('db.mat'); i=2;
second=['10' num2str(fix((i-1)/8)+1) '_' num2str(mod(i-1,8)+1)];
disp(['Computing similarity between ' filename ' and ' second ' from FVC2002']);
S=match(ffnew,ff{i},1);
My new images (.bmp) are attached .these are six images. i want to compare all 6 images with each other.

回答 (2 件)

Abhisek Pradhan
Abhisek Pradhan 2020 年 12 月 8 日
What I could guess from your question is that you are facing some issues while reading the BMP files using imread function. This was a known issue from R2014a to R2016b. Try using the fix below as a workaround.

Image Analyst
Image Analyst 2020 年 12 月 8 日
編集済み: Image Analyst 2020 年 12 月 8 日
If you want to process only those 6 images, and no others that may be in the folder, just make a cell array of the 6 filenames you want and then put into a loop to do your processing.
fileNames = {'Arch1.bmp', 'Arch2.bmp', 'Left_loop1.bmp', 'Left_loop1.bmp', 'Tented_Arc1.bmp', 'Tented_Arc2.bmp'}
for k = 1 : length(fileNames)
thisFileName = fullfile(pwd, fileNames{k});
thisImage = imread(thisFileName);
% Now do whatever processing you want to do.
end

カテゴリ

Help Center および File ExchangeColor Space Formatting and Conversions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by