stereolabs / zed-open-capture Goto Github PK
View Code? Open in Web Editor NEWLow level Linux camera driver for the ZED USB3 stereo cameras. API docs available here:
Home Page: https://stereolabs.github.io/zed-open-capture
License: MIT License
Low level Linux camera driver for the ZED USB3 stereo cameras. API docs available here:
Home Page: https://stereolabs.github.io/zed-open-capture
License: MIT License
Hello,
I am trying to implement a ROS wrapper for this library to use my ZED2 on a machine without GPU.
Everything was working fine until I tried to publish a CameraInfo message.
As soon as I add the following instruction info_left.header.stamp = ros::Time::now();
(or any instruction that changes the time value of the header) I get a segmentation fault.
If I run the code in debug, the segmentation fault is raised somewhere in sl_oc::sensors::SensorCapture::updateTimestampOffset
, which is even more surprising, since that method should not be called, since I did not set SENSORS_MOD_AVAILABLE
.
In an effort to try to understand which instruction was causing the problem, I imported the entire source code of the library into my ROS package. When compiled this way, I get no segmentation fault and the node works with no problems.
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include "videocapture.hpp"
int main(int argc, char** argv)
{
sl_oc::video::VideoParams params;
params.res = sl_oc::video::RESOLUTION::HD2K;
params.fps = sl_oc::video::FPS::FPS_15;
sl_oc::video::VideoCapture cap(params);
cap.initializeVideo(-1);
ros::init(argc, argv, "image_publisher");
ros::NodeHandle nh;
sensor_msgs::CameraInfo info_left;
info_left.header.stamp = ros::Time::now();
ros::spin();
}
This is the CMakeLists.txt
I am using
cmake_minimum_required(VERSION 3.0.2)
project(zed_open_capture_ros)
find_package(catkin REQUIRED COMPONENTS
image_transport
sensor_msgs
std_msgs
)
catkin_package(
)
include_directories(
include
${catkin_INCLUDE_DIRS}
"/usr/local/include/zed-open-capture"
)
link_directories(zed_open_capture "/usr/local/lib")
add_executable(segfault src/segfault.cpp)
target_compile_definitions(segfault PUBLIC VIDEO_MOD_AVAILABLE)
target_link_libraries(segfault ${catkin_LIBRARIES} zed_open_capture)
catkin_make
rosrun zed_open_capture_ros segfault
All the elements are correctly initialized, and there should be no segmentation fault.
In fact, the node does not trigger a segmentation fault when the library is imported into the package.
Segmentation fault.
ZED2
My host OS is Ubuntu 22.04, I am developing and running everything in a container with Ubuntu 20.04 and ROS Noetic.
For testing, I am using a ZED2
No response
Using the ZED SDK, it is possible to set a region of interest (ROI) for AEC/AGC as seen in the zed-examples and detailed in the API Reference.
Is it possible to set the ROI for AEC/AGC at the driver level, i.e. using zed-open-capture?
I built hidapi, pointed the cmake for zed-open-capture to it, then pointed zed-open-capture cmake to my opencv 4.7, then configured and generated the zed-open-capture project successfully. I went to build the resulting project and it fails in several modules with a missing cxxapi.h file. I could probably repair this but I decided you should know that this happens with your current configuration. I will be glad to try anything you suggest.
Bob Davies
...
I was hoping it would build...
zed-open-capture will not build as current configured.
ZED
Latest version of zed-open-capture, Windows 10, NVIDIA GeForce RTX 3050 (driver 30.0.15.1179, OpenCV 4.7, ZED 2 camera
No rush to fix this. I currently work with an older Stereolabs SDK from 2020 but I wanted to review this capture driver and switch to it.
I want know produc type of IMU sensor used in ZED mini, and cannot found any useful info in office website, could you please tell me?
No response
No response
I tried to run the zed_open_capture_depth_example. After the successful build of the libraries with example.
It is running the zed_open_capture_depth_tune_stereo example with no problem
1.Build the library
2.Try to run the depth_example
3.
...
It should run the zed_open_capture_depth_example
it gives out zed_open_capture_depth_example: command not found
ZED2i
OS:Linux 22.04 Desktop
NO SDK
No response
I want to use ZED camera to compute depth map without discrete GPU.
According to the issue, I want to get more detail about computing depth map.
Thanks.
Hi,
Could you give clearer details of the install process as the ones supplied are a little confusing. Particularly as it states to add the udev rule prior to cloning the open-capture folders. Does it need to be installed in which udev dir - lib, etc, run?
Thanks
Presently the Positional Tracking works only on GPU with CUDA. Kindly request to make available basic odometry/SLAM tracking with ZED cameras on CPU only.
Presently all ZED cameras are locked to NVIDIA boards which is not desiarable for UAVs and other Autonomous Vehicles having CPU only computes on board. WIth Intel T265 going EOL it will be really really helpful if simple tracking functionalities are made available on CPU only computes.
No response
I use this SDK to record IMU and image data, and found the timestamp betwwen the IMU and image are not synchronized correctly? Is there example to explain how to obtain the synchronized record?
Is it possible to retrieve the Camera data with this package on one pc (without GPU) and then process it on another pc, on which the the ZED SDK is installed, in real time?
we have a smaller pc which is connected to all our sensors and then there is a second pc which receives the data from the low level pc. So in order to use the ZED Camera it would be nice to receive the zed camera data on one pc and then process it with the given ZED SDK on the second pc.
No response
Hi.
There seems to be an inconsistency between the following webpage and the description of this repository with regard to the raw data availability.
https://support.stereolabs.com/hc/en-us/articles/1500009136321-Do-the-ZED-cameras-support-capturing-and-saving-raw-data-of-RGB-sensor-e-g-bayer-pattern-dataset-without-nonlinear-processing-
This page says that the raw data is not available, whereas the description of this repository says
The open-source library provides methods to access raw video frames, calibration data, camera controls, and raw data from the camera sensors (on ZED 2, ZED 2i, and ZED Mini).
Could you please clarify the availability of raw data (e.g. bayer pattern dataset without nonlinear processing)? I am using ZED 2i.
Many thanks,
Ted
No response
No response
I want to record the SVO file using a mini PC without NVIDIA graphics, is there any method to use this SDK without CUDA?
And then I will use a Linux server with CUDA to export the SVO file in any format.
No response
No response
Setting the FPS for video capture has not the intended effect. I extended the included example zed_oc_video_example.cpp and set a resolution and fps setting:
params.res = sl_oc::video::RESOLUTION::HD720;
params.fps = sl_oc::video::FPS::FPS_15;
sl_oc::video::VideoCapture cap(params);
While the resolution gets set correctly, the FPS setting does not have the intended effect. When looking at the timing of the incoming images, the frame rate is around 50fps:
...
Time to last frame 22 ms
Time to last frame 23 ms
Time to last frame 19 ms
Time to last frame 23 ms
Time to last frame 22 ms
Time to last frame 20 ms
Time to last frame 22 ms
Time to last frame 25 ms
Time to last frame 17 ms
Time to last frame 22 ms
Time to last frame 23 ms
Time to last frame 20 ms
...
When setting the
params.fps = sl_oc::video::FPS::FPS_100;
the frame's arrive faster:
Time to last frame 17 ms
Time to last frame 16 ms
Time to last frame 16 ms
Time to last frame 16 ms
Time to last frame 16 ms
Time to last frame 17 ms
Time to last frame 15 ms
Time to last frame 17 ms
So setting params.fps seem to have some effect, but not that it sets the FPS setting of the camera to 15 FPS.
Device information:
To Reproduce
Steps to reproduce the behavior:
Use the example I described above and print out the frame timings
Expected behavior
Frames should arrive with 15 FPS.
I build the code and collect sensor data in raspberry pi 4, and found it don't got the IMU data sometimes, I check the code and add some logs in line 344, and found the returned data size of IMU in is 0. This issue only happed sometimes, but it's critical because nothing could be done except restart the program(don't got any valid IMU data afterwards). Is any idea to solve this problem?
Receive correct IMU data
IMU data size is zeros, don't receive any IMU afterwards
ZED Mini
OS: Raspbian 10
Hardware: Raspberry PI4, 8G
SDK Version: master
No response
I am using Zed2 and want to use it as a UVC camera.I can detect the zed camera in cheese and using gstreamer but while trying to access it using Opencv I am getting an error " GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1".It works fine on laptop but i am getting this error only on jetson Xavier and I have tested with different jetson devices
Can the image sensor be hardware triggered?
I am using Zed2i over Linux 22.04 over VM(VM workstation pro)
After the successful build of all the examples and the library
I can only able to run sensor_example and produces the sensor data.
but it fails to produce and gives output
"Cannot open camera video capture"
"See verbosity level for more details"
1.Build the package
2. try to run video_example
3.
...
I want to run the video example and later also need to get the data in the ros2 humble . Thank You!
ZED2i
OS: Linux 22.04 (Over VM)
CPU: x86-64
GPU: No GPU(Cannot access through VM)
ZED SDK: Using open capture
No response
I try to build zed-open-capture on MacOS. All dependencies are satisfied but some Linux headers are not. Such as 'linux/usb/video.h'. Can you fix that?
[ 7%] Building CXX object CMakeFiles/zed_open_capture.dir/src/videocapture.cpp.o
/zed-open-capture/src/videocapture.cpp:32:10: fatal error: 'linux/usb/video.h' file not found
#include <linux/usb/video.h> // for UVC_GET_CUR, UVC_SET_CUR, UVC_GET_LEN
I'm just trying to run the examples after installing this library on a Raspberry Pi 4.
I'm encountering errors specifically when running examples using the cameras. The IMU example (zed_open_capture_sensors_example) runs fine.
It appears to be an error while opening the cameras due to the resolution, but I can't figure out how to solve it.
My problem seemed different enough from #19 as I wasn't experiencing any freezes and the camera seemed to be recognized using lsusb
.
I should note I am not using the original USB type-C cable, as I currently don't have access to it. This is the output of lsusb
:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 008: ID 2b03:f881 STEREOLABS ZED-2i HID INTERFACE
Bus 001 Device 007: ID 2b03:f880 STEREOLABS ZED 2i
Bus 001 Device 006: ID 0424:2512 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I'm following the install and build instructions in the README.md file.
After that, I try to run the lines zed_open_capture_sync_example
and sudo zed_open_capture_video_example
unsuccessfully.
I'm expecting the normal behavior of using the library's own examples.behavior
When running sudo zed_open_capture_video_example
(I'm using sudo
because if I don't, it replies with Permission denied
)
[sl_oc::video::VideoCapture] ERROR: Error setting the camera resolution
xioctl: Inappropriate ioctl for device
xioctl: Invalid argument
[sl_oc::video::VideoCapture] ERROR: Cannot set pixel format of '/dev/video1': [22] Invalid argument
Cannot open camera video capture
See verbosity level for more details.
xioctl: Invalid argument
I edited the file zed_oc_sync_example.cpp
and set VERBOSITY
to INFO
and got this result when running zed_open_capture_sync_example
(no sudo
required this time):
[sl_oc::video::VideoCapture] INFO: ZED Open Capture - Camera module - Version: 0.6.0
[sl_oc::video::VideoCapture] INFO: Camera resolution: 2560x720@30Hz
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video0'
[sl_oc::video::VideoCapture] ERROR: Cannot open '/dev/video0': [13] Permission denied
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video1'
[sl_oc::video::VideoCapture] ERROR: Cannot open '/dev/video1': [13] Permission denied
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video2'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video2/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video2' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video3'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video3/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video3' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video4'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video4/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video4' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video5'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video5/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video5' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video6'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video6/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video6' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video7'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video7/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video7' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video8'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video8/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video8' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video9'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video9/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video9' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video10'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video10' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video11'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video11' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video12'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video12' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video13'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video13' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video14'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video14' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video15'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video15' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video16'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video16' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video17'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video17/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video17' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video18'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video18' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video19'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video19' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video20'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video20' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video21'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video21' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video22'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video22' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video23'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video23' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video24'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video24/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video24' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video25'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video25/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video25' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video26'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video26/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video26' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video27'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video27/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video27' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video28'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video28/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video28' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video29'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video29/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video29' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video30'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video30/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video30' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video31'
[sl_oc::video::VideoCapture] WARNING: not a modalias 2
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video31' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video32'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video32/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video32' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video33'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video33/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video33' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video34'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video34/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video34' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video35'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video35/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video35' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video36'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video36/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video36' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video37'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video37/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video37' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video38'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video38/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video38' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video39'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video39/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video39' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video40'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video40/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video40' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video41'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video41/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video41' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video42'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video42/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video42' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video43'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video43/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video43' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video44'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video44/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video44' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video45'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video45/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video45' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video46'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video46/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video46' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video47'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video47/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video47' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video48'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video48/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video48' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video49'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video49/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video49' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video50'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video50/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video50' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video51'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video51/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video51' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video52'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video52/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video52' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video53'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video53/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video53' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video54'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video54/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video54' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video55'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video55/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video55' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video56'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video56/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video56' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video57'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video57/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video57' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video58'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video58/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video58' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video59'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video59/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video59' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video60'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video60/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video60' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video61'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video61/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video61' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video62'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video62/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video62' is not a Stereolabs camera
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video63'
[sl_oc::video::VideoCapture] WARNING: Not a modalias : /sys/class/video4linux/video63/device/modalias
[sl_oc::video::VideoCapture] WARNING: The device '/dev/video63' is not a Stereolabs camera
Cannot open camera video capture
Try to enable verbose to get more info
ZED2i
Raspberry Pi 4 Model B Rev 1.2
OS: Raspbian 11 (bullseye)
ZED Open Capture - Camera module - Version: 0.6.0
No response
Hi, In the Prerequisites section of a project is mentioned ZED Cam in the list of possible devices. Once i've build the library and tried to run example it say that no ZED2 or ZED mini cam is connected. So my question is: Is the original ZED Cam (V1) supported or is it not? Thank You :)
I am trying to capture 720p stereo images (2560x720) from two ZED 2i cameras using a Raspberry pi 4. While images from one camera seems to be fine, one half of the images captured from the other camera displays a prominent green hue. Please see below for an example. This green hue is present initially in the first half as well. However, it gradually subsides.
Frame 1
This is not an issue with the resolution as the same phenomenon can be observed in the VGA resolution as well. This is observed in all the the ZED 2i cameras I have access to. This is also the case when I ran this on my laptop with Ubuntu 16.04.
// ----> Includes
#include "videocapture.hpp"
#include "sensorcapture.hpp"
#include <unistd.h> // for usleep
#include <iostream>
#include <iomanip>
#include <iomanip>
#include <thread>
#include <fstream>
#include <cstdlib>
#include <mutex>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <opencv2/opencv.hpp>
// Functions
bool displayData = false;
std::string base_path;
// The main function
int main(int argc, char *argv[])
{
char TimeString[128];
if (argc == 2)
{
base_path = argv[1];
std::cout << "Base path : " << base_path << std::endl;
}
else
{
std::string userName = std::getenv("USER");
//static int seconds_last = 99;
timeval curTime;
gettimeofday(&curTime, NULL);
//seconds_last = curTime.tv_sec;
strftime(TimeString, 80, "%Y-%m-%d %H:%M:%S", localtime(&curTime.tv_sec));
base_path = "/home/"+ userName + "/Data_Collection/" ;//+ std::string(TimeString);
const char * directory_0 = base_path.c_str();
int result;
extern int errno;
struct stat sb;
result = stat(directory_0, &sb);
if ((result != 0) || !(sb.st_mode & S_IFDIR))
{
if (errno == ENOENT) //ENOENT=No such directory entry
{
printf("The directory does not exist. Creating new directory: %s\n", directory_0);
// Add more flags to the mode if necessary.
result = mkdir(directory_0, S_IRWXU);
if (result != 0)
{
printf("mkdir failed; errno=%d\n",errno);
}
}
}
// Create directories for the two cameras
std::string camera_image_path = "/home/"+ userName + "/Data_Collection/Images/";
const char * directory_1 = camera_image_path.c_str();
result = stat(directory_1, &sb);
if ((result != 0) || !(sb.st_mode & S_IFDIR))
{
if (errno == ENOENT) //ENOENT=No such directory entry
{
printf("The directory does not exist. Creating new directory: %s\n", directory_1);
// Add more flags to the mode if necessary.
result = mkdir(directory_1, S_IRWXU);
if (result != 0)
{
printf("mkdir failed; errno=%d\n",errno);
}
}
}
std::string First_camera_image_path = "/home/"+ userName + "/Data_Collection/Images/First/";
const char * directory_2 = First_camera_image_path.c_str();
result = stat(directory_2, &sb);
if ((result != 0) || !(sb.st_mode & S_IFDIR))
{
if (errno == ENOENT) //ENOENT=No such directory entry
{
printf("The directory does not exist. Creating new directory: %s\n", directory_2);
// Add more flags to the mode if necessary.
result = mkdir(directory_2, S_IRWXU);
if (result != 0)
{
printf("mkdir failed; errno=%d\n",errno);
}
}
}
std::string Second_camera_image_path = "/home/"+ userName + "/Data_Collection/Images/Second/";
const char * directory_3 = Second_camera_image_path.c_str();
result = stat(directory_3, &sb);
if ((result != 0) || !(sb.st_mode & S_IFDIR))
{
if (errno == ENOENT) //ENOENT=No such directory entry
{
printf("The directory does not exist. Creating new directory: %s\n", directory_3);
// Add more flags to the mode if necessary.
result = mkdir(directory_3, S_IRWXU);
if (result != 0)
{
printf("mkdir failed; errno=%d\n",errno);
}
}
}
}
std::cout << "Base path cpp : " << base_path << std::endl;
// Silence unused warning
// Set the verbose level
sl_oc::VERBOSITY verbose = sl_oc::VERBOSITY::INFO;
// Set the video parameters
sl_oc::video::VideoParams params;
params.res = sl_oc::video::RESOLUTION::HD720;
params.fps = sl_oc::video::FPS::FPS_15;
params.verbose = verbose;
// Create a SensorCapture object
sl_oc::sensors::SensorCapture sens(verbose);
// Get a list of available camera with sensor
std::vector<int> devs = sens.getDeviceList();
bool isonlycamera = false;
if( devs.size() < 1)
{
std::cerr << "No available ZED2i cameras" << std::endl;
return EXIT_FAILURE;
}
else if(devs.size() == 1)
{
std::cerr << "Only one ZED2i camera is available" << std::endl;
isonlycamera = true;
}
else if(devs.size() >= 2)
{
std::cerr << "Two ZED2i cameras available" << std::endl;
}
// We should have two cameras connected
// TODO: Add a try catch to see two cameras are connected
int cam1_serial = devs[0];
int cam2_serial;
if (!isonlycamera)
{
cam2_serial = devs[1];
}
// Create a Video Capture objects
sl_oc::video::VideoCapture videoCapCam1(params);
if( !videoCapCam1.initializeVideo(-1) )
{
std::cerr << "Cannot open camera video capture for camera 1" << std::endl;
return EXIT_FAILURE;
}
sl_oc::video::VideoCapture videoCapCam2(params);
if( !videoCapCam2.initializeVideo(-1) & !isonlycamera)
{
std::cerr << "Cannot open camera video capture for camera 2" << std::endl;
return EXIT_FAILURE;
}
// Set video parameters
videoCapCam1.setAutoWhiteBalance(true);
videoCapCam1.setAECAGC(true);
videoCapCam2.setAutoWhiteBalance(true);
videoCapCam2.setAECAGC(true);
// Init OpenCV RGB frame
int w,h;
videoCapCam1.getFrameSize(w,h);
cv::Size display_resolution(1024, 576);
switch(params.res)
{
default:
case sl_oc::video::RESOLUTION::VGA:
display_resolution.width = w;
display_resolution.height = h;
break;
case sl_oc::video::RESOLUTION::HD720:
display_resolution.width = w*0.6;
display_resolution.height = h*0.6;
break;
case sl_oc::video::RESOLUTION::HD1080:
case sl_oc::video::RESOLUTION::HD2K:
display_resolution.width = w*0.4;
display_resolution.height = h*0.4;
break;
}
int h_data = 70;
cv::Mat frameDisplay(display_resolution.height + h_data, display_resolution.width,CV_8UC3, cv::Scalar(0,0,0));
cv::Mat frameData = frameDisplay(cv::Rect(0,0, display_resolution.width, h_data));
cv::Mat frameBGRDisplay = frameDisplay(cv::Rect(0,h_data, display_resolution.width, display_resolution.height));
cv::Mat frameBGR(h, w, CV_8UC3, cv::Scalar(0,0,0));
cv::Mat frameBGR2(h, w, CV_8UC3, cv::Scalar(0,0,0));
//Write the paramters to a config file
std::ofstream configfile;
configfile.open(base_path + "/Images/config.txt");
configfile << "Camera_1_serial:" << cam1_serial <<std::endl;
if (!isonlycamera)
{
configfile << "Camera_2_serial:" << cam2_serial <<std::endl;
}
configfile << "resolution:" << w << "," <<h<<std::endl;
configfile.close();
uint64_t last_timestamp = 0;
float frame_fps=0;
// Infinite grabbing loop
// Do we need to provide a switch to stop data capture?
std::string First_image_path = base_path +"/Images/First/" + "First_";
std::string Second_image_path = base_path +"/Images/Second/" + "Second_";
std::cout << "Start captruing data" << std::endl;
for (int iter=1; iter<100 ; iter++)
{
// Get Video frame
// Get last available frame
const sl_oc::video::Frame frame1 = videoCapCam1.getLastFrame(1);
const sl_oc::video::Frame frame2 = videoCapCam2.getLastFrame(1);
if(frame1.data!=nullptr && frame1.timestamp!=last_timestamp)
{
// Conversion from YUV 4:2:2 to BGR for visualization
cv::Mat frameYUV( frame1.height, frame1.width, CV_8UC2, frame1.data);
cv::cvtColor(frameYUV,frameBGR, cv::COLOR_YUV2BGR_YUYV);
std::string image_timestamp = std::to_string(frame1.timestamp);
cv::imwrite(First_image_path + image_timestamp + ".jpg", frameBGR);
}
if (!isonlycamera)
{
//std::stringstream videoTs2;
if(frame2.data!=nullptr)
{
// Conversion from YUV 4:2:2 to BGR for visualization
cv::Mat frameYUV2( frame2.height, frame2.width, CV_8UC2, frame2.data);
cv::cvtColor(frameYUV2,frameBGR2, cv::COLOR_YUV2BGR_YUYV);
std::string image_timestamp = std::to_string(frame1.timestamp);
cv::imwrite(Second_image_path + image_timestamp + ".jpg", frameBGR2);
}
}
// Keyboard handling
int key = cv::waitKey(1);
if( key != -1 )
{
// Quit
if(key=='q' || key=='Q'|| key==27)
{
break;
}
}
}
return EXIT_SUCCESS;
}
Expect both image sets not to have any green hue.
As mentioned before, images captured from one camera has a prominent green hue in one half of it, while the other camera is functioning just fine.
ZED2i
OS: Raspian, Ubuntu 16.04
RAM: 4GB, 16GB
No response
Good afternoon.
Who is interested to add (with/wo creation of dedicated task force - research group for the purpose) Audio from mics and video/audio over IP (from IP cameras) support to ZED framework?
How much effort and cost it will take?
Kind Regards,
Paul.
Hi, can you add also the python version of this repository?
No response
No response
There is a race condition on the Frame
object that VideoCapture::getLastFrame
returns a reference to.
When a user program calls VideoCapture::getLastFrame
(e.g. in zed_ov_video_example.cpp), it receives a reference to the Frame
object mLastFrame
. Even though a lock is used in VideoCapture::getLastFrame
, the lock releases when the function returns. So mLastFrame
can continue to be updated in the video capture thread here; without the user program knowing that this is happening.
This results in occasional "corrupt" frames where some parts of the current frame that the user program is working with would get updated by data from future frames. The data corruption is noticeable as visual "glitches" when the frames are being stored or displayed in the user program. The following image is the left frame captured from a wooden stick that was being moved back and forth in front of the camera. The images were being retrieved in a while
loop similar to zed_ov_video_example.cpp, and they were being saved using OpenCV's imwrite
function.
Even though OpenCV's imwrite
call blocks the loop while the frame is being written to disk, the frame is being updated by another thread. That’s because the frame is a reference to mLastFrame
, which is being updated continuously in the capture thread that is created in VideoCapture::startCapture()
here.
This issue does NOT happen on all of the frames, and is hard to detect on frames without fast moving objects. It happens on some of the frames, and it is more frequent when the grab loop is being blocked by a file write call, and the disk that it's being written to is slow. For example on a Jetson Nano with an SD card. However, I have also observed the issue on my laptop and desktop with NVMe drives, but less frequently. The issue also happens when the frames are only being displayed (e.g. uisng OpenCV's imshow
) but less frequently.
imwite
call to the loop in zed_ov_video_example.cpp to save images to the disk.All the frames should be intact with no glitches.
Some of the frames that were saved are corrupt and have glitches similar to the image that was included in the description
ZED2
This issue was observed on various platforms:
Desktop PC
CPU: Intel Xeon
OS: Ubuntu 20
Laptop PC
CPU: Intel i5
OS: Ubuntu 20
Nvidia Jetson Nano (dev board)
CPU: ARM Cortex-A57
OS: Linux4Tegra
I made a fix for this. I would be happy to create a PR.
Support for the new ZED X and ZED X Mini.
Control and access sensor data for the new ZED X and ZED X Mini without having to use the ZED SDK (which requires CUDA).
Thank you for this awesome library!
Followed the README instructions and compiled the examples, when I try to run the examples I get the following error message
And here's my lsusb -d 2b03: -v -t
output
ZED Mini
OS: Ubuntu 22.04
ZED SDK: None, I'm running it from my laptop which doesn't have CUDA GPU
Other: Dell XPS 13 2021
Related but not helpful #35
No response
I can only get imgs success with the resolution option of RESOLUTION::VGA!
set params in examples/zed_oc_video_example.cpp
`
sl_oc::video::VideoParams params;
params.res = sl_oc::video::RESOLUTION::HD720;
params.fps = sl_oc::video::FPS::FPS_30;
params.verbose = sl_oc::VERBOSITY::INFO;
`
build and run sudo ./zed_open_capture_video_example
...
get imgs with camera resolution: 2560x720@30Hz
Failed to get imgs, with error log:
`
[sl_oc::video::VideoCapture] INFO: ZED Open Capture - Camera module - Version: 0.6.0
[sl_oc::video::VideoCapture] INFO: Camera resolution: 2560x720@30Hz
[sl_oc::video::VideoCapture] INFO: Trying to open the device '/dev/video0'
[sl_oc::video::VideoCapture] INFO: Opened camera with SN: 38085162
[sl_oc::video::VideoCapture] ERROR: Error setting the camera resolution
Cannot open camera video capture
See verbosity level for more details.
`
ZED2i
Ubuntu 20.04
AMD
no
Seems that the device is not recognized in Ubuntu18.04 and no serial seems to be the one of the ZED. (NUCi711). Is there some reasons that may cause this problem? Thanks a lot.
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.