Skip to content

Fix video stream demo image scaling, shaking and color shift#40

Merged
nunoguedelha merged 5 commits into
masterfrom
fix/videoStreamDemo-image-scaling-shaking-colorShift
Apr 14, 2022
Merged

Fix video stream demo image scaling, shaking and color shift#40
nunoguedelha merged 5 commits into
masterfrom
fix/videoStreamDemo-image-scaling-shaking-colorShift

Conversation

@nunoguedelha
Copy link
Copy Markdown
Collaborator

Fixes #39 .

- The image was trembling due to the display of the HTML element 'write-time'. This element is the image frame refresh interval oscillating between ~9 and ~11 ms, which results in a element length toggling.
- As the image has a display 'inline-block' style, it flickers along with the 'write-time' length.
- We just use a line break to avoid this effect.
Refer to issue 41.
- OpenCV library assumes the color channel order to be BGR or BGRA.
- before calling `cv::imencode()`, use `cv::cvtColor()` for converting the original
  channel order into BGR or BGRA.
- an exception is raised for non supported pixel codes.
@nunoguedelha nunoguedelha marked this pull request as ready for review April 14, 2022 02:40
@nunoguedelha nunoguedelha requested a review from traversaro April 14, 2022 02:41
@nunoguedelha
Copy link
Copy Markdown
Collaborator Author

CC @S-Dafarra @RiccardoGrieco

@nunoguedelha
Copy link
Copy Markdown
Collaborator Author

I'm still finishing an approach based on @S-Dafarra's suggestion, but it's already worth reviewing the implementation so far already discussed in the call.

Copy link
Copy Markdown
Member

@traversaro traversaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, seems ok. Not sure if you want to check if we can do just with YARP but anyhow we can always merge this and improve it later.

Comment thread YarpJS/src/YarpJS_Image.cpp Outdated
@nunoguedelha
Copy link
Copy Markdown
Collaborator Author

Thanks, seems ok. Not sure if you want to check if we can do just with YARP but anyhow we can always merge this and improve it later.

Thanks @traversaro , I will submit a separate PR for the improvement, as you suggested, that way it shall be easier to discuss around it and eventually discard it.

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

Successfully merging this pull request may close these issues.

Stream video example fails with the Framegrabber bouncing ball

3 participants