フィルターのクリア

Code generated using Simulink support package for RPi can't open v4l2 camera

2 ビュー (過去 30 日間)
Muhammad Bilal
Muhammad Bilal 2022 年 5 月 16 日
コメント済み: Prasanth Sunkara 2022 年 5 月 17 日
My RPi has two usb cameras at /dev/video0 and /dev/video2. I am using this device (https://www.amazon.com/ELP-Camera-2Megapixel-Android-Windows/dp/B078TGFZ22).
The code generated using Simulink can only open the one at "/dev/video0" and give the error for video2 saying "specified resolution [320 240] not supported".
I have written another code in matlab to test and interestingly that works.
rpi = raspi('192.168.4.100','pi','123')
webcamlist(rpi)
cam1 = webcam(rpi,1); %Opens and shows captured frames
cam2 = webcam(rpi,2); %Opens and shows captured frames
  1 件のコメント
Prasanth Sunkara
Prasanth Sunkara 2022 年 5 月 17 日
A quick check would be to know the resolution webcam function used. I guess it took a default value of 320x240.You can get this by executing cam1 (or cam2) variable on MATLAB without a semicolon. Eg: >>cam1
If possible use the raspberry pi resource monitor app to confirm the device id value(/dev/video2) and retry the Simulink model by changing the camera resolution to a different value.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeRaspberry Pi Hardware についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by