Control Point Selection tool
cpselect(
starts
the Control Point Selection tool that enables you to select control
points in two related images. moving
,fixed
)moving
is the image to
be warped, which brings it into the coordinate system of the
fixed
image.
When the Control Point Selection tool is open, you can add, move, and
delete control points interactively with the mouse. When you are done
modifying the control points, export them to the workspace by selecting
Export Points to Workspace from the
File menu. The tool can return the
coordinates of valid selected pairs of moving and fixed control points
in two numeric vectors. The tool can also return all selected control
points and indexing information in a cpstruct
structure that saves the state of the tool so that you can restart the
tool later. For more information about using the tool, see Control Point Selection Procedure.
cpselect(
starts the Control Point Selection tool with an initial set of valid
moving and fixed control point pairs,
moving
,fixed
,initialMovingPoints
,initialFixedPoints
)initialMovingPoints
and
initialFixedPoints
.
cpselect(
starts the Control Point Selection tool with an initial set of control
points and indexing information that are stored in
moving
,fixed
,cpstruct_in
)cpstruct_in
. Use this syntax to restart the
Control Point Selection tool from a previously saved state.
returns a handle h
= cpselect(___)h
to the Control Point Selection
tool. You can use the close(h)
command to close the
tool from the command line.
returns a handle h
= cpselect(___,'Wait',false)h
to the Control Point Selection
tool. You can use the close(h)
syntax to close the
tool from the command line. In contrast to setting
'Wait'
as true
, this syntax
lets you run cpselect
at the same time as you run
other programs in MATLAB®.
[
takes control of the MATLAB command line until you finish selecting control points.
When you have finished selecting control points, return to the workspace
by closing the tool. selectedMovingPoints
,selectedFixedPoints
]
= cpselect(___,'Wait',true)cpselect
returns the coordinates
of valid selected pairs of moving and fixed control points in
selectedMovingPoints
and
selectedFixedPoints
.
When calling cpselect
in a script,
specify the 'Wait'
option as true
.
The 'Wait'
option causes cpselect
to
block the MATLAB command line until control points have been
selected and returned. If you do not use the 'Wait'
option, cpselect
returns
control immediately and your script continues without allowing time
for control point selection. Additionally, without the 'Wait'
option, cpselect
does
not return the control points as return values.
cpselect
uses the following general procedure
for control-point prediction.
Find all valid pairs of control points.
Infer a spatial transformation between
moving
and fixed
control points using a method that depends on the number of valid
control point pairs.
Transformation Type | Minimum Number of Control Point Pairs |
---|---|
Nonreflective similarity | 2 |
Affine | 3 |
Projective | 4 |
Apply the spatial transformation to the new point. This transformation generates the predicted point.
Display the predicted point.
cpcorr
| cpstruct2pairs
| fitgeotrans
| imtool
| imwarp