1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00
Files
opencv/doc/tutorials/app/highgui_wayland_ubuntu.markdown
T
Ayush Das 194db6f5cb Merge pull request #29299 from AyushDas4890:fix/doc-typos-tutorials
Fix typos in tutorial documentation #29299

This PR fixes spelling typos across several tutorial documentation files (dnn, calib3d, objdetect, app, js_tutorials), including `export=dowload` -> `export=download` in the DNN text-spotting tutorial's Google Drive URLs.

Documentation-only change; no functional code is affected.

Pull Request Readiness Checklist:

[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 code under GPL or another license that is incompatible with OpenCV.

[x] The PR is proposed to the proper branch (4.x).

[x] Documentation-only change; no accuracy/performance tests or opencv_extra patch are applicable.
2026-06-15 12:28:35 +03:00

2.9 KiB

Using Wayland highgui-backend in Ubuntu

@tableofcontents

@prev_tutorial{tutorial_intelperc}

Original author Kumataro
Compatibility OpenCV >= 4.10
^ Ubuntu 24.04

Goal

This tutorial is to use Wayland highgui-backend in Ubuntu 24.04.

Wayland highgui-backend is experimental implementation.

Setup

  • Setup Ubuntu 24.04.
  • sudo apt install build-essential git cmake to build OpenCV.
  • sudo apt install libwayland-dev wayland-protocols libxkbcommon-dev to enable Wayland highgui-backend.
  • (Option) sudo apt install ninja-build (or remove -GNinja option for cmake command).
  • (Option) sudo apt install libwayland-egl1 to enable Wayland EGL library.

Get OpenCV from GitHub

mkdir work
cd work
git clone --depth=1 https://github.com/opencv/opencv.git

@note --depth=1 option is to limit downloading commits. If you want to see more commit history, please remove this option.

Build/Install OpenCV with Wayland highgui-backend

Run cmake with -DWITH_WAYLAND=ON option to configure OpenCV.

cmake -S opencv -B build4-main -DWITH_WAYLAND=ON -GNinja

If succeeded, Wayland Client/Cursor/Protocols and Xkbcommon versions are shown. Wayland EGL is option.

--
--   GUI:                           Wayland
--     Wayland:                     (Experimental) YES
--       Wayland Client:            YES (ver 1.22.0)
--       Wayland Cursor:            YES (ver 1.22.0)
--       Wayland Protocols:         YES (ver 1.34)
--       Xkbcommon:                 YES (ver 1.6.0)
--       Wayland EGL(Option):       YES (ver 18.1.0)
--     GTK+:                        NO
--     VTK support:                 NO

Run cmake --build to build, and sudo cmake --install to install into your system.

cmake --build build4-main
sudo cmake --install build4-main
sudo ldconfig

Simple Application to try Wayland highgui-backend

Try this code, so you can see name of currentUIFrramework() and OpenCV logo window with Wayland highgui-backend.

// g++ main.cpp -o a.out -I /usr/local/include/opencv4 -lopencv_core -lopencv_highgui -lopencv_imgcodecs
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgcodecs.hpp>
#include <iostream>
#include <string>

int main(void)
{
  std::cout << "cv::currentUIFramework() returns " << cv::currentUIFramework() << std::endl;

  cv::Mat src;
  src = cv::imread("opencv-logo.png");

  cv::namedWindow("src");

  int key = 0;
  do
  {
      cv::imshow("src", src );
      key = cv::waitKey(50);
  } while( key != 'q' );
  return 0;
}

Limitation/Known problem