Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV Unable to stop the stream: Device or resource busy OpenCV(3.4.1) Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 11115 Error converting to RGB #20

Closed
monajalal opened this issue Jun 25, 2018 · 1 comment

Comments

@monajalal
Copy link

so when I run the detect_single_threaded.py I get the following error:


mona@Mona:~/code/handpose/handtracking$ python detect_single_threaded.py 
/home/mona/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
> ====== loading HAND frozen graph into memory
2018-06-25 15:41:14.073745: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-06-25 15:41:14.166765: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found device 0 with properties: 
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:01:00.0
totalMemory: 11.90GiB freeMemory: 10.81GiB
2018-06-25 15:41:14.166792: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1435] Adding visible gpu devices: 0
2018-06-25 15:41:14.357558: I tensorflow/core/common_runtime/gpu/gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-06-25 15:41:14.357588: I tensorflow/core/common_runtime/gpu/gpu_device.cc:929]      0 
2018-06-25 15:41:14.357593: I tensorflow/core/common_runtime/gpu/gpu_device.cc:942] 0:   N 
2018-06-25 15:41:14.357801: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10461 MB memory) -> physical GPU (device: 0, name: TITAN Xp, pci bus id: 0000:01:00.0, compute capability: 6.1)
>  ====== Hand Inference graph loaded.
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
Unable to stop the stream: Device or resource busy
OpenCV(3.4.1) Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 11115
Error converting to RGB
Traceback (most recent call last):
  File "detect_single_threaded.py", line 53, in <module>
    image_np, detection_graph, sess)
  File "/home/mona/code/handpose/handtracking/utils/detector_utils.py", line 90, in detect_objects
    feed_dict={image_tensor: image_np_expanded})
  File "/home/mona/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run
    run_metadata_ptr)
  File "/home/mona/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1104, in _run
    np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)
  File "/home/mona/anaconda3/lib/python3.6/site-packages/numpy/core/numeric.py", line 492, in asarray
    return array(a, dtype, copy=False, order=order)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

I have
$ ls /dev/video*
/dev/video1

and have set the video capture to use device 1. Why do I get this error and how to fix it?

@victordibia
Copy link
Owner

Hi @monajalal ,

The error you have is related to your camera setup - OpenCV is having difficulty reading your video stream. What kind of machine/camera hardware are you using? The code in this repo is tested on the Macbook pro environment ... for other custom environments, you might need to make modifications.

-V.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants