git clone https://github.com/eYs3D/eys3d_python_wrapper.git
git clone git@github.com:eYs3D/eys3d_python_wrapper.git
# Install required packages with the following command
$ sudo apt install python3.7
$ sudo apt-get install python3-pip
$ sudo apt-get install python3.7-venv
$ sudo apt install libpython3.7-dev
$ sudo apt-get install python3.7-dev
$ sudo apt install libx11-dev
$ sudo apt install libudev-dev
$ sudo apt install libglfw3
$ sudo apt install libglfw3-dev
$ sudo apt-get install libusb-1.0-0-dev
$ sudo apt install liblog4cplus-dev
$ sudo apt install cgroup-tools
$ sudo apt install libcgroup-dev
$ sudo apt install libssl-dev
The following OpenCL packages on host machine are required for eYs3D python wrapper project
Developers can directly use the ICD loader runtime available in eYs3D SDK (eSPDI/opencl/), and developers can also install the one which is available in Debian repository.
$ sudo apt install ocl-icd-opencl-dev
Developers should check if GPU vendor specific compute runtime for openCL driver is installed properly on host machine, the following is an example of installing Intel graphics compute runtime for openCL driver.
$ sudo add-apt-repository ppa:intel-opencl/intel-opencl
$ sudo apt update
$ apt install intel-opencl-icd
$ sudo apt install clinfo
$ sudo clinfo
$ python3.7 -m venv ./venv
$ source ./venv/bin/activate
cd to eys3d_python_wrapper folder
$ python3.7 -m pip install -r requirements.txt
or
$ python3 -m pip install -r requirements.txt
make sure install the python3.7 version package
$ cd libeYs3D/wrapper/python
$ sh run_demo.sh [module_name] [mode_index]
Then select index to execute sample code.
1. cv_demo
2. pc_demo
3. callback_demo
4. accuracy_demo
5. record_playback_demo
make sure set Hot Keys for good depth:
* M/m: Increase IR level
* N/n: Decrease IR level
ex: If your module is G100+, mode index 1 on ModeConfig.db.
sh run_demo.sh 80362 1 14
ex: If your module is G62, mode index 1 on ModeConfig.db.
sh run_demo.sh 8081 1 14
ex: If your module is REF-B6, mode index 1 on ModeConfig.db.
sh run_demo.sh Stacy 1 14
ex: If your module is REF-B3, mode index 1 on ModeConfig.db.
sh run_demo.sh StacyJunior 1 14
ex: If your module is G100i, mode index 1 on ModeConfig.db.
sh run_demo.sh 8062 1 14
ex: If your module is G53, mode index 1 on ModeConfig.db.
sh run_demo.sh HYPATIA 1 11
ex: If your module is 8067, mode index 1 on ModeConfig.db.
sh run_demo.sh 8067 1 11
ex: If your module is R50, mode index 5 on ModeConfig.db.
sh run_demo.sh 8059 5 11
ex: If your module is G100, mode index 1 on ModeConfig.db.
sh run_demo.sh 8036 1 14
ex: If your module is G50, mode index 1 on ModeConfig.db.
sh run_demo.sh 8052 1 14
If you want to exit python virtual environment
$ deactivate
Hotkeys listen by OpenCV window:
Hot Keys:
Mouse:
If the EYS3D_HOME is not set, default value is at $HOME/.eYs3D If user want to specify saving folder, we could modify the line in libeYs3D/wrapper/python/run_demo.sh
export EYS3D_HOME="The directory user would like"
$EYS3D_HOME/snapshots
$EYS3D_HOME/logs
${EYS3D_HOME}/cfg/ModeConfig.db
record the camera parameters for streaming, which is corresponded to PIF document.
Please read PIF and check which bit is acceptable in advance.
$ sh run_demo.sh [module_name] [mode_index] [depth_data_type]
ex: If your module is 8062, mode index 1 and depth_data_type 14 bits.
sh run_demo.sh 8062 1 14
def callback_sample(device, config):
pipe = Pipeline(device=device)
conf = config
device.open_device(conf,
colorFrameCallback=color_frame_callback,
depthFrameCallback=depth_frame_callback,
IMUDataCallback=imu_data_callback)
device.enable_stream()
device.pause_stream()
device.enable_stream()
device.close_stream()
def color_frame_callback(frame):
print("[Python][COLOR] The S/N in callback function: {}".format(frame.get_serial_number()))
def depth_frame_callback(frame):
print("[Python][DEPTH] The S/N in callback function: {}".format(frame.get_serial_number()))
def pipeline_sample(device, config):
pipe = Pipeline(device=device)
conf = config
pipe.start(conf)
cframe = pipe.wait_color_frame()
bgr_cframe = cv2.cvtColor(cframe.get_rgb_data().reshape(cframe.get_height(), cframe.get_width(), 3),
cv2.COLOR_RGB2BGR)
cv2.imshow("Color image", bgr_cframe)
dframe = pipe.wait_depth_frame()
bgr_dframe = cv2.cvtColor(dframe.get_rgb_data().reshape(dframe.get_height(), dframe.get_width(), 3),
cv2.COLOR_RGB2BGR)
cv2.imshow("Depth image", bgr_dframe)
z_map = dframe.get_depth_ZD_value().reshape(dframe.get_height(), dframe.get_width())
pipe.stop()
Please execute the accuracy_demo
to calculate the quality of depth frame.
User should decide the region ratio and ground truth distance in mm to calculate.
Notice this function would not guarantee the performance.
$ cd libeYs3D/wrapper/python/eYs3Dcli
$ sh run_cli.sh
Please follow the instructions to compile eYs3D.test for testing and verifying libeYs3D
$ cd libeYs3D && sh run_test.sh
# Performance
## Monitor memory usage of eYs3D.test
```console
$ sudo pmap ${PID_OF_eYs3D.test} | tail -n 1
Error: BadDrawable (invalid Pixmap or Window parameter) 9 Major opcode: 62 (X_CopyArea)Resource id: 0x3800056]
Please follow the instructions to add environment variable in your system.
sudo nano /etc/environment
Adding in the /etc/environment file.
QT_X11_NO_MITSHM=1