Gray video output from Raspberry Pi 3 in Simulink model

조회 수: 1 (최근 30일)
Ola Olsson
Ola Olsson 2017년 4월 14일
댓글: Ola Olsson 2017년 4월 25일
I am trying to program a Raspberry Pi 3 Model B using Simulink, and starting with some really simple models. Have followed the image inversion examples and the "track a green tennis ball" example that are given on a webinar and a in an additional video. The image inversion kind of works, but the ball tracker does not. My problem seems to be that the RGB channels are not being used the way they should.
If I just make a model with a V4L2 video capture block and an SDL Video Display block, and run the model externally on the RPi I get a nice colour image. However, as soon as I add some manipulation of the RGB channels between the video capture and display, the colour information seems to be lost or distorted. I have tried different things, such as a user defined function like this:
function [Rout,Gout,Bout] = RGBinout(Rin,Gin,Bin)
Rout=Rin; Gout=Gin; Bout=Bin;
and it gives me a gray video output, when it really should give me the same colour video as I get without the function.
What am I doing wrong?
I am using the Camera Module V2 board.
  댓글 수: 2
Ankitha Kollegal Arjun
Ankitha Kollegal Arjun 2017년 4월 20일
Which version of MATLAB are you using?
Ola Olsson
Ola Olsson 2017년 4월 25일
Was using 2016b, have just upgraded to 2017a, and now it works just like expected. Thanks!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Raspberry Pi Hardware에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by