# How to mark points in one image to other image using image registration?

2 views (last 30 days)
Nayana R on 25 Jan 2019
I have an x-ray image with some marked points and i want to mark same points in another x-ray image.
Here I used image registration and i adjust both images to one scale.Now I want to mark all the points in above image to be marked in the other images as shown below.
Here i want to extract the pints using another layer and put it in the unmarked image.
I tried the following code upto now.Can you suggest a solution for this?
%------------------Remove noise using median filter--------------------
img1=rgb2gray(img);
I = medfilt2(img1,[5, 5]);%add median filter
%------------frequency domain high pass filtering-----------------------
A = fft2(double(I));
A1=fftshift(A); % frequency scaling
% Gaussian Filter Response Calculation
[M, N]=size(A);
X=0:N-1;
Y=0:M-1;
[X, Y]=meshgrid(X,Y);
R=15; % filter size parameter
Lo=exp(-((X-(0.2*N)).^2+(Y-(0.2*M)).^2)./(2*R).^2);
Hi=1-Lo;
K=A1.*Hi;
K1=ifftshift(K);
B2=ifft2(K1);
%-----------------convert to spatial domain--------------------------
B2a =real(B2);
B2a=uint8(B2a);
%-------------------------Sharpening Image-------------------------------
B2a =imsharpen(B2a);
%----------------------------------- Contrast Streching-------------------
%==================================Background removal after enhancing============================================
grayImage =imcrop(grayImage,[75 140 1500 2000]);%crop image
th= 0.15; %thresholding value
binaryImage = imbinarize(grayImage,th);
binaryImage = imfill(binaryImage, 'holes');
binaryImage = bwareaopen(binaryImage, 100);
binaryImage = bwareafilt(binaryImage, 1);
binaryImage = imopen(binaryImage,true(5));
binaryImage = bwareafilt(binaryImage, 1);
binaryImage = imfill(binaryImage, 'holes');
binaryImage = imdilate(binaryImage,true(5));
skullFreeImage =grayImage;
skullFreeImage(~binaryImage) = 0;
skullFreeImage=imresize(skullFreeImage,[2400 1935]);
imwrite(skullFreeImage,'skullOnly.bmp');%save background removed image
%===========================================Image Registration==================================================
img2 = skullFreeImage;
[optimizer,metric]=imregconfig('multimodal');
registered=imregister(img1,img2,'similarity',optimizer,metric); % Register images
figure();imshow(registered);
title('Registered image');
figure()
imwrite(registered,'PointsMarkRegistered.bmp')
figure();
imshowpair(registered,img2);title('Registration','fontSize',12)

### Categories

Find more on Geometric Transformation and Image Registration in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!