mirror of
https://github.com/opencv/opencv.git
synced 2024-11-23 18:50:21 +08:00
Page:
OE 26. Samples
Pages
.clang_format
2018
2019
2020
2021
2022
2023
2024
Archive
Branches
BuildOpenCV4OpenVINO
CI configuration
CPU optimizations build options
ChangeLog
CiteOpenCV
Coding_Style_Guide
Compact build advice
Contributing to G API: PRs
Custom OpenCV Android SDK and AAR package build
DNN Efficiency
Deep Learning in OpenCV
Documentation improvement plan
Enabling GStreamer source in G API
Enabling oneVPL source in G API
Evolution Proposals
FAQ
G API Ideas towards OpenCV 5.0
G API Python Bindings
GSoC_2017
GSoC_2018
GSoC_2019
GSoC_2020
GSoC_2021
GSoC_2022
GSoC_2023
GSoC_2024
Graph API
Home
HowToUsePerfTests
HowToWritePerfTests
How_to_contribute
Huawei CANN Backend
Intel OpenVINO backend
Linux_contribution_guide
MediaSDK encode decode backend
OE 0. Template
OE 1. Old C API
OE 10. FP16
OE 11. Logging
OE 12. Lapack
OE 13. DNN ONNX Importer
OE 14. DNN FP16
OE 15. Bit Exactness
OE 16. Mini Halide
OE 17. New Filter Engine
OE 18. Module Optflow
OE 19. Module Stereo
OE 2. OpenCV 2
OE 20. Module Calibration
OE 21. Module Tracking
OE 21. Tracking API
OE 22. Module Point Cloud
OE 23. Module GAPI
OE 24. Module HighGUI
OE 25. Fast VideoIO
OE 26. Samples
OE 27. Wide Universal Intrinsics
OE 28. Image Stitching
OE 29. Adding AVX512 Support
OE 3. OpenCV 3
OE 30. Color Calibration
OE 31. Julia Bindings
OE 32. Change OpenCV License to Apache 2
OE 33. 3D Module
OE 34. Named Parameters
OE 35. TFLite support
OE 4. OpenCV 4
OE 5. OpenCV 5
OpenCL optimizations
OpenCV 5
OpenCV Debugging Facilities
OpenCV Platforms
OpenCV RISC V
OpenCVLogo
OpenCV_GSoC
OpenCV_GSoC_Application
Opencv3
Opencv4
Profiling OpenCV Applications
QA_in_OpenCV
Running native OpenCV code with Hardware Address Sanitizer
TIM VX Backend For Running OpenCV On NPU
Template
TensorFlow Object Detection API
TensorFlow text graphs
Using G API with MS ONNX Runtime
Using G API with OpenCV AI Kit (OAK)
Using G API with OpenVINO Toolkit
Using G API with PlaidML backend
Video IO hardware acceleration
Video capture and write benchmark
[Deprecated] Tengine based acceleration
2
OE 26. Samples
Vadim Pisarevsky edited this page 2018-03-07 16:34:47 +03:00
Revise and improve samples to make them more useful and easier to run.
- Author: Vadim Pisarevsky
- Link: The feature request
- Status: Draft
- Platforms: All
- Complexity: 1-2 man-months
Introduction and Rationale
OpenCV includes several dozens of samples split by multiple directories (e.g. opencv samples are placed in opencv/samples, whereas opencv_contrib samples are put into the subdirectories of the corresponding modules. In general, the samples is very useful part of OpenCV and it really helps our users to start playing with the library. On the other hand, there are some issues:
- Some of the samples have been created long time ago and are very primitive. E.g. morphology.cpp or laplace.cpp or convexhull.cpp. Some of those samples should better be turned into the code snippets in documentation.
- Some other samples have been created recently and largely duplicate each other (e.g. many similar object detection samples in opencv/samples/dnn.
- Some more samples do not really do what they should. For example, letter_recog.cpp sample simply reads the file with precomputed features of each letter, whereas some people may expect that it does live recognition of letters shown to camera (and basically we have all the technology ready for that).
- Quite a few samples need some images and models as input parameters, therefore if you build and run them from Visual Studio, for example, they will likely immediately exit; one need to apply extra efforts to make them work properly.
- Some samples can be controlled by hot keys. This console window is not always displayed and not always visible. Besides, you need to change focus from the console to the highgui window in order to make those hot keys work.
- Another drawback of the samples is that very few of them can run autonomously and do some useful thing. In other words, it's basically impossible to re-use samples as the smoke tests and quickly verify before releases whether they work well (or run at all) or not.
Proposed solution
There are many issues mentioned above and we basically propose to solve the issues one by one.
- go through the list of samples and maybe remove some obsolete stuff. Some of the samples can be turned into the code snippets. Probably, many of the samples, if not all, can be moved into the corresponding modules.
- improve some other samples based on the latest technology that we have. The classical examples are digits.py and letter_recog.cpp.
- make sure that the samples find (or at least try to find) the proper data when they are launched from the file manager without any parameters. For example, OpenCV can provide some function and/or some "path" macro in cvconfig.h that will help to locate the OpenCV source tree and the corresponding samples/data subdirectory.
- it would be useful to attach some scrolling graphically-rendered "console" window to the highgui windows where the app description and the hot key descriptions could be displayed. Need to see how difficult it would be to implement, probably not very difficult.
- it would be nice to make the samples scriptable, or maybe use external tool to run the samples and then pass some key presses and mouse events to the highgui windows.
Impact on existing code, compatibility
No any impact on the code, it's only about the samples and the documentation. Some features may require highgui extensions.
Possible alternatives
this proposal includes multiple semi-independent items. We can do some of them, we can postpone or even reject others.
References
TBD
- Home
- Deep Learning in OpenCV
- Running OpenCV on Various Platforms
- OpenCV 5
- OpenCV 4
- OpenCV 3
- Development process
- OpenCV GSoC
- Archive
© Copyright 2024, OpenCV team