Question regarding image registration.

2 次查看(过去 30 天)
Chathu
Chathu 2014-11-3
回答: Chathu 2014-11-4
I need to register some medical images which were taken by a regular video camera. But the images need a projective transformation due to differential skewing,scaling,translation and rotation. I used "cpselect" command. Brief description of my images are: inside a wax block(white in color), specific gland(brown in color) is present. I selected 4 corners of the wax block when using "cpselect" command. Unfortunately after running the code images are not registered properly.
Can you kindly help me out to correct this code or else show me an alternative path to register the images. Following is the code that i have used:
clc clear
A = imread('Pic1.jpg'); B = imread('Pic2.jpg'); cpselect(B,A)
subplot(221),imshow(A),title('Reference image') subplot(222),imshow(B),title('Moving image')
tform=cp2tform(input_points,base_points,'projective'); reg_out=imtransform(B,tform); subplot(223),imshow(reg_out),title('Registered image')

回答(2 个)

Anand
Anand 2014-11-3
I can't make any comments on whether the approach you've used with cpselect is reasonable because I can't see the images or the control points you've selected.
As for alternatives, have you tried using the imregister function?
  1 个评论
Image Analyst
Image Analyst 2014-11-3
Because he has skewing, etc. should he look into imwarp() or the camera calibration stuff in the Computer Vision System Toolbox?

请先登录,再进行评论。


Chathu
Chathu 2014-11-4
@ Anand- thank you for your response. imregister doesn't work for my images. Let me be more specific:Imagine a square where i have a specific gland within that square. Gland is in brown in color while the rest is white in color. Using cpselect- i selected 4 corners of the square. Since the images are off the scale,slanted,skewed i had to do a projective transformation. Though i used projective transformation, images were not registered properly. I wonder what is interferring for the image registration? Any thoughts?
@ Image Analyst: thank you for your reply. imwarp only works for MatLab2013a or later version, correct? Also, mathworks says cp2form is not recommended and they recommend fitgeotrans instead? Does Mathlab 2013a is compatible with that function?
Actually,in order to perform the image registration i need to do a point selection or else is there anyone who knows how to select a line along the border of the square, so then i can use that line detection to 4 sides of the square, same as cpselect.

Community Treasure Hunt

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

Start Hunting!

Translated by