Images viewing through axes in matlab GUI

1 次查看(过去 30 天)
i have a simple code to retrieve images using histogram .. i would like to view the result images that satisfy condition from Axes1..to Axes5 ..
srcFiles = dir(my directory);
for i = 1 : length(srcFiles)
filename = strcat(path,'\',srcFiles(i).name);
Imaged1= imread(filename);
Imaged2 = imread('D:\2','jpeg'); % Image 2
Imageg1 = rgb2gray(Imaged1);
Imageg2 = rgb2gray(Imaged2);
% Calculate the Normalized Histogram of Image 1 and Image 2
hn1 = imhist(Imageg1)./numel(Imageg1);
hn2 = imhist(Imageg2)./numel(Imageg2);
% Calculate the histogram error
y = sum((hn1 - hn2).^2);
if (y <= 0.005)
disp('not similar');
else
* _{{{ View Result Images from Axes2 .... Axes5. }}}_*
end

采纳的回答

Walter Roberson
Walter Roberson 2016-4-2
Ahead of time:
axeslist = [Axes2, Axes3, Axes4, Axes5];
cur_ax_idx = 0;
Then in the code, when the condition is met,
if cur_ax_idx < length(axeslist)
cur_ax_idx = cur_ax_idx + 1;
cur_ax = axeslist(cur_ax_idx);
... now show the result on axes cur_ax
else
warning('you need more axes to display all of the results')
end

更多回答(0 个)

类别

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

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by