From 02977c48e69940942e4983ccdf63cf1a642ccd82 Mon Sep 17 00:00:00 2001 From: kallaballa Date: Sun, 24 Sep 2023 04:37:49 +0200 Subject: [PATCH] updated docs --- modules/v4d/tutorials/00-intro.markdown | 22 +++++++------------ .../v4d/tutorials/01-dislay_image.markdown | 2 +- .../v4d/tutorials/03-vector_graphics.markdown | 2 +- .../v4d/tutorials/09-font_with_gui.markdown | 2 +- modules/v4d/tutorials/17-beauty.markdown | 2 +- modules/v4d/tutorials/18-many-cubes.markdown | 2 +- 6 files changed, 13 insertions(+), 19 deletions(-) diff --git a/modules/v4d/tutorials/00-intro.markdown b/modules/v4d/tutorials/00-intro.markdown index 99bbd3257..d2eb43fb6 100644 --- a/modules/v4d/tutorials/00-intro.markdown +++ b/modules/v4d/tutorials/00-intro.markdown @@ -8,13 +8,13 @@ | Compatibility | OpenCV >= 4.7 | # What is V4D? -V4D offers a way of writing graphical (on- and offscreen) high performance applications with OpenCV. It is light-weight and unencumbered by QT or GTK licenses. It features vector graphics using [NanoVG](https://github.com/inniyah/nanovg) a GUI based on [NanoGUI](https://github.com/mitsuba-renderer/nanogui) and (on supported systems) OpenCL/OpenGL and OpenCL/VAAPI interoperability. It should be included in [OpenCV-contrib](https://github.com/opencv/opencv_contrib) once it is ready. +V4D offers a way of writing graphical (on- and offscreen) high performance applications with OpenCV. It is light-weight and unencumbered by QT or GTK licenses. It features vector graphics using [NanoVG](https://github.com/inniyah/nanovg) a GUI based on [ImGUI](https://github.com/ocornut/imgui) and (on supported systems) OpenCL/OpenGL and OpenCL/VAAPI interoperability. It should be included in [OpenCV-contrib](https://github.com/opencv/opencv_contrib) once it is ready. # Why V4D? Please refer to the online demos in the \ref v4d_tutorials and \ref v4d_demos section to see at a glance what it can do for you. **But note**: The online demos are slower than native builds and are sometimes missing features. If you want full performance (including hardware acceleration) you should really create a native build and test it. * **OpenGL**: Easy access to OpenGL. -* **GUI**: Simple yet powerful user interfaces through NanoGUI. +* **GUI**: Simple yet powerful user interfaces through ImGui. * **Vector graphics**: Elegant and fast vector graphics through NanoVG. * **Font rendering**: Loading of fonts and sophisticated rendering options. * **Video pipeline**: Through a simple source/sink system videos can be efficently read, displayed, edited and saved. @@ -25,7 +25,7 @@ Please refer to the online demos in the \ref v4d_tutorials and \ref v4d_demos se # Design Notes * V4D is not thread safe. Though it is possible to have several V4D objects in one or more threads and synchronize them using ```V4D::makeCurrent()```. This is a limitation of GLFW3/EGL. That said, OpenCV algorithms are multi-threaded as usual. * V4D uses InputArray/OutputArray/InputOutputArray which gives you the option to work with Mat, std::vector and UMat. Anyway, you should prefer to use UMat whenever possible to automatically use hardware capabilities where available. -* Access to different subsystems (opengl, framebuffer, nanovg and nanogui) is provided through "contexts". A context is simply a function that takes a functor, sets up the subsystem, executes the functor and tears-down the subsystem. +* Access to different subsystems (opengl, framebuffer, nanovg and imgui) is provided through "contexts". A context is simply a function that takes a functor, sets up the subsystem, executes the functor and tears-down the subsystem. * ```V4D::run``` is not a context. It is an abstraction of a run loop that takes a functor and runs until the application terminates or the functor returns false. This is necessary for portability reasons. * Contexts ***may not*** be nested. @@ -42,7 +42,7 @@ v4d->gl([](const Size sz) { # GPU Support * Intel Gen 8+ (Tested: Gen 11 + Gen 13) is supported best -* NVIDIA Ada Lovelace (Tested: GTX 4070 Ti) with proprietary drivers (535.104.05) and CUDA toolkit (12.2) works mostly (NanoGUI flickers) but video writing is very slow, unless: you change the codec to H264 or you create a gstreamer sink using nvenc. +* NVIDIA Ada Lovelace (Tested: GTX 4070 Ti) with proprietary drivers (535.104.05) and CUDA toolkit (12.2) works but video writing is very slow, unless: you change the codec to H264 or you create a gstreamer sink using nvenc. * AMD: never tested # Requirements @@ -57,7 +57,8 @@ v4d->gl([](const Size sz) { * [My OpenCV 4.x fork](https://github.com/kallaballa/opencv) (It works with mainline OpenCV 4.x as well, but will miss some features) * GLEW * GLFW3 -* [My NanoGUI fork](https://github.com/kallaballa/nanogui) which is included with V4D as a sub-repository (includes NanoVG). +* NanoVG (included as a sub-repo) +* ImGui (included as a sub-repo) # Optional: Dependencies for demos * (At the time of writing) If you want CL-GL interop on a recent Intel Platform you might need to build [compute-runtime](https://github.com/intel/compute-runtime). The first version of compute-runtime shipping CL-GL interop is **23.13.26032** @@ -128,15 +129,6 @@ sudo make install cpack DEB ``` -## Download models -```bash -mkdir assets -cd assets -wget https://github.com/kurnianggoro/GSOC2017/raw/master/data/lbfmodel.yaml -wget https://github.com/opencv/opencv_zoo/raw/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx -cd .. -``` - ## Download the example videos ```bash # big buck bunny video @@ -162,6 +154,7 @@ bin/example_v4d_font_with_gui # Demos bin/example_v4d_cube-demo +bin/example_v4d_many_cubes-demo bin/example_v4d_video-demo bunny.webm bin/example_v4d_nanovg-demo bunny.webm bin/example_v4d_shader-demo bunny.webm @@ -177,3 +170,4 @@ bin/example_v4d_beauty-demo kristen.webm * The author of the dance video is **GNI Dance Company** ([Original video](https://www.youtube.com/watch?v=yg6LZtNeO_8)). * The author of the video used in the beauty-demo video is **Kristen Leanne** ([Original video](https://www.youtube.com/watch?v=hUAT8Jm_dvw&t=11s)). * The author of cxxpool is **Copyright (c) 2022 Christian Blume**: ([LICENSE](https://github.com/bloomen/cxxpool/blob/master/LICENSE)) +* The author of the roboto font family is **Google Inc.** ([LICENSE](https://github.com/googlefonts/roboto/blob/main/LICENSE)) diff --git a/modules/v4d/tutorials/01-dislay_image.markdown b/modules/v4d/tutorials/01-dislay_image.markdown index 87bd69f72..7b75df1a6 100644 --- a/modules/v4d/tutorials/01-dislay_image.markdown +++ b/modules/v4d/tutorials/01-dislay_image.markdown @@ -9,7 +9,7 @@ | Compatibility | OpenCV >= 4.7 | ## Using the video pipeline -Actually there are several ways to display an image using V4D. The most convenient way is to use the video pipeline to feed an image to V4D. That has the advantage that the image is automatically resized (preserving aspect ratio) to framebuffer size and color converted (the framebuffer is BGRA). +Actually there are several ways to display an image using V4D. The most convenient way is to use the video pipeline to feed an image to V4D. That has the advantage that the image is automatically resized (preserving aspect ratio) to framebuffer size and color converted (the framebuffer is BGRA while video frames are expected to be BGR). \htmlinclude "../samples/example_v4d_display_image.html" diff --git a/modules/v4d/tutorials/03-vector_graphics.markdown b/modules/v4d/tutorials/03-vector_graphics.markdown index df934ac07..46f316f8d 100644 --- a/modules/v4d/tutorials/03-vector_graphics.markdown +++ b/modules/v4d/tutorials/03-vector_graphics.markdown @@ -9,7 +9,7 @@ | Compatibility | OpenCV >= 4.7 | ## Vector graphics -Through the nvg context html5-canvas-like vector graphic rendering is possible. +Through the html5-canvas-like nvg-context sophisticated vector graphics rendering is possible. \htmlinclude "../samples/example_v4d_vector_graphics.html" diff --git a/modules/v4d/tutorials/09-font_with_gui.markdown b/modules/v4d/tutorials/09-font_with_gui.markdown index 6e7d1a311..e220fa391 100644 --- a/modules/v4d/tutorials/09-font_with_gui.markdown +++ b/modules/v4d/tutorials/09-font_with_gui.markdown @@ -8,7 +8,7 @@ | Compatibility | OpenCV >= 4.7 | ## Font rendering with form based GUI -Draws "Hello World" to the screen and let's you control the font size and color with a GUI based on FormHelper. +Draws "Hello World" to the screen and let's you control the font size and color with a GUI. \htmlinclude "../samples/example_v4d_font_with_gui.html" diff --git a/modules/v4d/tutorials/17-beauty.markdown b/modules/v4d/tutorials/17-beauty.markdown index e1fe4a6d7..5bdc712c2 100644 --- a/modules/v4d/tutorials/17-beauty.markdown +++ b/modules/v4d/tutorials/17-beauty.markdown @@ -7,7 +7,7 @@ | Original author | Amir Hassan (kallaballa) | | Compatibility | OpenCV >= 4.7 | -Face beautification using face landmark detection (OpenCV), nanovg (OpenGL) for drawing masks and multi-band blending (CPU) to put it all together. +Face beautification using face landmark detection (OpenCV), nanovg (OpenGL) for drawing masks and multi-band blending to put it all together. \htmlinclude "../samples/example_v4d_beauty-demo.html" diff --git a/modules/v4d/tutorials/18-many-cubes.markdown b/modules/v4d/tutorials/18-many-cubes.markdown index 699dbef5b..3c0fa637e 100644 --- a/modules/v4d/tutorials/18-many-cubes.markdown +++ b/modules/v4d/tutorials/18-many-cubes.markdown @@ -8,7 +8,7 @@ | Original author | Amir Hassan (kallaballa) | | Compatibility | OpenCV >= 4.7 | -Renders 10 rainbow cubes on blueish background using OpenGL and applies a glow effect using OpenCV. The special thing about this demo is the each cube is renderered in a different OpenGL-context with its independent OpenGL-state. That said, this for sure isn't the most efficient way to draw multiple copies but serves well to demonstrate how independent OpenGL contexts/states can be used. +Renders 12 rainbow cubes on blueish background using OpenGL and applies a glow effect using OpenCV. The special thing about this demo is the each cube is renderered in a different OpenGL-context with its independent OpenGL-state. That said, this for sure isn't the most efficient way to draw multiple copies but serves well to demonstrate how independent OpenGL contexts/states can be used. \htmlinclude "../samples/example_v4d_many_cubes-demo.html"