Code Monkey home page Code Monkey logo

zed-opencv-native's People

Contributors

adujardin avatar cansik avatar myzhar avatar nesnes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

zed-opencv-native's Issues

difference to the ZED-SDK rectification

I have compared the images to them from the ZED-SDK in Python. There was a pretty big difference if i set the camera up in a scenario with depths of 1-10m. The ZED-SDK in Python is doing some auto calibration, which results in a different rectification if i set up the camera in a scenario >0.5m. How is this auto calibration done ? Is there a possibility to do this in Python without the ZED-SDK ?

The program cannot automatically download the camera calibration file

Preliminary Checks

  • This issue is not a duplicate. Before opening a new issue, please search existing issues.
  • This issue is not a question, feature request, or anything other than a bug report directly related to this project.

Description

When I try to run zed_opencv_native.py, I get the following error message:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\{name removed}\AppData\Roaming\Stereolabs\settings\SN{serial number}.conf_sw9hj4f.tmp'

Steps to Reproduce

  1. Run "python zed_opencv_native.py {My Serial Number}"
    ...

Expected Result

That the code would automatically download the calibration file for my device.

Actual Result

I get the following error:
C:\Users{name removed}\OneDrive\Optical Flow\zed-opencv-native-master\zed-opencv-native-master\python>python zed_opencv_native.py 35962572
Traceback (most recent call last):
File "C:\Users{name removed}\OneDrive\Optical Flow\zed-opencv-native-master\zed-opencv-native-master\python\zed_opencv_native.py", line 189, in
main()
File "C:\Users{name removed}\OneDrive\Optical Flow\zed-opencv-native-master\zed-opencv-native-master\python\zed_opencv_native.py", line 163, in main
calibration_file = download_calibration_file(serial_number)
File "C:\Users{name removed}\OneDrive\Optical Flow\zed-opencv-native-master\zed-opencv-native-master\python\zed_opencv_native.py", line 44, in download_calibration_file
filename = wget.download(url=url+str(serial_number), out=calibration_file)
File "C:\Python310\lib\site-packages\wget.py", line 506, in download
(fd, tmpfile) = tempfile.mkstemp(".tmp", prefix=prefix, dir=".")
File "C:\Python310\lib\tempfile.py", line 341, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "C:\Python310\lib\tempfile.py", line 256, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)

ZED Camera model

ZED2i

Environment

Python 3.10

Anything else?

I was able to bypass this bug by:

  1. Manually downloading the config file from: http://calib.stereolabs.com/?SN=
  2. Creating the folder: C:\Users{name removed}\AppData\Roaming\Stereolabs\settings
  3. Putting the config file in that folder

Bad frame when recording frames

3611

Receive bad frames from time to time when recording.
It seems there is a green line in the bad frame, and the pixel above the green line is same as previous frame (not refreshed to current frame).

VIDEOIO ERROR: V4L: index 0 is not correct!

Hi i am not able to complete the download of the data from my camera.
~/zed-opencv-native/build$ ./ZED_Opencv_Native 10026114
Calibration file found. Loading...
Camera Matrix L:
[700.9869995117188, 0, 631.0770263671875;
0, 700.9869995117188, 364.4280090332031;
0, 0, 1]

Camera Matrix R:
[699.3270263671875, 0, 639.64599609375;
0, 699.3270263671875, 364.1019897460938;
0, 0, 1]

Camera Matrix L:
[669.175190437979, 0, 631.2688369750977, 0;
0, 669.175190437979, 365.062629699707, 0;
0, 0, 1, 0]

Camera Matrix R:
[669.175190437979, 0, 631.2688369750977, 42158.03699759268;
0, 669.175190437979, 365.062629699707, 0;
0, 0, 1, 0]

VIDEOIO ERROR: V4L: index 0 is not correct!

Resolution unable to be adjusted

