fitgeotrans does not align my image
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yannick
el 2 de Jun. de 2014
Respondida: Yannick
el 3 de Jun. de 2014
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 comentarios
Respuesta aceptada
Alex Taylor
el 2 de Jun. de 2014
Use the 'outputView' name/value option when calling imwarp, as is shown in the examples for fitgeotrans. This will fix the issue.
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre 3-D Volumetric Image Processing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!