You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the example of the RANSAC function, there is a part where the coordinates calculated by corner_peaks and corner_subpix are used as arguments of AffineTransform.estimate and ransac.
# estimate affine transform model using all coordinatesmodel=AffineTransform()
model.estimate(src, dst)
# robustly estimate affine transform model with RANSACmodel_robust, inliers=ransac((src, dst), AffineTransform, min_samples=3,
residual_threshold=2, max_trials=100)
outliers=inliers==False
The output of corner_peaks is in the form (row, col), but the arguments of estimate and ransac are in the form (col, row).
Since the necessary coordinate conversion has not been done, the coordinates are exchanged and minus is added to the rotation direction in the print section.
I think it would be less confusing for the reader if we exchange row and col just before passing to estimate and ransac, and just print the parameters directly.
Like this.
# exchange coordinatesdefflipxy(points):
returnnp.stack([points[:, 1], points[:, 0]]).T# estimate affine transform model using all coordinatesmodel=AffineTransform()
model.estimate(flipxy(src), flipxy(dst))
# robustly estimate affine transform model with RANSACmodel_robust, inliers=ransac((flipxy(src), flipxy(dst)),
AffineTransform, min_samples=3,
residual_threshold=2, max_trials=100)
By the way, the plot_matches used at the end of the example assumes the format (row, col), so I think it is better to leave the src and dst in the global space in the current format (row, col).
The text was updated successfully, but these errors were encountered:
Description
In the example of the RANSAC function, there is a part where the coordinates calculated by
corner_peaks
andcorner_subpix
are used as arguments ofAffineTransform.estimate
andransac
.The output of
corner_peaks
is in the form (row, col), but the arguments ofestimate
andransac
are in the form (col, row).Since the necessary coordinate conversion has not been done, the coordinates are exchanged and minus is added to the rotation direction in the print section.
I think it would be less confusing for the reader if we exchange row and col just before passing to
estimate
andransac
, and just print the parameters directly.Like this.
By the way, the
plot_matches
used at the end of the example assumes the format (row, col), so I think it is better to leave the src and dst in the global space in the current format (row, col).The text was updated successfully, but these errors were encountered: