stereolabs / zed-opencv-native Goto Github PK
View Code? Open in Web Editor NEWNative stereo capture with OpenCV
Home Page: https://www.stereolabs.com/zed-2/
License: MIT License
Native stereo capture with OpenCV
Home Page: https://www.stereolabs.com/zed-2/
License: MIT License
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 ?
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'
That the code would automatically download the calibration file for my device.
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)
ZED2i
Python 3.10
I was able to bypass this bug by:
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!
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.
When I set resolution to 1280x720, the image is like this.
When I set resolution to 1920x1080, the image is like this.
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();
hi, i am trying to use zed2 on my raspberry pi 4. without zed sdk,i can get image from the camera by using your sample code.but how can i get the imu data and depth infomation
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
-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. 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);
THE problem is when i ./ZED_Diagnostic scripts, it prompts that " unable to identify your processor,make sure that it fits the requirements" and " camera not detected";but my laptop always used USB3.0 ,so how can i solve this problem???
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?
python python/zed_opencv_native.py <serial_number>
Correctly dewarped results.
Incorrectly dewarped results.
ZED Mini
Firmware version of both Zed minis: 1523
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.