0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ZED SDK でROIを設定する 〜試行錯誤中〜

Last updated at Posted at 2024-07-03

想定する読者

stereolabsのzed2i, zed mini, zed x などのステレオカメラの利用者
いまどきのステレオカメラは何ができるのかを知りたい人

前提

ZED SDK 4.1
Ubuntu 20.04
ZED2i
Python 版のAPI

Camera.get_region_of_interest(self, Mat py_mat: Mat, resolution=Resolution(0, 0), module=MODULE.ALL) -> ERROR_CODE
Camera.get_region_of_interest_auto_detection_status(self) -> REGION_OF_INTEREST_AUTO_DETECTION_STATE
Camera.set_region_of_interest(self, Mat py_mat: Mat, modules=[MODULE.ALL]) -> ERROR_CODE
Camera.start_region_of_interest_auto_detection(self, roi_param=RegionOfInterestParameters()) -> ERROR_CODE

参考にすべきコード

trouble

python 版

zed-sdk/depth sensing/automatic region of interest/python$ python3 automatic_region_of_interest.py 
[Sample] Using default resolution
[2024-06-20 09:32:21 UTC][ZED][INFO] Logging level INFO
[2024-06-20 09:32:22 UTC][ZED][INFO] Using USB input... Switched to default resolution HD720
[2024-06-20 09:32:22 UTC][ZED][INFO] [Init]  Depth mode: NEURAL
[2024-06-20 09:32:23 UTC][ZED][INFO] [Init]  Camera successfully opened.
[2024-06-20 09:32:23 UTC][ZED][INFO] [Init]  Camera FW version: 1523
[2024-06-20 09:32:23 UTC][ZED][INFO] [Init]  Video mode: HD720@60
[2024-06-20 09:32:23 UTC][ZED][INFO] [Init]  Serial Number: S/N 32045770
Press 'a' to apply the ROI
Press 'r' to reset the ROI
Press 's' to save the ROI as image file to reload it later
Press 'l' to load the ROI from an image file
Traceback (most recent call last):
  File "automatic_region_of_interest.py", line 173, in <module>
    main()
  File "automatic_region_of_interest.py", line 108, in main
    roi_param.auto_apply = True
AttributeError: 'pyzed.sl.RegionOfInterestParameters' object has no attribute 'auto_apply'

C++ 版でも不具合

zed-sdk/depth sensing/automatic region of interest/cpp/build$ make
[ 50%] Building CXX object CMakeFiles/ZED_Auto_Sensing_ROI.dir/src/main.cpp.o
/home/waragai/github/zed-sdk/depth sensing/automatic region of interest/cpp/src/main.cpp: In function ‘int main(int, char**)’:
/home/waragai/github/zed-sdk/depth sensing/automatic region of interest/cpp/src/main.cpp:88:15: error: ‘struct sl::RegionOfInterestParameters’ has no member named ‘auto_apply’
   88 |     roi_param.auto_apply = true;
      |               ^~~~~~~~~~
make[2]: *** [CMakeFiles/ZED_Auto_Sensing_ROI.dir/build.make:76: CMakeFiles/ZED_Auto_Sensing_ROI.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ZED_Auto_Sensing_ROI.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

どちらとも、StereoLabsのコードなので、本家の対応待ちの状態である。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?