The resolution of my ZED Camera is unable to be adjusted using OPEN CV on Raspberry Pi. There are black bars on the side of the images if the resolution is larger than 1344x376.

I set resolution here:
code

When I set resolution to 1280x720, the image is like this.
1280x720

When I set resolution to 1920x1080, the image is like this.
1920x1080

When I set resolution to 2208x1242, the image is like this.
2208x1242

When I set resolution to 672x376, the image is like this.
672x376

frame.rows and frame.cols are 0.

hello.

when i tested this sample application, because frame.rows and frame.cols are 0.
it cause exception.
when i comment out following lines, it works but the resolution is 1344 x376.
//cap.grab();
//// Set the video resolution (2*Width * Height)
//cap.set(CV_CAP_PROP_FRAME_WIDTH, image_size.width * 2);
//cap.set(CV_CAP_PROP_FRAME_HEIGHT, image_size.height);
//cap.grab();

No recording on OSX

Hello,
I would like to record images on a Mac. When I run the python command described in the README, I get the following error:

Traceback (most recent call last):
  File "zed_opencv_native.py", line 189, in <module>
    main()
  File "zed_opencv_native.py", line 163, in main
    calibration_file = download_calibration_file(serial_number)
  File "zed_opencv_native.py", line 44, in download_calibration_file
    filename = wget.download(url=url+str(serial_number), out=calibration_file)
  File "/Users/lorenzo/.virtualenvs/zed/lib/python3.7/site-packages/wget.py", line 506, in download
    (fd, tmpfile) = tempfile.mkstemp(".tmp", prefix=prefix, dir=".")
  File "/Users/lorenzo/.virtualenvs/zed/lib/python3.7/tempfile.py", line 340, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "/Users/lorenzo/.virtualenvs/zed/lib/python3.7/tempfile.py", line 258, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/zed/settings/<serialnumber>.conftzwgtefd.tmp'

In general, no zed folder has been created and no blue light on the camera. On the other side, the Macbook camera seems to be activated.

Thanks,
Lorenzo

Error Message while using Zed Cam 2 without Zed SDK library

-1 / unknown
Invalid Calibration File
[ WARN:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-kh7iq4w7\opencv\modules\videoio\src\cap_msmf.cpp (434) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback

The rectified images have black borders

The rectified images have black borders. I fixed this by doing inverse R and T when calling stereoRectify in calibration.hpp. I use factory default camera parameters.
cv::stereoRectify(cameraMatrix_left, distCoeffs_left, cameraMatrix_right, distCoeffs_right, image_size, R.inv(), -T, R1, R2, P1, P2, Q, cv::CALIB_ZERO_DISPARITY, 0, image_size);

[Zed mini] Inconsistency of Calibration File Format

Preliminary Checks

  • This issue is not a duplicate. Before opening a new issue, please search existing issues.
  • This issue is not a question, feature request, or anything other than a bug report directly related to this project.

Description

I currently have two Zed mini cameras. However, I noticed that they come with calibration files of different format. One has the following format:

[LEFT_CAM_2K]
fx=1547.39
fy=1546.96
cx=1116.98
cy=613.638
k1=-0.0386674
k2=0.0304795
k3=-0.0237575
k4=0.0167972

and the other one is

[LEFT_CAM_2K]
fx=1400.19
fy=1399.14
cx=1090.34
cy=628.647
k1=-0.173705
k2=0.0272811
p1=0.000103475
p2=0.000166726
k3=0

The problem here is that using the script python/zed_opencv_native.py cannot produce the correctly dewarped results for the videos recorded by the Zed mini which has the first calibration format (4 radial distortion coefficients). The other one was dewarped just fine.

I wonder if different camera models need to be used?

Steps to Reproduce

python python/zed_opencv_native.py <serial_number>

Expected Result

Correctly dewarped results.

Actual Result

Incorrectly dewarped results.

ZED Camera model

ZED Mini

Environment

Firmware version of both Zed minis: 1523

Anything else?

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.