Registering multiple images - cpselect in loop?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all,
Apologies if this is a trivial question - I'm relatively new to MATLAB compared to other languages. I'm working on registering multiple images from different modalities. I'm currently using the image processing toolbox, specifically the cpselect tool to do control point selection.
I've setup a small script to loop to allow me to select the corresponding images, then do the control point selection, then finally save the transformation matrix. Unfortunately, the loop executes before the cpselect command is finished. Is there a way to "pause" the loop like pausing a thread in MATLAB?
for i = 1:10
[f,p] = uigetfile({'*.png;*.jpg;*.bmp;*.tif','Supported images';...
'*.png','Portable Network Graphics (*.png)';...
'*.jpg','J-PEG (*.jpg)';...
'*.bmp','Bitmap (*.bmp)';...
'*.tif','Tagged Image File (*.tif,)';...
'*.*','All files (*.*)'});
rgb = imread([p f]);
[f,p] = uigetfile({'*.png;*.jpg;*.bmp;*.tif','Supported images';...
'*.png','Portable Network Graphics (*.png)';...
'*.jpg','J-PEG (*.jpg)';...
'*.bmp','Bitmap (*.bmp)';...
'*.tif','Tagged Image File (*.tif,)';...
'*.*','All files (*.*)'});
thermal = imread([p f]);
cpselect(rgb, thermal);
% Want to "pause" the loop here, so I can select the control points for the set of images, before moving on to the next pair of images
a = 'mytform_' ;
b = num2str(i) ;
c = '.mat' ;
file_name = [a b c];
mytform = fitgeotrans(movingPoints, fixedPoints, 'affine');
save(file_name, 'mytform')
end
0 Kommentare
Antworten (1)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!