Clear Filters
Clear Filters

Images viewing through axes in matlab GUI

1 view (last 30 days)
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

Accepted Answer

Walter Roberson
Walter Roberson on 2 Apr 2016
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

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!