Error using listbox multiselection for image SNR manipulation

1 Ansicht (letzte 30 Tage)
Jason
Jason am 12 Jan. 2016
Kommentiert: Jason am 12 Jan. 2016
I am trying to use a listbox multiselection to add images together and median combine for SNR improvement comparison reasons. I first allow the multiselection from the list box using:
%Get selected files from listbox selection
set(handles.listbox1, 'Max',2,'Min',0) %allow multi selection
list=handles.listbox1;
temp = get(list, 'String');
selected = temp(get(list, 'Value'));
set(list, 'Value', []); %Clear current selection for next time
I then use the following to perform the sum and median combine:
l=length(selected)
path=getappdata(0,'Folder'); %Get the folder
imSum=[]; %initialise
imStack=[];
for i=1:l
file=fullfile(path,selected{i})
im=double(imread(file));
imSum=imSum+im;
imStack=cat(3,imMed,im)
end
imMed=median(ImgStack,3);
However, I get an error:
Error using +
Matrix dimensions must agree.
Error in MultiImageanalysis>pushbuttonAddImages_Callback (line 1372)
imSum=imSum+im;

Akzeptierte Antwort

Jan
Jan am 12 Jan. 2016
Bearbeitet: Jan am 12 Jan. 2016
The error means, that the image files have different dimensions. Either they have different sizes or some are true-color, while others are indexed images.
I'd start with:
imSum = 0;

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by