fiducials icon indicating copy to clipboard operation
fiducials copied to clipboard

Subpixel corner detection with OpenCV 3.3

Open jim-v opened this issue 8 years ago • 6 comments

OpenCV3.3 provides two options for corner detection:

        CORNER_REFINE_NONE,     // default corners
        CORNER_REFINE_SUBPIX,   // refine the corners using subpix
        CORNER_REFINE_CONTOUR   // refine the corners using the contour-points
};

We need to figure out which one is best for us and make that the default.

Done when we release a package with the new default.

jim-v avatar Nov 09 '17 16:11 jim-v

Adding on to this issue, we should have the different modes exposed through dynamic reconfigure, if we can figure out a way to change the configuration options based on the OpenCV version. (maybe import opencv in the dynamic reconfigure python script?)

rohbotics avatar Nov 09 '17 22:11 rohbotics

In the current code there, is a bool for doing subpixel corner detection or not, and a bool for choosing between the two modes of doing it. The second setting has no effect in OpenCV 3.2.

jimvaughan avatar Nov 09 '17 23:11 jimvaughan

Unable to build package with the latest version. I'm assuming it is related to this issue. I'm running OpenCV 3.3.1. Older version of fiducials works fine.

Here is the build error message:

Scanning dependencies of target mavros
../src/fiducials/aruco_detect/src/aruco_detect.cpp: In member function ‘void FiducialsNode::configCallback(aruco_detect::DetectorParamsConfig&, uint32_t)’:
../src/fiducials/aruco_detect/src/aruco_detect.cpp:225:26: error: ‘struct cv::aruco::DetectorParameters’ has no member named ‘cornerRefinementMethod’
          detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_SUBPIX;
                          ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp:225:51: error: ‘CORNER_REFINE_SUBPIX’ is not a member of ‘cv::aruco’
          detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_SUBPIX;
                                                   ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp:228:26: error: ‘struct cv::aruco::DetectorParameters’ has no member named ‘cornerRefinementMethod’
          detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_CONTOUR;
                          ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp:228:51: error: ‘CORNER_REFINE_CONTOUR’ is not a member of ‘cv::aruco’
          detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_CONTOUR;
                                                   ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp:232:24: error: ‘struct cv::aruco::DetectorParameters’ has no member named ‘cornerRefinementMethod’
        detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_NONE;
                        ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp:232:49: error: ‘CORNER_REFINE_NONE’ is not a member of ‘cv::aruco’
        detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_NONE;
                                                 ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp: In constructor ‘FiducialsNode::FiducialsNode(ros::NodeHandle&)’:
../src/fiducials/aruco_detect/src/aruco_detect.cpp:438:26: error: ‘struct cv::aruco::DetectorParameters’ has no member named ‘cornerRefinementMethod’
          detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_SUBPIX;
                          ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp:438:51: error: ‘CORNER_REFINE_SUBPIX’ is not a member of ‘cv::aruco’
          detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_SUBPIX;
                                                   ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp:441:26: error: ‘struct cv::aruco::DetectorParameters’ has no member named ‘cornerRefinementMethod’
          detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_CONTOUR;
                          ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp:441:51: error: ‘CORNER_REFINE_CONTOUR’ is not a member of ‘cv::aruco’
          detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_CONTOUR;
                                                   ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp:445:24: error: ‘struct cv::aruco::DetectorParameters’ has no member named ‘cornerRefinementMethod’
        detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_NONE;
                        ^
../src/fiducials/aruco_detect/src/aruco_detect.cpp:445:49: error: ‘CORNER_REFINE_NONE’ is not a member of ‘cv::aruco’
        detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_NONE;

nav-go avatar Nov 25 '17 05:11 nav-go

@jim-v We should decide this once we have the test set mentioned in #81

rohbotics avatar Dec 26 '17 21:12 rohbotics

I am use the ros indigo distribution , with opencv version 3.3.1 , still its give error for aruco file like error: ‘struct cv::aruco::DetectorParameters’ has no member named ‘cornerRefinementMethod’ detectorParams->cornerRefinementMethod = aruco::CORNER_REFINE_SUBPIX;

vishalsleotechsa avatar Oct 02 '18 06:10 vishalsleotechsa

@vishalsleotechsa Please open a new issue for your build error, don't post it on existing issues. This will allow us to help you better. Thanks!

rohbotics avatar Oct 08 '18 04:10 rohbotics