Skip to content

(5.x) Merge 4.x #3333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 77 commits into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
f6a39c5
Merge pull request #3229 from AleksandrPanov:add_Dictionary_bindings
Apr 25, 2022
4c76620
Extend the interface of the ORB class
hakaboom Apr 29, 2022
c52e7fc
Merge pull request #3244 from hakaboom:extend_orb_interface_
opencv-pushbot May 4, 2022
a7e3630
Workflow for Github Actions to build and test OpenCV on Linux for 3.4
asenyaev May 11, 2022
c2005e4
Merge pull request #3241 from asenyaev:asen/add_linux_workflow_3.4
opencv-pushbot May 13, 2022
a878505
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
opencv-pushbot May 14, 2022
0a5cef2
Workflow for Github Actions to build and test OpenCV on Linux for 4.x
asenyaev Apr 28, 2022
654849a
Merge pull request #3242 from asenyaev:asen/add_linux_workflow_4.x
opencv-pushbot May 14, 2022
ac6a5d4
build: GCC12 warnings
alalek May 15, 2022
e55f677
Merge pull request #3253 from alalek:fix_warnings_gcc12_3.4
alalek May 17, 2022
176d81c
Move workflows to a dedicated repository for 4.x branch
asenyaev May 20, 2022
39530ea
Move workflows to a dedicated repository for 3.4 branch
asenyaev May 20, 2022
8864b30
Merge pull request #3257 from asenyaev:asen/move_workflows_3.4
alalek May 22, 2022
509a91f
Merge pull request #3258 from asenyaev:asen/move_workflows_4.x
alalek May 22, 2022
47d476e
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek May 23, 2022
3ae17ac
Update video_reader.cpp
TraubSimon May 25, 2022
e72e171
Merge pull request #3265 from TraubSimon:patch-1
alalek May 25, 2022
a590a59
update python samples
sturkmen72 May 25, 2022
9c4738b
Merge pull request #3248 from cudawarped:videoreader_decode_all_to_nv12
cudawarped May 27, 2022
84f8ea8
Merge pull request #3264 from sturkmen72:update_python_samples
alalek May 27, 2022
63cab1b
Merge pull request #3243 from vrabaud:3.4_ceres
vrabaud May 30, 2022
97a855f
remove const from functions returning by value
nglee Jun 1, 2022
0eda296
Merge pull request #3256 from AleksandrPanov:fix_aruco_axes_docs
Jun 2, 2022
b2904b9
Merge pull request #3247 from cudawarped:videoreader_add_rtsp_feature
cudawarped Jun 2, 2022
d276079
Fix cudacodec and cudastereo python bindings.
cudawarped Jun 2, 2022
6fdb6e2
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Jun 4, 2022
4eae7c8
Merge pull request #3266 from nglee:fix_return_by_const_value
alalek Jun 4, 2022
442085f
Merge pull request #3267 from cudawarped:fix_python_bindings
alalek Jun 4, 2022
2e3f918
aruco: fix missing solvePnP parameter, build warning
alalek Jun 5, 2022
db16caf
Merge pull request #3269 from alalek:aruco_merge_fixes
alalek Jun 5, 2022
30dc847
Fix compilation because of pointer/int comparison.
vrabaud Jun 8, 2022
559978e
Merge pull request #3272 from vrabaud:4.x_compile
alalek Jun 8, 2022
57db17e
Fix building error with OGRE 1.12.9
twistedfall Jun 8, 2022
98f6a2e
Merge pull request #3271 from twistedfall:ovis-build-fix
alalek Jun 9, 2022
e182fc8
Fix ceres manifold build
jmackay2 Jun 10, 2022
4c93cc9
Merge pull request #3274 from jmackay2:3.4_ceres_fix
alalek Jun 10, 2022
344295e
add workflows for macOS for contrib 4.x
fengyuentau Jun 15, 2022
19769f0
add workflows for macOS for contrib 3.4
fengyuentau Jun 15, 2022
fc4e8cb
Merge pull request #3281 from fengyuentau:macOS_workflows_for_3.4
alalek Jun 15, 2022
aca2aec
Merge pull request #3280 from fengyuentau:macOS_workflows_for_4.x
alalek Jun 15, 2022
7b77c35
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Jun 16, 2022
911ab34
aruco: fix solvePnP parameters
alalek Jun 16, 2022
d502f4c
Merge pull request #3284 from alalek:aruco_merge_fixes
alalek Jun 17, 2022
377e856
Fix file ending
jspricke Jun 24, 2022
3951e03
Merge pull request #3288 from Kumataro:4.x-issue_contrib3276
Kumataro Jun 25, 2022
940d910
Merge pull request #3277 from iago-suarez:4.x
iago-suarez Jun 29, 2022
9d0a451
Merge pull request #3296 from gvcallen:4.x
gvcallen Jun 30, 2022
79122d6
Merge pull request #3292 from jspricke:jpg_png
alalek Jul 4, 2022
a96a930
suppress warning on GCC 7 and later
tomoaki0705 Jul 6, 2022
ca2f333
Merge pull request #3298 from tomoaki0705:fixWarnings
alalek Jul 8, 2022
f471266
ximgproc: fix mismatched new delete
huangqinjin Jul 23, 2022
07daac3
Merge pull request #3306 from huangqinjin:fix
alalek Jul 24, 2022
3a41fd6
move april module
Apr 28, 2022
774faf3
update docs and refactoring
Jun 30, 2022
64804f0
fix docs/API
Jul 4, 2022
db55474
fix indentation, add enum prefix
Jul 4, 2022
4326ae5
remove readWrite() from API
Jul 4, 2022
b511cfa
add gridImpl
Jul 6, 2022
ba4d60e
add charucoImpl
Jul 6, 2022
d1fe61a
add CV_WRAP, add default Board constructor
AleksandrPanov Jul 7, 2022
39dabc1
add const
AleksandrPanov Jul 7, 2022
1f003fe
fix readWrite()
Jul 25, 2022
e5aa138
Workflow on Ubuntu 14.04 for 3.4 branch
asenyaev Jul 27, 2022
0fe993d
Rename jobs in GHA for 4.x
asenyaev Jul 27, 2022
9ffa7ac
Merge pull request #3309 from asenyaev:asen/ubuntu14.04_workflow_contrib
asmorkalov Aug 2, 2022
3a3e40a
Merge pull request #3310 from asenyaev:asen/rename_jobs
asmorkalov Aug 2, 2022
230b6c9
add set/get/dictionary/objPoints, update tests
Aug 3, 2022
8eaa8ac
Merge pull request #3240 from AleksandrPanov:aruco_add_class_API
asmorkalov Aug 5, 2022
839db44
Revert "suppress warning on GCC 7 and later"
alalek Aug 7, 2022
843df49
fix cuda mem leak and move cuda malloc out of critical path
kevinchristensen1 Aug 10, 2022
1d1dbe3
destroy texture object
kevinchristensen1 Aug 10, 2022
c5f4dff
Merge pull request #3324 from kevinchristensen1:gftt-cuda-fix
asmorkalov Aug 12, 2022
0da7255
Merge pull request #3319 from alalek:rework_psabi_warning
alalek Aug 13, 2022
2a6cc95
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Aug 14, 2022
b06dbd2
sfm: Fix unknown uint type error in mingw
Biswa96 Aug 18, 2022
d85887c
Merge pull request #3329 from Biswa96:sfml-uint-error
alalek Aug 20, 2022
429d111
Merge branch 4.x
alalek Aug 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
623 changes: 15 additions & 608 deletions modules/aruco/include/opencv2/aruco.hpp

