Skip to content
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

Init calibration with blender benchmark #1

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

victor1234
Copy link

No description provided.

@asmorkalov
Copy link
Contributor

I got "Engine 'BLENDER_EEVEE' not available for scene 'Scene' (an add-on may need to be installed or enabled)" for Blender . Most probably I need to update it. I used ubuntu 18.04 and default Blender version.

* Distort images by image_distort.cpp

### Pattern generation command
gen_pattern.py -c 14 -r 19 -T checkerboard -u px -s 220 -w 3508 -h 4961 && convert out.svg checkerboard.png
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add reference to OpenCV repo where to get gen_pattern.py and refererence to ImageMagick is required. At least apt-get install ...

@asmorkalov
Copy link
Contributor

I updated Blender and it almost works for me now. Couple of notes:

  • Texture is broken. I see purple plains instead of plain with template.
  • It's not obvious where the final renders should locate. Please add it to readme. Also It'll be great to use current directory instead of /tmp and unblock Windows too.



# Set pattern init position
bpy.data.objects['checkerboard'].locaition.z = 10
Copy link
Contributor

Choose a reason for hiding this comment

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

typo locaition -> location

@@ -0,0 +1,684 @@
#include "opencv2/core.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not think that calibration.cpp copy-paste from main repo is required. Could we just reuse it?



if __name__ == '__main__':
binary_path = '/home/xperience/development/opencv-fork/cmake-build-release/bin'
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be an option, I believe.

image_distort_path = os.path.join(binary_path, 'example_cpp_image_distort')
calibration_benchmark_path = os.path.join(binary_path, 'example_cpp_calibration_benchmark')

datasets_path = '/home/xperience/development/datasets'
Copy link
Contributor

Choose a reason for hiding this comment

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

The same here

import seaborn as sns

if __name__ == '__main__':
data_dir = '/home/xperience/development/opencv_benchmarks/calibration_with_blender/work/checkerboard'
Copy link
Contributor

Choose a reason for hiding this comment

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

Script option?


if __name__ == '__main__':
binary_path = '/home/xperience/development/opencv-fork/cmake-build-release/bin'
image_distort_path = os.path.join(binary_path, 'example_cpp_image_distort')
Copy link
Contributor

Choose a reason for hiding this comment

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

The CMakeLists.txt proposes calibration_benchmark name for executable

if __name__ == '__main__':
binary_path = '/home/xperience/development/opencv-fork/cmake-build-release/bin'
image_distort_path = os.path.join(binary_path, 'example_cpp_image_distort')
calibration_benchmark_path = os.path.join(binary_path, 'example_cpp_calibration_benchmark')
Copy link
Contributor

Choose a reason for hiding this comment

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

What is difference between the code in PR and example in OpenCV. I propose to not add copy, but add reference to OpenCV itself. Also interactive calibration tool is always build with OpenCV and provided in distribution. It could be a replacement.

#include "opencv2/core.hpp"
#include <opencv2/core/utility.hpp>
#include "opencv2/imgproc.hpp"
#include "opencv2/3d.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

I propose to have #ifdef with OpenCV version here to have proper includes according to OpenCV version. I do not see 5.x specific code here.

{
if (argc < 8)
{
std::cout << "usage; " << argv[0] << "image camera_model fx fy cx cy [d0 .. dn] output"
Copy link
Contributor

Choose a reason for hiding this comment

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

; - typo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants