Control Point Selection Tool
h = cpselect(moving,fixed,___)
the Control Point Selection Tool, a graphical user interface that
enables you to select control points in two related images.
the image that needs to be warped to bring it into the coordinate
system of the
be either variables that contain grayscale, truecolor, or binary images,
or strings that identify files containing these images. The Control
Point Selection Tool returns the control points in a
(For more information, see Control Point Selection Procedure.)
an initial set of control points that are stored in
This syntax allows you to restart
the state of control points previously saved in
a set of initial pairs of control points.
fixedPoints are m-by-2
matrices that store the
h = cpselect(moving,fixed,___) returns
h to the tool. You can use the
to close the tool from the command line.
cpselect(___,param1, val1,___) starts
specifying parameters and corresponding values that control various
aspects of the tool. Parameter names can be abbreviated, and case
does not matter. Parameters include:
Logical scalar that controls whether
The value affects the output arguments:
The images can be grayscale, truecolor, or binary. A grayscale
image can be
double. A truecolor image can be
double. A binary image is of class
Start Control Point Selection tool with saved images.
Start Control Point Selection tool with images and control points stored in variables in the workspace.
I = checkerboard; J = imrotate(I,30); fixedPoints = [11 11; 41 71]; movingPoints = [14 44; 70 81]; cpselect(J,I,movingPoints,fixedPoints);
Register an aerial photo to an orthophoto. Specify the
to block until control point selection is complete.
aerial = imread('westconcordaerial.png'); figure, imshow(aerial) ortho = imread('westconcordorthophoto.png'); figure, imshow(ortho) load westconcordpoints % load some points that were already picked % Ask cpselect to wait for you to pick some more points [aerial_points,ortho_points] = ... cpselect(aerial,'westconcordorthophoto.png',... movingPoints,fixedPoints,... 'Wait',true); t_concord = fitgeotrans(aerial_points,ortho_points,'projective'); Rortho = imref2d(size(ortho)); aerial_registered = imwarp(aerial,t_concord,'OutputView',Rortho); figure, imshowpair(aerial_registered,ortho,'blend')
cpselect uses the following general procedure
for control-point prediction.
Find all valid pairs of control points.
Infer a spatial transformation between
points using method that depends on the number of valid pairs, as
4 or more pairs
Apply spatial transformation to the new point to generate the predicted point.
Display predicted point.