zart icon indicating copy to clipboard operation
zart copied to clipboard

zart on Mac does not initialize the camera

Open karo11 opened this issue 4 years ago • 5 comments

Since some time I get constantly crashes. I am using the actual git version!

`/Users/karo $ sw/zart/zart.app/Contents/MacOS/zart OpenCV: out device of bound (0-0): 1 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 2 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 3 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 4 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 5 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 6 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 7 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 8 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 9 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 10 OpenCV: camera failed to properly initialize! libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.13) /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv/opencv/work/opencv-3.4.13/modules/videoio/src/cap.cpp:193: error: (-215:Assertion failed) api != 0 in function 'getBackendName'

zsh: abort sw/zart/zart.app/Contents/MacOS/zart `

karo11 avatar Dec 25 '20 17:12 karo11

Hmm, nobody there to look into this issue?

I have now tried to build zart with opencv4. Unluckily the same error occurs at initialization of the camera:

libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(4.5.0) /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.0/modules/videoio/src/cap.cpp:299: error: (-215:Assertion failed) api != 0 in function 'getBackendName'

By the way the camera is correctly driven with the gmic cli and opencv4!

karo11 avatar Feb 07 '21 11:02 karo11

You may try this f939cf381c5871e506aabd066037acf2b55143c1d It should prevent the crash but it does not mean the camera will be detected though.

c-koi avatar Feb 08 '21 10:02 c-koi

Hmm, don't know what to do with this!

karo11 avatar Feb 08 '21 11:02 karo11

The last git changes brought some improvement!

zart.app still crashes. However, starting exec zart in terminal repeats the initialization part a second time and finally finds the camera. By the way, using openCV 4 might make sense. Trying gmic cli with opencv4 worked well! I don't know the technique in zart.pro well enough to change it by myself.

$ ./sw/zart/zart.app/Contents/MacOS/zart OpenCV: out device of bound (0-0): 1 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 2 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 3 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 4 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 5 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 6 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 7 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 8 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 9 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 10 OpenCV: camera failed to properly initialize! Error: cannot open camera 0 OpenCV says: OpenCV(3.4.13) /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_opencv/opencv/work/opencv-3.4.13/modules/videoio/src/cap.cpp:193: error: (-215:Assertion failed) api != 0 in function 'getBackendName'

OpenCV: out device of bound (0-0): 1 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 2 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 3 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 4 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 5 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 6 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 7 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 8 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 9 OpenCV: camera failed to properly initialize! OpenCV: out device of bound (0-0): 10 OpenCV: camera failed to properly initialize! [ZArt] Webcam 0 is available (1280x720)

karo11 avatar Feb 09 '21 13:02 karo11

Still no change with latest git build with opencv4 Bildschirmfoto 2021-02-10 um 21 33 36

zart.app crashes and start from terminal works with the messages as before

OpenCV says: OpenCV(4.5.0) /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.0/modules/videoio/src/cap.cpp:299: error: (-215:Assertion failed) api != 0 in function 'getBackendName'

karo11 avatar Feb 10 '21 20:02 karo11