fitgeotrans does not align my image
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Context: I am trying to use the Image Processing toolbox to find damage in materials. I first take a picture of my material before damaging it. I draw some markers on the material for alignment in MATLAB. Then I damage the material and I take a picture again.
Problem: I align two images of the same material by markers (see attachment). I first align them and then I want to see the difference (=damage) between the images. Unfortunately, the images do not align after fitgeotrans, as evident by the overlay image in imshowpair (in attachment). My second problem has to do with imabsdiff. After transformation, my images obviously have a slightly different size (due to the rotation). This impedes imabsdiff from working. Is there an easy solution to disregard the section where my fixed image is smaller than the warped one?
Do I make some basic error or is something else going on?
pre = imread('predamage');
post = imread('postdamage');
imwrite(pre, 'pret.tiff');
imwrite(post, 'postt.tiff');
moving = imread('postt.tiff');
fixed = imread('pret.tiff');
[moving_out,fixed_out] = cpselect(moving,fixed,'Wait', true);
match = fitgeotrans(moving_out,fixed_out, 'Similarity');
warped = imwarp(moving,match);
imshowpair(fixed,warped)
diff = imabsdiff(fixed,warped).*32; %Amplify the differences
imshow(diff)
Thanks in advance!
PS: I first convert from .JPG to .TIFF because I will possibly use a raw image format in the future.
0 Commenti
Risposta accettata
Alex Taylor
il 2 Giu 2014
Use the 'outputView' name/value option when calling imwarp, as is shown in the examples for fitgeotrans. This will fix the issue.
0 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su 3-D Volumetric Image Processing in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!