diff --git a/README.md b/README.md index 6fb9306..bca0a59 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ :heavy_check_mark: ***NEW FEATURE*** [`cv::putText` supports full-width CJK characters](#cvputtext-supports-full-width-cjk-characters) +:heavy_check_mark: ***NEW FEATURE*** [`cv::imshow` supports Linux framebuffer and Windows](#cvimshow-supports-linux-framebuffer-and-windows) + |opencv 4.10.0 package size|The official opencv|opencv-mobile| |:-:|:-:|:-:| |source zip|95.2 MB|8.25 MB| @@ -542,6 +544,60 @@ int main() } ``` +## `cv::imshow` supports Linux framebuffer and Windows + +In Linux, `cv::imshow` can display images on the screen (`/dev/fb0`) via the [Linux Framebuffer API](https://www.kernel.org/doc/html/latest/fb/api.html). `cv::imshow` can work without desktop environment (gnome, KDE Plasma, xfce, etc.) or window manager (X or wayland), making it suitable for embedded scenarios. The first argument to `cv::imshow` must be **`fb`**. + +In Windows, `cv::imshow` will use the Windows API to create a simple window for displaying. + + + +
+ +display image + +```cpp +#include +#include + +int main() +{ + cv::Mat bgr = cv::imread("im.jpg", 1); + + cv::imshow("fb", bgr); + + return 0; +} +``` + + + +realtime camera preview + +```cpp +#include +#include + +int main() +{ + cv::VideoCapture cap; + cap.set(cv::CAP_PROP_FRAME_WIDTH, 320); + cap.set(cv::CAP_PROP_FRAME_HEIGHT, 240); + cap.open(0); + + cv::Mat bgr; + while (1) + { + cap >> bgr; + cv::imshow("fb", bgr); + } + + return 0; +} +``` + +
+ # opencv modules included |module|comment|