Images viewing through axes in matlab GUI

조회 수: 2 (최근 30일)
ahmed obaid
ahmed obaid 2016년 4월 2일
댓글: ahmed obaid 2016년 4월 2일
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
  댓글 수: 1
ahmed obaid
ahmed obaid 2016년 4월 2일
Thanks for your great help ... smart solution

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by