%tform = cp2tform(cpstruct.inputpoints, cpstruct.basepoints, 'affine'); tform =…
- User
%tform = cp2tform(cpstruct.inputpoints, cpstruct.basepoints, 'affine');
tform = fitgeotrans(cpstruct.inputpoints, cpstruct.basepoints, 'affine'); % Structure of control Unable to resolve the name 'cpstruct.inputpoints'.
%imtransform(I1, tform, 'bilinear'); Iregistered = imwarp(I1, tform); %wrap transformed image with the original one tform requires one of the following: Sensor Fusion and Tracking Toolbox Navigation Toolbox Robotics System Toolbox ROS Toolbox UAV Toolbox
figure, imshow(Iregistered, []); %show registered image Unrecognized function or variable 'Iregistered'.
- Assistant
It seems that there are several issues with your code.
First, the error message "Unable to resolve the name 'cpstruct.inputpoints'" suggests that the variable
cpstructis not defined or does not contain the fieldsinputpointsandbasepoints. Make sure that you have definedcpstructproperly and that it contains the necessary fields.Second, the function
fitgeotransrequires additional toolboxes such as Sensor Fusion and Tracking Toolbox, Navigation Toolbox, Robotics System Toolbox, ROS Toolbox, or UAV Toolbox. If you do not have these toolboxes, you can use thecp2tformfunction instead.Finally, the error "Unrecognized function or variable 'Iregistered'" suggests that the variable
Iregisteredis not defined. Make sure you have executed the lineIregistered = imwarp(I1, tform);before trying to display it withimshow.Here is an example of how you can use the
cp2tformfunction and display the registered image: