Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

vovka643
Copy link
Contributor

@vovka643 vovka643 commented Mar 16, 2023

added charuco board generation in gen_pattern.py
moved aruco_dict_utils.cpp to samples from opencv_contrib (opencv/opencv_contrib#3464)

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov self-assigned this Mar 17, 2023
@asmorkalov asmorkalov added the category: documentation Documentation fix or update label Mar 17, 2023
@vovka643 vovka643 marked this pull request as ready for review March 30, 2023 10:20
@asmorkalov
Copy link
Contributor

OpenCV supports gziped files with cv::FileStorage. You can compress them with gzip or export as json.gz. I'll check and return later with solution.

@asmorkalov asmorkalov changed the title added charuco board generation added charuco board generation to gen_pattern.py Apr 6, 2023
@asmorkalov
Copy link
Contributor

General remark on text: ChAruco is abbreviation. Please presume the original spelling in tutorial text and printed messages.

@asmorkalov
Copy link
Contributor

I fixed the command in the tutorial to generate board and get cropped image.
Command line: python3.8 gen_pattern.py -o charuco_board.svg --rows 7 --columns 5 -T charuco_board --square_size 50 --aruco_marker_size 30 -f DICT_5X5_100.json.gz
SVG attached.
charuco_board

@asmorkalov asmorkalov added this to the 4.8.0 milestone Apr 11, 2023
@asmorkalov
Copy link
Contributor

======================================================================
ERROR: test_charuco_board (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_charuco_board
Traceback (most recent call last):
  File "/usr/lib/python3.5/unittest/loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.5/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "/build/precommit_linux64/4.x/opencv/modules/objdetect/misc/python/test/test_charuco_board.py", line 10, in <module>
    import gen_pattern
ImportError: No module named 'gen_pattern'


----------------------------------------------------------------------
Ran 270 tests in 58.998s

@asmorkalov
Copy link
Contributor

doc/pattern_tools/gen_pattern.py:189: trailing whitespace.
+        marker_id = 0

@asmorkalov
Copy link
Contributor

@vovka643 I fixed predefined dictionaries search path, but the new tests still fail. The generated template (png) does not look correct. Also path to files are messed in tests.

Comment on lines 59 to 60
np.testing.assert_allclose(markerCorners_svg, markerCorners_cv, 0.1, 0.1)
np.testing.assert_allclose(markerIds_svg, markerIds_cv, 0.1, 0.1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The files in tmp are not removed by test. It will produce a lot of garbage on CI. Please take a look on test for aruco:

def test_write_read_dictionary(self):
. It removes temporary files every time.

@asmorkalov asmorkalov self-requested a review May 17, 2023 09:42
Comment on lines 60 to 64
finally:
if os.path.exists(filesvg):
os.remove(filesvg)
if os.path.exists(filepng):
os.remove(filepng)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It removes files for the last loop iteration, but not all temporary files.

Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@asmorkalov asmorkalov merged commit 9931da7 into opencv:4.x May 19, 2023
@asmorkalov asmorkalov mentioned this pull request May 31, 2023
thewoz pushed a commit to thewoz/opencv that referenced this pull request Jan 4, 2024
Added charuco board generation to gen_pattern.py opencv#23363

added charuco board generation in gen_pattern.py
moved aruco_dict_utils.cpp to samples from opencv_contrib (opencv/opencv_contrib#3464)

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
thewoz pushed a commit to thewoz/opencv that referenced this pull request May 29, 2024
Added charuco board generation to gen_pattern.py opencv#23363

added charuco board generation in gen_pattern.py
moved aruco_dict_utils.cpp to samples from opencv_contrib (opencv/opencv_contrib#3464)

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: documentation Documentation fix or update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants