Skip to content

Greyscale Camera support? #96

@sferguson-ISI

Description

@sferguson-ISI

Description

Hello, I am trying to get a monochrome camera to work with the camera example detect.py code. Specifically I have a See3CAM_CU55M grayscale camera I'm attempting to get working with the called Gstreamer pipeline code in the example. I can get the camera outputting a stream with gst-launch-1.0 -v v4l2src device=/dev/video1 ! "video/x-raw, format=GRAY8, width=1280, height=720" ! videoconvert ! autovideosink sync=false.

However when I attempt to launch the detect.py like so: python3 /home/mendel/test/examples-camera_portion/detect.py --model /home/mendel/pre_trained_model/edgetpu/test_data/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite --labels /home/mendel/pre_trained_model/edgetpu/test_data/coco_labels.txt --videosrc /dev/video1 --threshold 0.7 --top_k 10

I get this output:
Loading /home/mendel/pre_trained_model/edgetpu/test_data/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite with /home/mendel/pre_trained_model/edgetpu/test_data/coco_labels.txt labels. Neural network weight read [{'name': 'normalized_input_image_tensor', 'index': 7, 'shape': array([ 1, 300, 300, 3], dtype=int32), 'shape_signature': array([ 1, 300, 300, 3], dtype=int32), 'dtype': <class 'numpy.uint8'>, 'quantization': (0.0078125, 128), 'quantization_parameters': {'scales': array([0.0078125], dtype=float32), 'zero_points': array([128], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}] Input tensor size: (300, 300) Gstreamer pipeline: v4l2src device=/dev/video1 ! video/x-raw,width=640,height=480,framerate=30/1 ! decodebin ! glupload ! tee name=t t. ! queue ! glfilterbin filter=glbox name=glbox ! video/x-raw,width=300,height=300 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true t. ! queue ! glsvgoverlaysink name=overlaysink

Error: gst-stream-error-quark: Internal data stream error. (1): gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4)

I tried adding in a format=GRAY8 at the source part of the pipeline but still I get the same error. Any recommendations on what to try next? Does this have to do with the fact the camera is a monochrome camera?

Click to expand!

Issue Type

Support

Operating System

Mendel Linux

Coral Device

Dev Board

Other Devices

No response

Programming Language

Python 3.8

Relevant Log Output

Loading /home/mendel/pre_trained_model/edgetpu/test_data/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite with /home/mendel/pre_trained_model/edgetpu/test_data/coco_labels.txt labels. Neural network weight read [{'name': 'normalized_input_image_tensor', 'index': 7, 'shape': array([ 1, 300, 300, 3], dtype=int32), 'shape_signature': array([ 1, 300, 300, 3], dtype=int32), 'dtype': <class 'numpy.uint8'>, 'quantization': (0.0078125, 128), 'quantization_parameters': {'scales': array([0.0078125], dtype=float32), 'zero_points': array([128], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}] Input tensor size: (300, 300) Gstreamer pipeline: v4l2src device=/dev/video1 ! video/x-raw,width=640,height=480,framerate=30/1 ! decodebin ! glupload ! tee name=t t. ! queue ! glfilterbin filter=glbox name=glbox ! video/x-raw,width=300,height=300 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true t. ! queue ! glsvgoverlaysink name=overlaysink

Error: gst-stream-error-quark: Internal data stream error. (1): gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions