Click here to Skip to main content
15,894,180 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello , i'm writing this code

C++
Image2 = imread('D:\temp\2','jpeg'); % Image 2 from template folder
path='D:\test2\';
list=dir([path, '*.bmp']);
srcFiles = dir('D:\test1\*.bmp'); % the folder in which my images found
for i = 1 : length(srcFiles)
    filename = strcat('D:\test1\',srcFiles(i).name);
    Image1= imread(filename); % some process
    x=diff(Image1 - Image2) %save image to folder according to x value
    if (x >= 0.05)
        imwrite ( Image1(i), 'temp', '.jpg');
        disp('Value 111111111111.')
        disp(x)
    elseif(x < 0.05)
        imwrite ( Image1(i), 'discard', '.jpg');
        disp('Value 222222222222.')
        disp(x)
    end
end

my problem is when i implement my code its only view the value of x and write only first image from folder test1 to folder temp or to folder discard , how i can write All images in folder test1 to folder temp or discard , then if i have folders from test 1 to test n how i can repeat this process for all folders with particular name test(i) to check every image in test folders and complete remaining procedure , thanks

sorry for previous post its first time i using code project editor . regards

[edit author='rjm']
Added <pre> tags and fixed indentation.
[/edit]
Posted
Updated 1-Jul-15 0:39am
v2
Comments
Richard MacCutchan 1-Jul-15 6:42am    
You should use your debugger to find out what is going on. Looking at the code there is nothing obvious that gives any clue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900