Large diffs are not rendered by default.

286 changes: 286 additions & 0 deletions modules/aruco/include/opencv2/aruco/aruco_calib_pose.hpp

Large diffs are not rendered by default.

243 changes: 243 additions & 0 deletions modules/aruco/include/opencv2/aruco/board.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html
#ifndef __OPENCV_ARUCO_BOARD_HPP__
#define __OPENCV_ARUCO_BOARD_HPP__

#include <opencv2/core.hpp>
#include <vector>

namespace cv {
namespace aruco {
//! @addtogroup aruco
//! @{

class Dictionary;

/**
* @brief Board of markers
*
* A board is a set of markers in the 3D space with a common coordinate system.
* The common form of a board of marker is a planar (2D) board, however any 3D layout can be used.
* A Board object is composed by:
* - The object points of the marker corners, i.e. their coordinates respect to the board system.
* - The dictionary which indicates the type of markers of the board
* - The identifier of all the markers in the board.
*/
class CV_EXPORTS_W Board {
public:
CV_WRAP Board();

/** @brief Provide way to create Board by passing necessary data. Specially needed in Python.
* @param objPoints array of object points of all the marker corners in the board
* @param dictionary the dictionary of markers employed for this board
* @param ids vector of the identifiers of the markers in the board
*/
CV_WRAP static Ptr<Board> create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &dictionary, InputArray ids);

/** @brief Set ids vector
* @param ids vector of the identifiers of the markers in the board (should be the same size
* as objPoints)
*
* Recommended way to set ids vector, which will fail if the size of ids does not match size
* of objPoints.
*/
CV_WRAP void setIds(InputArray ids);

/** @brief change id for ids[index]
* @param index - element index in ids
* @param newId - new value for ids[index], should be less than Dictionary size
*/
CV_WRAP void changeId(int index, int newId);
/** @brief return ids
*/
CV_WRAP const std::vector<int>& getIds() const;

/** @brief set dictionary
*/
CV_WRAP void setDictionary(const Ptr<Dictionary> &dictionary);

/** @brief return dictionary
*/
CV_WRAP Ptr<Dictionary> getDictionary() const;

/** @brief set objPoints
*/
CV_WRAP void setObjPoints(const std::vector<std::vector<Point3f> > &objPoints);

/** @brief get objPoints
*/
CV_WRAP const std::vector<std::vector<Point3f> >& getObjPoints() const;

/** @brief get rightBottomBorder
*/
CV_WRAP const Point3f& getRightBottomBorder() const;

protected:
/** @brief array of object points of all the marker corners in the board each marker include its 4 corners in this order:
* - objPoints[i][0] - left-top point of i-th marker
* - objPoints[i][1] - right-top point of i-th marker
* - objPoints[i][2] - right-bottom point of i-th marker
* - objPoints[i][3] - left-bottom point of i-th marker
*
* Markers are placed in a certain order - row by row, left to right in every row.
* For M markers, the size is Mx4.
*/
CV_PROP std::vector<std::vector<Point3f> > objPoints;

/// the dictionary of markers employed for this board
CV_PROP Ptr<Dictionary> dictionary;

/// coordinate of the bottom right corner of the board, is set when calling the function create()
CV_PROP Point3f rightBottomBorder;

/** @brief vector of the identifiers of the markers in the board (same size than objPoints)
* The identifiers refers to the board dictionary
*/
CV_PROP_RW std::vector<int> ids;
};

/**
* @brief Draw a planar board
* @sa drawPlanarBoard
*
* @param board layout of the board that will be drawn. The board should be planar,
* z coordinate is ignored
* @param outSize size of the output image in pixels.
* @param img output image with the board. The size of this image will be outSize
* and the board will be on the center, keeping the board proportions.
* @param marginSize minimum margins (in pixels) of the board in the output image
* @param borderBits width of the marker borders.
*
* This function return the image of a planar board, ready to be printed. It assumes
* the Board layout specified is planar by ignoring the z coordinates of the object points.
*/
CV_EXPORTS_W void drawPlanarBoard(const Ptr<Board> &board, Size outSize, OutputArray img,
int marginSize = 0, int borderBits = 1);

/**
* @brief Planar board with grid arrangement of markers
* More common type of board. All markers are placed in the same plane in a grid arrangement.
* The board can be drawn using drawPlanarBoard() function (@sa drawPlanarBoard)
*/

class CV_EXPORTS_W GridBoard : public Board {
public:
CV_WRAP GridBoard();
/**
* @brief Draw a GridBoard
*
* @param outSize size of the output image in pixels.
* @param img output image with the board. The size of this image will be outSize
* and the board will be on the center, keeping the board proportions.
* @param marginSize minimum margins (in pixels) of the board in the output image
* @param borderBits width of the marker borders.
*
* This function return the image of the GridBoard, ready to be printed.
*/
CV_WRAP void draw(Size outSize, OutputArray img, int marginSize = 0, int borderBits = 1);

/**
* @brief Create a GridBoard object
*
* @param markersX number of markers in X direction
* @param markersY number of markers in Y direction
* @param markerLength marker side length (normally in meters)
* @param markerSeparation separation between two markers (same unit as markerLength)
* @param dictionary dictionary of markers indicating the type of markers
* @param firstMarker id of first marker in dictionary to use on board.
* @return the output GridBoard object
*
* This functions creates a GridBoard object given the number of markers in each direction and
* the marker size and marker separation.
*/
CV_WRAP static Ptr<GridBoard> create(int markersX, int markersY, float markerLength, float markerSeparation,
const Ptr<Dictionary> &dictionary, int firstMarker = 0);

CV_WRAP Size getGridSize() const;
CV_WRAP float getMarkerLength() const;
CV_WRAP float getMarkerSeparation() const;

protected:
struct GridImpl;
Ptr<GridImpl> gridImpl;
friend class CharucoBoard;
};

/**
* @brief ChArUco board
* Specific class for ChArUco boards. A ChArUco board is a planar board where the markers are placed
* inside the white squares of a chessboard. The benefits of ChArUco boards is that they provide
* both, ArUco markers versatility and chessboard corner precision, which is important for
* calibration and pose estimation.
* This class also allows the easy creation and drawing of ChArUco boards.
*/
class CV_EXPORTS_W CharucoBoard : public Board {
public:
CV_WRAP CharucoBoard();

// vector of chessboard 3D corners precalculated
CV_PROP std::vector<Point3f> chessboardCorners;

// for each charuco corner, nearest marker id and nearest marker corner id of each marker
CV_PROP std::vector<std::vector<int> > nearestMarkerIdx;
CV_PROP std::vector<std::vector<int> > nearestMarkerCorners;

/** @brief Draw a ChArUco board
*
* @param outSize size of the output image in pixels.
* @param img output image with the board. The size of this image will be outSize
* and the board will be on the center, keeping the board proportions.
* @param marginSize minimum margins (in pixels) of the board in the output image
* @param borderBits width of the marker borders.
*
* This function return the image of the ChArUco board, ready to be printed.
*/
CV_WRAP void draw(Size outSize, OutputArray img, int marginSize = 0, int borderBits = 1);


/** @brief Create a CharucoBoard object
* @param squaresX number of chessboard squares in X direction
* @param squaresY number of chessboard squares in Y direction
* @param squareLength chessboard square side length (normally in meters)
* @param markerLength marker side length (same unit than squareLength)
* @param dictionary dictionary of markers indicating the type of markers.
* The first markers in the dictionary are used to fill the white chessboard squares.
* @return the output CharucoBoard object
*
* This functions creates a CharucoBoard object given the number of squares in each direction
* and the size of the markers and chessboard squares.
*/
CV_WRAP static Ptr<CharucoBoard> create(int squaresX, int squaresY, float squareLength,
float markerLength, const Ptr<Dictionary> &dictionary);

CV_WRAP Size getChessboardSize() const;
CV_WRAP float getSquareLength() const;
CV_WRAP float getMarkerLength() const;

protected:
struct CharucoImpl;
Ptr<CharucoImpl> charucoImpl;
};

/**
* @brief test whether the ChArUco markers are collinear
*
* @param board layout of ChArUco board.
* @param charucoIds list of identifiers for each corner in charucoCorners per frame.
* @return bool value, 1 (true) if detected corners form a line, 0 (false) if they do not.
* solvePnP, calibration functions will fail if the corners are collinear (true).
*
* The number of ids in charucoIDs should be <= the number of chessboard corners in the board.
* This functions checks whether the charuco corners are on a straight line (returns true, if so), or not (false).
* Axis parallel, as well as diagonal and other straight lines detected. Degenerate cases:
* for number of charucoIDs <= 2,the function returns true.
*/
CV_EXPORTS_W bool testCharucoCornersCollinear(const Ptr<CharucoBoard> &board, InputArray charucoIds);

//! @}

}
}

#endif
Loading