how can i differentiate between images

3 views (last 30 days)
Filza Ashraf
Filza Ashraf on 9 May 2014
Edited: Image Analyst on 10 May 2014
I have let suppose have 20 images in which 10 are standard image and 10 are reference images. I consider standard image are those images that don't have tumour (pixels of intensity 255)and reference that contains tumours so I read the directory as
sdirectory =('');
images = dir('*.jpg'); % as i have images of jpg format.
n_files = length(images);
for i = 1 : n_files;
current_file = images(i).name;
I{i} = imread(current_file ;
but I want to separate images if image has pixels of 255 intensity then name them reference image else consider them standard image .
I need help.
Image Analyst
Image Analyst on 10 May 2014
Edited: Image Analyst on 10 May 2014
I fixed your code's formatting but as thanks I'd like you to read this: By the way, do you want to know some of the things wrong with your code?

Sign in to comment.

Answers (1)

Nitin on 10 May 2014
% test image
Img = zeros(20, 20);
% Find if '255' intensity pixels exist in the image
temp = find(Img==255);
if isempty(temp)
display('No tumour');


Find more on Biomedical Imaging in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!