You are on page 1of 4

Tugas individu Computer Vision

Nama: Buya Hamka Ikram


Nim : 2020230008

Register Images with Projection Distortion Using Control Points


Disini kita akan menunjukan cara mendaftarkan dua buah gambar dengan memilih titik control yang sama
untuk kedua buah gambar dengan memiliki titik control yang sama untuk kedua gambar dan
menyimpulkan transformasi geometric yang menyelaraskan titik kontrol

Membaca gambar
Read gambar westconcordorthophoto.png kedalam workspace. Gambar ini adalah orthophoto yang
siap di registrasi ke ground.
ortho = imread('westconcordorthophoto.png');
imshow(ortho)
text(size(ortho,2),size(ortho,1)+15, ...
'Image courtesy of Massachusetts Executive Office of Environmental Affairs', ...
'FontSize',7,'HorizontalAlignment','right');

Read the image westconcordaerial.png into the workspace. This image was taken from an airplane
and is distorted relative to the orthophoto. Because the unregistered image was taken from a distance
and the topography is relatively flat, it is likely that most of the distortion is projective.
unregistered = imread('westconcordaerial.png');
imshow(unregistered)
text(size(unregistered,2),size(unregistered,1)+15, ...
'Image courtesy of mPower3/Emerge', ...
'FontSize',7,'HorizontalAlignment','right');

Select Control Point Pairs


To select control points interactively, open the Control Point Selection tool by using
the cpselect function. Control points are landmarks that you can find in both images, such as a road
intersection or a natural feature. Select at least four pairs of control points so that cpselect can fit a
projective transformation to the control points. After you have selected corresponding moving and fixed
points, close the tool to return to the workspace.
[mp,fp] = cpselect(unregistered,ortho,'Wait',true);
Infer Geometric Transformation
Find the parameters of the projective transformation that best aligns the moving and fixed points by using
the fitgeotrans function.
t = fitgeotrans(mp,fp,'projective');

Transform Unregistered Image


To apply the transformation to the unregistered aerial image, use the imwarp function. Specify that the
size and position of the transformed image match the size and position of the ortho image by using the
'OutputView' name-value pair argument.
Rfixed = imref2d(size(ortho));
registered = imwarp(unregistered,t,'OutputView',Rfixed);
See the result of the registration by overlaying the transformed image over the original orthophoto.
imshowpair(ortho,registered,'blend')

You might also like