Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kozinove
Copy link
Contributor

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • [ x] I agree to contribute to the project under Apache 2 License.
  • [ x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • [ x] The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • [ x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • [ x] The feature is well documented and sample code can be built with the project CMake

Environment variables used:
OPENCV_UI_BACKEND - you need to add the value “FB”
OPENCV_UI_PRIORITY_FB - requires priority indication
OPENCV_HIGHGUI_FB_MODE={FB|XVFB|EMU} - mode of using Framebuffer (default "FB")

  • FB - Linux Framebuffer
  • XVFB - virtual Framebuffer
  • EMU - emulation (images are not displayed)
    OPENCV_HIGHGUI_FB_DEVICE (FRAMEBUFFER) - path to the Framebuffer file (default "/dev/fb0").

Examples of using:

sudo OPENCV_UI_BACKEND=FB ./opencv_test_highgui
sudo OPENCV_UI_PRIORITY_FB=1111 ./opencv_test_highgui
OPENCV_UI_BACKEND=FB OPENCV_HIGHGUI_FB_MODE=EMU ./opencv_test_highgui
sudo OPENCV_UI_BACKEND=FB OPENCV_HIGHGUI_FB_MODE=FB ./opencv_test_highgui

export DISPLAY=:99
Xvfb $DISPLAY -screen 0 1024x768x24 -fbdir /tmp/ -f /tmp/user.xvfb.auth&
sudo -u sipeed XAUTHORITY=/tmp/user.xvfb.auth x11vnc -display $DISPLAY -listen localhost&
DISPLAY=:0 gvncviewer localhost&

FRAMEBUFFER=/tmp/Xvfb_screen0 OPENCV_UI_BACKEND=FB OPENCV_HIGHGUI_FB_MODE=XVFB ./opencv_test_highgui

Copy link
Contributor

@mshabunin mshabunin left a comment

Choose a reason for hiding this comment

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

Thank you! Overall looks good to me, two comments should be fixed before merge.

Perhaps we could improve the code a little bit, but it's not critical. Let's observe the community feedback and act accordingly.

@asmorkalov
Copy link
Contributor

@opencv-alalek could you take a look again?

Copy link
Contributor

@opencv-alalek opencv-alalek left a comment

Choose a reason for hiding this comment

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

Thank you for update!

@kozinove
Copy link
Contributor Author

@opencv-alalek Did I understand correctly what changes needed to be made to the CMake files?

@kozinove
Copy link
Contributor Author

@opencv-alalek Is the WITH_FRAMEBUFFER_XVFB option redundant?
In modules/highgui/cmake/detect_framebuffer.cmake we define the available configuration - in particular the presence of XVFB and explicitly write the status.

I can remove the option and fix the warning issued in the main implementation (window_framebuffer.cpp)

@mshabunin
Copy link
Contributor

@kozinove , _XVFB option should be treated as a sub-option in this case. It should be checked only if the main option is enabled.

if(WITH_FRAMEBUFFER)
  # ...
  if(WITH_FRAMBUFFER_XVFB)
    # ... check header files and enable feature if they exist
  endif()
  # ...
endif()

@kozinove
Copy link
Contributor Author

fixed work with framebuffer in cmake

  1. WITH_FRAMBUFFER_XVFB is checked only if there is WITH_FRAMBUFFER=ON
  2. modules/highgui/cmake/detect_framebuffer.cmake unnecessary comparisons and flag settings have been removed
  3. modules/highgui/cmake/init.cmake odules/highgui/cmake/init.cmake is called only by add_backend("framebuffer" WITH_FRAMEBUFFER)

Copy link
Contributor

@mshabunin mshabunin left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good to me. Just several minor comments.

@asmorkalov asmorkalov changed the title Framebuffer Highgui backend on top of Framebuffer Jun 26, 2024
@asmorkalov asmorkalov merged commit efa4d91 into opencv:4.x Jun 26, 2024
@asmorkalov asmorkalov mentioned this pull request Jul 1, 2024
@sturkmen72 sturkmen72 mentioned this pull request Jul 15, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants