Skip to content

Stream video example shows switched RGB colors (red <-> blue) #41

@nunoguedelha

Description

@nunoguedelha

When running the stream video example and streaming the Framegrabber "bouncing" ball or the scrolling "line", we can clearly see that the RGB colors are swapped from RGB to BGR.

By using the bouncing ball mode (option --mode ball) and change the code section https://github.com/robotology/yarp/blob/82bcafc792ba9b32aad771f7f5d6f3c52ba5fbbe/src/devices/fakeFrameGrabber/FakeFrameGrabber.cpp#L434-L442 for drawing 3 RGB circles instead of two

    case VOCAB_BALL:
        {
            if (have_bg) {
                image.copy(background);
            } else {
                image.zero();
            }
            addCircle(image,PixelRgb{255,0,0},bx,by,22);
            addCircle(image,PixelRgb{0,255,0},bx,by,15);
            addCircle(image,PixelRgb{0,0,255},bx,by,8);

we can check the color order used on the receiver side to be BGR:

  1. Run the fakeFrameGrabber
yarpdev --file fakeFrameGrabber_basic.ini --mode ball --name /icubSim/camLeftEye

fakeFrameGrabber_basic.ini:

device fakeFrameGrabber
width 640
height 480
period 10
syncro 1
  1. Connect the the output port to a yarpview device.
  2. Run the Open-MCT visualizer.
image

Originally posted by @nunoguedelha in ami-iit/yarp-openmct#101 (comment)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions