diff --git a/README.md b/README.md index c3456233c5..e7690419d6 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ provides production quality support for this module. ### How to build OpenCV with extra modules -You can build OpenCV, so it will include the modules from this repository. +You can build OpenCV, so it will include the modules from this repository. Contrib modules are under constant development and it is recommended to use them alongside the master branch or latest releases of OpenCV. + Here is the CMake command for you: ``` @@ -46,10 +47,12 @@ If you prefer using the gui version of cmake (cmake-gui), then, you can add `ope 7. build the `opencv` core with the method you chose (make and make install if you chose Unix makfile at step 6) +8. to run, linker flags to contrib modules will need to be added to use them in your code/IDE. For example to use the aruco module, "-lopencv_aruco" flag will be added. + ### Update the repository documentation In order to keep a clean overview containing all contributed modules the following files need to be created/adapted. 1. Update the README.md file under the modules folder. Here you add your model with a single line description. -2. Add a README.md inside your own module folder. This README explains which functionality (seperate functions) is available, links to the corresponding samples and explains in somewhat more detail what the module is expected to do. If any extra requirements are needed to build the module without problems, add them here also. \ No newline at end of file +2. Add a README.md inside your own module folder. This README explains which functionality (seperate functions) is available, links to the corresponding samples and explains in somewhat more detail what the module is expected to do. If any extra requirements are needed to build the module without problems, add them here also. diff --git a/modules/aruco/samples/calibrate_camera.cpp b/modules/aruco/samples/calibrate_camera.cpp index 0ffbc8acda..f732967ea9 100644 --- a/modules/aruco/samples/calibrate_camera.cpp +++ b/modules/aruco/samples/calibrate_camera.cpp @@ -58,7 +58,7 @@ const char* about = const char* keys = "{w | | Number of squares in X direction }" "{h | | Number of squares in Y direction }" - "{l | | Marker side lenght (in meters) }" + "{l | | Marker side length (in meters) }" "{s | | Separation between two consecutive markers in the grid (in meters) }" "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " diff --git a/modules/aruco/samples/calibrate_camera_charuco.cpp b/modules/aruco/samples/calibrate_camera_charuco.cpp index 7c346fbf0f..0b2934919c 100644 --- a/modules/aruco/samples/calibrate_camera_charuco.cpp +++ b/modules/aruco/samples/calibrate_camera_charuco.cpp @@ -57,8 +57,8 @@ const char* about = const char* keys = "{w | | Number of squares in X direction }" "{h | | Number of squares in Y direction }" - "{sl | | Square side length (in pixels) }" - "{ml | | Marker side length (in pixels) }" + "{sl | | Square side length (in meters) }" + "{ml | | Marker side length (in meters) }" "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," diff --git a/modules/aruco/samples/create_board.cpp b/modules/aruco/samples/create_board.cpp index f599bb6a13..937fe5b5f7 100644 --- a/modules/aruco/samples/create_board.cpp +++ b/modules/aruco/samples/create_board.cpp @@ -48,7 +48,7 @@ const char* keys = "{@outfile | | Output image }" "{w | | Number of markers in X direction }" "{h | | Number of markers in Y direction }" - "{l | | Marker side lenght (in pixels) }" + "{l | | Marker side length (in pixels) }" "{s | | Separation between two consecutive markers in the grid (in pixels)}" "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " diff --git a/modules/aruco/samples/create_board_charuco.cpp b/modules/aruco/samples/create_board_charuco.cpp index f21b90bbfb..1131382013 100644 --- a/modules/aruco/samples/create_board_charuco.cpp +++ b/modules/aruco/samples/create_board_charuco.cpp @@ -48,8 +48,8 @@ const char* keys = "{@outfile | | Output image }" "{w | | Number of squares in X direction }" "{h | | Number of squares in Y direction }" - "{sl | | Square side lenght (in pixels) }" - "{ml | | Marker side lenght (in pixels) }" + "{sl | | Square side length (in pixels) }" + "{ml | | Marker side length (in pixels) }" "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," diff --git a/modules/aruco/samples/create_diamond.cpp b/modules/aruco/samples/create_diamond.cpp index 4534fe2d23..66aec22743 100644 --- a/modules/aruco/samples/create_diamond.cpp +++ b/modules/aruco/samples/create_diamond.cpp @@ -49,8 +49,8 @@ namespace { const char* about = "Create a ChArUco marker image"; const char* keys = "{@outfile | | Output image }" - "{sl | | Square side lenght (in pixels) }" - "{ml | | Marker side lenght (in pixels) }" + "{sl | | Square side length (in pixels) }" + "{ml | | Marker side length (in pixels) }" "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," diff --git a/modules/aruco/samples/detect_board_charuco.cpp b/modules/aruco/samples/detect_board_charuco.cpp index b537e45de0..57f0c0d2ff 100644 --- a/modules/aruco/samples/detect_board_charuco.cpp +++ b/modules/aruco/samples/detect_board_charuco.cpp @@ -51,8 +51,8 @@ const char* about = "Pose estimation using a ChArUco board"; const char* keys = "{w | | Number of squares in X direction }" "{h | | Number of squares in Y direction }" - "{sl | | Square side lenght (in pixels) }" - "{ml | | Marker side lenght (in pixels) }" + "{sl | | Square side length (in meters) }" + "{ml | | Marker side length (in meters) }" "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," diff --git a/modules/aruco/samples/detect_diamonds.cpp b/modules/aruco/samples/detect_diamonds.cpp index f60b706998..eda0dfc19a 100644 --- a/modules/aruco/samples/detect_diamonds.cpp +++ b/modules/aruco/samples/detect_diamonds.cpp @@ -49,8 +49,8 @@ using namespace cv; namespace { const char* about = "Detect ChArUco markers"; const char* keys = - "{sl | | Square side lenght (in pixels) }" - "{ml | | Marker side lenght (in pixels) }" + "{sl | | Square side length (in meters) }" + "{ml | | Marker side length (in meters) }" "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," diff --git a/modules/aruco/samples/detector_params.yml b/modules/aruco/samples/detector_params.yml index 764c717d59..ab94c03cfa 100644 --- a/modules/aruco/samples/detector_params.yml +++ b/modules/aruco/samples/detector_params.yml @@ -1,5 +1,8 @@ %YAML:1.0 nmarkers: 1024 +adaptiveThreshWinSizeMin: 3 +adaptiveThreshWinSizeMax: 23 +adaptiveThreshWinSizeStep: 10 adaptiveThreshWinSize: 21 adaptiveThreshConstant: 7 minMarkerPerimeterRate: 0.03 @@ -8,6 +11,8 @@ polygonalApproxAccuracyRate: 0.05 minCornerDistance: 10.0 minDistanceToBorder: 3 minMarkerDistance: 10.0 +minMarkerDistanceRate: 0.05 +doCornerRefinement: false cornerRefinementWinSize: 5 cornerRefinementMaxIterations: 30 cornerRefinementMinAccuracy: 0.1 @@ -15,3 +20,5 @@ markerBorderBits: 1 perspectiveRemovePixelPerCell: 8 perspectiveRemoveIgnoredMarginPerCell: 0.13 maxErroneousBitsInBorderRate: 0.04 +minOtsuStdDev: 5.0 +errorCorrectionRate: 0.6 diff --git a/modules/aruco/tutorials/aruco_board_detection/aruco_board_detection.markdown b/modules/aruco/tutorials/aruco_board_detection/aruco_board_detection.markdown index 0760feb234..2ec5ef9ddb 100644 --- a/modules/aruco/tutorials/aruco_board_detection/aruco_board_detection.markdown +++ b/modules/aruco/tutorials/aruco_board_detection/aruco_board_detection.markdown @@ -155,6 +155,11 @@ The output image will be something like this: A full working example of board creation is included in the ```create_board.cpp``` inside the module samples folder. +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + "_output path_/aboard.png" -w=5 -h=7 -l=100 -s=10 -d=10 +``` + Finally, a full example of board detection: ``` c++ @@ -204,6 +209,12 @@ Sample video: A full working example is included in the ```detect_board.cpp``` inside the module samples folder. +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + -c="_path_"/calib.txt" "_path_/aboard.png" -w=5 -h=7 -l=100 -s=10 -d=10 +``` + + Refine marker detection ----- diff --git a/modules/aruco/tutorials/aruco_board_detection/images/board.jpg b/modules/aruco/tutorials/aruco_board_detection/images/board.jpg index 2edc06fc3d..0f2c25b559 100644 Binary files a/modules/aruco/tutorials/aruco_board_detection/images/board.jpg and b/modules/aruco/tutorials/aruco_board_detection/images/board.jpg differ diff --git a/modules/aruco/tutorials/aruco_calibration/aruco_calibration.markdown b/modules/aruco/tutorials/aruco_calibration/aruco_calibration.markdown index 4c3d726b3d..e9f6e36efd 100644 --- a/modules/aruco/tutorials/aruco_calibration/aruco_calibration.markdown +++ b/modules/aruco/tutorials/aruco_calibration/aruco_calibration.markdown @@ -61,6 +61,11 @@ Finally, the ```calibrationFlags``` parameter determines some of the options for A full working example is included in the ```calibrate_camera_charuco.cpp``` inside the module samples folder. +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + _output path_" -dp="_path_/detector_params.yml" -w=5 -h=7 -sl=0.04 -ml=0.02 -d=10 +``` + Calibration with ArUco Boards @@ -100,3 +105,8 @@ The rest of parameters are the same than in ```calibrateCameraCharuco()```, exce any ```Board``` object. A full working example is included in the ```calibrate_camera.cpp``` inside the module samples folder. + +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + "_path_/calib.txt" -w=5 -h=7 -l=100 -s=10 -d=10 +``` diff --git a/modules/aruco/tutorials/aruco_detection/aruco_detection.markdown b/modules/aruco/tutorials/aruco_detection/aruco_detection.markdown index 7329086d5a..4ebda3e4a1 100644 --- a/modules/aruco/tutorials/aruco_detection/aruco_detection.markdown +++ b/modules/aruco/tutorials/aruco_detection/aruco_detection.markdown @@ -103,6 +103,10 @@ The generated image is: A full working example is included in the ```create_marker.cpp``` inside the module samples folder. +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + "/Users/Sarthak/Dropbox/OpenCV_GSoC/marker.png" -d=10 -id=1 +``` Marker Detection ------ @@ -226,6 +230,11 @@ output vector of rejected candidates. A full working example is included in the ```detect_markers.cpp``` inside the module samples folder. +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + -c="_path_/calib.txt" -d=10 +``` + Pose Estimation @@ -331,6 +340,12 @@ Sample video: A full working example is included in the ```detect_markers.cpp``` inside the module samples folder. +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + -c="_path_/calib.txt" -d=10 +``` + + Selecting a dictionary ------ diff --git a/modules/aruco/tutorials/aruco_detection/images/marker23.jpg b/modules/aruco/tutorials/aruco_detection/images/marker23.jpg index 4e9addd25d..c2de747525 100644 Binary files a/modules/aruco/tutorials/aruco_detection/images/marker23.jpg and b/modules/aruco/tutorials/aruco_detection/images/marker23.jpg differ diff --git a/modules/aruco/tutorials/charuco_detection/charuco_detection.markdown b/modules/aruco/tutorials/charuco_detection/charuco_detection.markdown index 959ba715f4..1d66970332 100644 --- a/modules/aruco/tutorials/charuco_detection/charuco_detection.markdown +++ b/modules/aruco/tutorials/charuco_detection/charuco_detection.markdown @@ -78,6 +78,11 @@ The output image will be something like this: A full working example is included in the ```create_board_charuco.cpp``` inside the module samples folder. +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + "_ output path_/chboard.png" -w=5 -h=7 -sl=200 -ml=120 -d=10 +``` + ChArUco Board Detection ------ @@ -240,6 +245,11 @@ Sample video: A full working example is included in the ```detect_board_charuco.cpp``` inside the module samples folder. +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + -c="_path_/calib.txt" -dp="_path_/detector_params.yml" -w=5 -h=7 -sl=0.04 -ml=0.02 -d=10 +``` + ChArUco Pose Estimation ------ @@ -312,3 +322,8 @@ A full example of ChArUco detection with pose estimation: ``` A full working example is included in the ```detect_board_charuco.cpp``` inside the module samples folder. + +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + "_path_/calib.txt" -dp="_path_/detector_params.yml" -w=5 -h=7 -sl=0.04 -ml=0.02 -d=10 +``` diff --git a/modules/aruco/tutorials/charuco_detection/images/board.jpg b/modules/aruco/tutorials/charuco_detection/images/board.jpg new file mode 100644 index 0000000000..eda7c86ca3 Binary files /dev/null and b/modules/aruco/tutorials/charuco_detection/images/board.jpg differ diff --git a/modules/aruco/tutorials/charuco_detection/images/charucoboard.jpg b/modules/aruco/tutorials/charuco_detection/images/charucoboard.jpg deleted file mode 100644 index c0e7a85fc5..0000000000 Binary files a/modules/aruco/tutorials/charuco_detection/images/charucoboard.jpg and /dev/null differ diff --git a/modules/aruco/tutorials/charuco_diamond_detection/charuco_diamond_detection.markdown b/modules/aruco/tutorials/charuco_diamond_detection/charuco_diamond_detection.markdown index 479d59dcec..9f56cc2e93 100644 --- a/modules/aruco/tutorials/charuco_diamond_detection/charuco_diamond_detection.markdown +++ b/modules/aruco/tutorials/charuco_diamond_detection/charuco_diamond_detection.markdown @@ -60,6 +60,10 @@ The image produced will be: A full working example is included in the ```create_diamond.cpp``` inside the module samples folder. +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + "_path_/mydiamond.png" -sl=200 -ml=120 -d=10 -ids=45,68,28,74 +``` ChArUco Diamond Detection ------ @@ -116,6 +120,10 @@ The result is the same that the one produced by ```drawDetectedMarkers()```, but A full working example is included in the ```detect_diamonds.cpp``` inside the module samples folder. +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + -c="_path_/calib.txt" -dp="_path_/detector_params.yml" -sl=0.04 -ml=0.02 -d=10 +``` ChArUco Diamond Pose Estimation ------ @@ -159,3 +167,8 @@ Sample video: @endhtmlonly A full working example is included in the ```detect_diamonds.cpp``` inside the module samples folder. + +Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like +``` c++ + -c="_output path_/calib.txt" -dp="_path_/detector_params.yml" -sl=0.04 -ml=0.02 -d=10 +```