UbiquityRobotics / fiducials

Simultaneous localization and mapping using fiducial markers.
BSD 3-Clause "New" or "Revised" License
263 stars 137 forks source link

Subpixel corner detection with OpenCV 3.3 #94

Open jim-v opened 6 years ago

jim-v commented 6 years ago

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.

rohbotics commented 6 years ago

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?)

jimvaughan commented 6 years ago

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.

nav-go commented 6 years ago

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;
rohbotics commented 6 years ago

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

vishalsleotechsa commented 5 years ago

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;

rohbotics commented 5 years ago

@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!