forked from ros-perception/vision_opencv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rectifyRoi when used with binning and/or ROI (ros-perception#378)
* Fix rectifyRoi when used with binning and/or ROI The previous implementation used K_ and P_ (the matrices that include binning and ROI). However, the ROI is specified in unbinned and untransformed raw image coordinates (see REP-104), so rectifyRoi has to use K_full_ and P_full_. * test: Remove useless restoring of original state Each test runs in its own test fixture, so restoring the original state at the end of a test is not necessary. * Don't overwrite rectified_roi_dirty flag This fixes a problem with the following sequence: 1. fromCameraInfo is called with ROI A. | rectified_roi_dirty = true 2. rectifiedRoi is called | rectified_roi_dirty = false 3. fromCameraInfo is called with ROI B. | rectified_roi_dirty = true 4. fromCameraInfo is called with ROI B. | rectified_roi_dirty = false The bug is that rectified_roi_dirty was incorrectly set to `false` by the last line. If now rectifiedRoi is called again, the cached rectified_roi for ROI A will be returned, but it should be recalculated based on ROI B. This commit fixes that.
- Loading branch information
Showing
2 changed files
with
96 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters