├── .clang_complete
├── resources
├── 3D_models
│ ├── nothing.obj
│ ├── 3D_models.qrc
│ ├── piramid.obj
│ └── articated.obj
└── debug_samples
│ ├── textest.png
│ ├── 3_markers_good.webm
│ └── debug_samples.qrc
├── docs
├── images
│ ├── drawn_markers.jpg
│ └── application
│ │ ├── articated_application.jpg
│ │ ├── articated_application_menu.jpg
│ │ ├── articated_application_no_cam.jpg
│ │ └── articated_application_test_video.jpg
└── building-android.md
├── res
├── mipmap-hdpi
│ └── ic_launcher.png
├── mipmap-mdpi
│ └── ic_launcher.png
├── mipmap-xhdpi
│ └── ic_launcher.png
├── mipmap-xxhdpi
│ └── ic_launcher.png
└── mipmap-xxxhdpi
│ └── ic_launcher.png
├── .gitmodules
├── tests
├── vision
│ ├── vision_test.qrc
│ ├── CMakeLists.txt
│ ├── frame_data_lister.hpp
│ ├── frame_data_lister.cpp
│ ├── VisionTest.qml
│ └── main.cpp
├── augmentation
│ ├── augmentation_test.qrc
│ ├── CMakeLists.txt
│ ├── mock_algorithm.hpp
│ ├── main.cpp
│ ├── mock_algorithm.cpp
│ └── AugmentationTest.qml
├── movement3d
│ ├── CMakeLists.txt
│ └── test.cpp
├── movement3d_filter
│ ├── CMakeLists.txt
│ └── test.cpp
├── CMakeLists.txt
└── classification
│ ├── CMakeLists.txt
│ └── demo.cpp
├── source
├── qml
│ ├── qml.qrc
│ ├── Settings.qml
│ ├── Main.qml
│ ├── SettingsView.qml
│ └── MainView.qml
├── shared
│ ├── CMakeLists.txt
│ ├── movement3d
│ │ ├── CMakeLists.txt
│ │ ├── movement3d_filter.cpp
│ │ ├── movement3d_filter.hpp
│ │ ├── movement3d.hpp
│ │ └── movement3d.cpp
│ └── frame_data.hpp
├── augmentation_widget
│ ├── shaders
│ │ ├── GL_shaders.qrc
│ │ ├── background_vs.glsl
│ │ ├── object_vs.glsl
│ │ ├── object_fs.glsl
│ │ └── background_fs.glsl
│ ├── CMakeLists.txt
│ ├── model_loader.hpp
│ ├── augmentation_view.hpp
│ ├── augmentation_renderer.hpp
│ ├── augmentation_view.cpp
│ ├── augmentation_renderer.cpp
│ └── model_loader.cpp
├── vision
│ ├── algorithms
│ │ ├── gpu
│ │ │ ├── shaders
│ │ │ │ ├── vision_gpu_shaders.qrc
│ │ │ │ ├── passthrough_vs.glsl
│ │ │ │ ├── blur_fs.glsl
│ │ │ │ ├── passthrough_fs.glsl
│ │ │ │ └── segment_fs.glsl
│ │ │ ├── algorithm_gpu.hpp
│ │ │ └── algorithm_gpu.cpp
│ │ ├── utils
│ │ │ ├── image.hpp
│ │ │ ├── point.hpp
│ │ │ ├── frame_helper.hpp
│ │ │ ├── operators.hpp
│ │ │ ├── frame_helper.cpp
│ │ │ └── classification.hpp
│ │ ├── algorithm_interface.hpp
│ │ ├── CMakeLists.txt
│ │ ├── random
│ │ │ ├── algorithm_random.hpp
│ │ │ └── algorithm_random.cpp
│ │ └── original
│ │ │ ├── algorithm_original.hpp
│ │ │ └── algorithm_original.cpp
│ ├── CMakeLists.txt
│ ├── vision.hpp
│ └── vision.cpp
├── main.cpp
└── CMakeLists.txt
├── .pre-commit-config.yaml
├── LICENSE
├── .github
└── workflows
│ └── default.yml
├── CMakeLists.txt
├── cmake
├── StringToSemver.cmake
└── GitSemver.cmake
├── .gitignore
├── README.md
└── .clang-format
/.clang_complete:
--------------------------------------------------------------------------------
1 | -Isource
2 |
--------------------------------------------------------------------------------
/resources/3D_models/nothing.obj:
--------------------------------------------------------------------------------
1 | # its nothing
2 |
--------------------------------------------------------------------------------
/docs/images/drawn_markers.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/docs/images/drawn_markers.jpg
--------------------------------------------------------------------------------
/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/resources/debug_samples/textest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/resources/debug_samples/textest.png
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "qt-android-cmake"]
2 | path = qt-android-cmake
3 | url = https://github.com/derpicated/qt-android-cmake.git
4 |
--------------------------------------------------------------------------------
/resources/debug_samples/3_markers_good.webm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/resources/debug_samples/3_markers_good.webm
--------------------------------------------------------------------------------
/docs/images/application/articated_application.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/docs/images/application/articated_application.jpg
--------------------------------------------------------------------------------
/tests/vision/vision_test.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | VisionTest.qml
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/images/application/articated_application_menu.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/docs/images/application/articated_application_menu.jpg
--------------------------------------------------------------------------------
/docs/images/application/articated_application_no_cam.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/docs/images/application/articated_application_no_cam.jpg
--------------------------------------------------------------------------------
/docs/images/application/articated_application_test_video.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derpicated/articated/HEAD/docs/images/application/articated_application_test_video.jpg
--------------------------------------------------------------------------------
/tests/augmentation/augmentation_test.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | AugmentationTest.qml
4 |
5 |
6 |
--------------------------------------------------------------------------------
/resources/debug_samples/debug_samples.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3_markers_good.webm
4 | textest.png
5 |
6 |
7 |
--------------------------------------------------------------------------------
/source/qml/qml.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | Main.qml
4 | MainView.qml
5 | SettingsView.qml
6 | Settings.qml
7 |
8 |
9 |
--------------------------------------------------------------------------------
/source/shared/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Shared
2 | find_package(Qt6 REQUIRED COMPONENTS Core)
3 |
4 | add_subdirectory(movement3d)
5 |
6 | set(CMAKE_AUTOMOC ON)
7 |
8 | add_library(frame_data STATIC frame_data.hpp)
9 | target_link_libraries( frame_data Qt::Core)
10 |
--------------------------------------------------------------------------------
/source/augmentation_widget/shaders/GL_shaders.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | object_vs.glsl
4 | object_fs.glsl
5 | background_vs.glsl
6 | background_fs.glsl
7 |
8 |
9 |
--------------------------------------------------------------------------------
/resources/3D_models/3D_models.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | articated.obj
4 | piramid.obj
5 | shuttle.obj
6 | teapot.obj
7 | nothing.obj
8 |
9 |
10 |
--------------------------------------------------------------------------------
/source/vision/algorithms/gpu/shaders/vision_gpu_shaders.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | passthrough_vs.glsl
4 | passthrough_fs.glsl
5 | blur_fs.glsl
6 | segment_fs.glsl
7 |
8 |
9 |
--------------------------------------------------------------------------------
/source/qml/Settings.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.14
2 |
3 | QtObject {
4 | property var algorithms
5 | property int currentAlgorithm
6 | property int currentDebugLevel
7 | property int currentModel
8 | property string currentSource
9 | property int debugLevels
10 | property var models
11 | }
12 |
--------------------------------------------------------------------------------
/source/augmentation_widget/shaders/background_vs.glsl:
--------------------------------------------------------------------------------
1 | in vec2 position;
2 | in vec2 tex;
3 |
4 | uniform int is_GLRED;
5 |
6 | flat out int vtf_is_GLRED;
7 | out vec2 vtf_texcoord;
8 |
9 | void main()
10 | {
11 | gl_Position = vec4(position, 0.0, 1.0);
12 | vtf_texcoord = tex;
13 | vtf_is_GLRED = is_GLRED;
14 | }
15 |
--------------------------------------------------------------------------------
/tests/movement3d/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(movement3d_test test.cpp)
2 | target_link_libraries(
3 | movement3d_test
4 | movement3d
5 | gtest
6 | gtest_main
7 | )
8 |
9 | add_test(
10 | NAME movement3d_test
11 | COMMAND movement3d_test
12 | WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
13 | )
14 |
--------------------------------------------------------------------------------
/source/augmentation_widget/shaders/object_vs.glsl:
--------------------------------------------------------------------------------
1 | uniform mat4 view_matrix;
2 | in vec3 position;
3 | in vec3 normal;
4 | in vec4 color;
5 |
6 | out vec4 vtf_color;
7 | out vec3 vtf_normal;
8 |
9 | void main()
10 | {
11 | vtf_color = color;
12 | vtf_normal = normal;
13 | gl_Position = view_matrix * vec4(position, 1.0);
14 | }
15 |
--------------------------------------------------------------------------------
/source/vision/algorithms/gpu/shaders/passthrough_vs.glsl:
--------------------------------------------------------------------------------
1 | in vec2 position;
2 | in vec2 tex;
3 |
4 | uniform int is_GLRED;
5 |
6 | flat out int vtf_is_GLRED;
7 | out vec2 vtf_texcoord;
8 |
9 | void main()
10 | {
11 | gl_Position = vec4(position.x, -position.y, 0.0, 1.0);
12 | vtf_texcoord = tex;
13 | vtf_is_GLRED = is_GLRED;
14 | }
15 |
--------------------------------------------------------------------------------
/source/vision/algorithms/utils/image.hpp:
--------------------------------------------------------------------------------
1 | // image.hpp
2 | #ifndef IMAGE_HPP
3 | #define IMAGE_HPP
4 |
5 | #include
6 |
7 | typedef enum { RGB24 = 0, BGR32, YUV, GREY8, BINARY8 } format_t;
8 |
9 | typedef struct image_t {
10 | uint8_t* data;
11 | unsigned width;
12 | unsigned height;
13 | format_t format;
14 | } image_t;
15 |
16 | #endif // IMAGE_HPP
17 |
--------------------------------------------------------------------------------
/tests/movement3d_filter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(movement3d_filter_test test.cpp)
2 | target_link_libraries(
3 | movement3d_filter_test
4 | movement3d_filter
5 | movement3d
6 | gtest
7 | gtest_main
8 | )
9 | add_test(
10 | NAME movement3d_filter_test
11 | COMMAND movement3d_filter_test
12 | WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
13 | )
14 |
--------------------------------------------------------------------------------
/tests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(CMAKE_CXX_STANDARD 17)
2 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
3 | set(CMAKE_CXX_EXTENSIONS OFF)
4 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG ")
5 | add_compile_options(-Wall -Wextra -Wpedantic)
6 |
7 | add_subdirectory(movement3d)
8 | add_subdirectory(movement3d_filter)
9 | add_subdirectory(classification)
10 | add_subdirectory(augmentation)
11 | add_subdirectory(vision)
12 |
--------------------------------------------------------------------------------
/source/vision/algorithms/gpu/shaders/blur_fs.glsl:
--------------------------------------------------------------------------------
1 | #ifdef GL_ES
2 | precision mediump int;
3 | precision mediump float;
4 | #endif
5 |
6 | uniform sampler2D u_tex_background;
7 | flat in int vtf_is_GLRED;
8 | in vec2 vtf_texcoord;
9 |
10 | out highp vec4 frag_color;
11 |
12 | void main()
13 | {
14 | vec4 tex_sample = texture(u_tex_background, vtf_texcoord);
15 | frag_color = vec4(tex_sample.r, tex_sample.r, tex_sample.r, 1.0);
16 | }
17 |
--------------------------------------------------------------------------------
/source/vision/algorithms/gpu/shaders/passthrough_fs.glsl:
--------------------------------------------------------------------------------
1 | #ifdef GL_ES
2 | precision mediump int;
3 | precision mediump float;
4 | #endif
5 |
6 | uniform sampler2D u_tex_background;
7 | flat in int vtf_is_GLRED;
8 | in vec2 vtf_texcoord;
9 |
10 | out highp vec4 frag_color;
11 |
12 | void main()
13 | {
14 | vec4 tex_sample = texture(u_tex_background, vtf_texcoord);
15 | frag_color = vec4(tex_sample.r, tex_sample.r, tex_sample.r, 1.0);
16 | }
17 |
--------------------------------------------------------------------------------
/tests/vision/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick OpenGL)
2 |
3 | set(CMAKE_AUTOMOC ON)
4 |
5 | qt_add_resources(vision_rcc
6 | vision_test.qrc
7 | ${CMAKE_SOURCE_DIR}/resources/3D_models/3D_models.qrc
8 | ${CMAKE_SOURCE_DIR}/resources/debug_samples/debug_samples.qrc
9 | )
10 |
11 | add_executable(vision_test main.cpp frame_data_lister.cpp ${vision_rcc})
12 | target_link_libraries(vision_test frame_data vision Qt::Core Qt::Gui Qt::Quick Qt::OpenGL)
13 |
--------------------------------------------------------------------------------
/tests/classification/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(classification_demo demo.cpp)
2 | target_link_libraries(
3 | classification_demo
4 | algorithms
5 | )
6 |
7 | add_executable(
8 | classification_test
9 | test.cpp
10 | )
11 | target_link_libraries(
12 | classification_test
13 | algorithms
14 | gtest
15 | gtest_main
16 | )
17 |
18 | add_test(
19 | NAME classification_test
20 | COMMAND classification_test
21 | WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
22 | )
23 |
--------------------------------------------------------------------------------
/source/vision/algorithms/gpu/shaders/segment_fs.glsl:
--------------------------------------------------------------------------------
1 | #ifdef GL_ES
2 | precision mediump int;
3 | precision mediump float;
4 | #endif
5 |
6 | uniform sampler2D u_tex_background;
7 | uniform float u_threshold;
8 | in vec2 vtf_texcoord;
9 |
10 | out highp vec4 frag_color;
11 |
12 | void main()
13 | {
14 | vec4 tex_sample = texture(u_tex_background, vtf_texcoord);
15 | float binary_value = mix(1.0, 0.0, step(u_threshold, tex_sample.r));
16 | frag_color = vec4(binary_value, 0.0, 0.0, 1.0);
17 | }
18 |
--------------------------------------------------------------------------------
/tests/augmentation/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick OpenGL)
2 |
3 | set(CMAKE_AUTOMOC ON)
4 |
5 | qt_add_resources(augmentation_rcc
6 | augmentation_test.qrc
7 | ${CMAKE_SOURCE_DIR}/resources/3D_models/3D_models.qrc
8 | ${CMAKE_SOURCE_DIR}/resources/debug_samples/debug_samples.qrc
9 | )
10 |
11 | add_executable(augmentation_test main.cpp mock_algorithm.cpp)
12 | target_link_libraries(augmentation_test frame_data augmentation Qt::Core Qt::Gui Qt::Quick Qt::OpenGL)
13 |
--------------------------------------------------------------------------------
/source/vision/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia OpenGL)
2 |
3 | set(CMAKE_AUTOMOC ON)
4 |
5 | add_subdirectory(algorithms)
6 |
7 | add_library(vision STATIC vision.cpp)
8 | target_link_libraries(vision
9 | Qt::Core
10 | Qt::Gui
11 | Qt::Multimedia
12 | Qt::OpenGL
13 | frame_data
14 | algorithms
15 | movement3d
16 | movement3d_filter
17 | )
18 | target_include_directories(vision PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
19 |
--------------------------------------------------------------------------------
/source/augmentation_widget/shaders/object_fs.glsl:
--------------------------------------------------------------------------------
1 | #ifdef GL_ES
2 | precision mediump int;
3 | precision mediump float;
4 | #endif
5 |
6 | in vec3 vtf_normal;
7 | in highp vec4 vtf_color;
8 | out highp vec4 frag_color;
9 |
10 | void main()
11 | {
12 | float dot_product = dot( vtf_normal, vec3(0.17, 0.98, 0) );
13 | float cosTheta = clamp(dot_product, 0.0, 1.0);
14 | vec3 diffuse = vtf_color.rgb * cosTheta;
15 | vec3 ambient = vtf_color.rgb * 0.5;
16 | frag_color = vec4(vec3(diffuse + ambient), vtf_color.a);
17 | }
18 |
--------------------------------------------------------------------------------
/source/augmentation_widget/shaders/background_fs.glsl:
--------------------------------------------------------------------------------
1 | #ifdef GL_ES
2 | precision mediump int;
3 | precision mediump float;
4 | #endif
5 |
6 | uniform sampler2D u_tex_background;
7 | flat in int vtf_is_GLRED;
8 | in vec2 vtf_texcoord;
9 |
10 | out highp vec4 frag_color;
11 |
12 | void main() {
13 | vec4 tex_sample = texture(u_tex_background, vtf_texcoord);
14 | if (vtf_is_GLRED == 1) {
15 | frag_color = vec4(tex_sample.r, tex_sample.r, tex_sample.r, 1.0);
16 | } else {
17 | frag_color = tex_sample;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/resources/3D_models/piramid.obj:
--------------------------------------------------------------------------------
1 | # Blender v2.78 (sub 0) OBJ File: ''
2 | # www.blender.org
3 | mtllib piramid.mtl
4 | o piramid
5 | v -1.000000 -0.000000 1.000000
6 | v -1.000000 -0.000000 -1.000000
7 | v 1.000000 0.000000 -1.000000
8 | v 1.000000 0.000000 1.000000
9 | v -0.000000 1.200000 0.000000
10 | vn -0.0000 0.5773 0.8165
11 | vn 0.8165 0.5773 0.0000
12 | vn -0.8165 0.5773 -0.0000
13 | vn 0.0000 -1.0000 0.0000
14 | vn 0.0000 0.5773 -0.8165
15 | usemtl red
16 | s 1
17 | f 1//1 4//1 5//1
18 | usemtl green
19 | f 4//2 3//2 5//2
20 | usemtl yellow
21 | f 2//3 1//3 5//3
22 | usemtl cyan
23 | f 1//4 2//4 3//4 4//4
24 | usemtl blue
25 | f 3//5 2//5 5//5
26 |
--------------------------------------------------------------------------------
/source/shared/movement3d/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # movement3d
2 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
3 |
4 | set(MOVEMENT3D_INC movement3d.hpp)
5 | set(MOVEMENT3D_SRC movement3d.cpp)
6 |
7 | add_library( movement3d STATIC ${MOVEMENT3D_SRC} ${MOVEMENT3D_INC} )
8 |
9 | # movement3d_filter
10 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
11 |
12 | set(MOVEMENT3D_FILTER_INC movement3d_filter.hpp)
13 | set(MOVEMENT3D_FILTER_SRC movement3d_filter.cpp)
14 |
15 | add_library( movement3d_filter STATIC ${MOVEMENT3D_FILTER_SRC} ${MOVEMENT3D_FILTER_INC} )
16 | target_link_libraries(movement3d_filter movement3d )
17 | target_include_directories ( movement3d_filter PUBLIC ${INCLUDE_DIR} )
18 |
--------------------------------------------------------------------------------
/source/augmentation_widget/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick OpenGL)
2 |
3 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
4 |
5 | qt_add_resources(
6 | augmentation_RESOURCES
7 | shaders/GL_shaders.qrc
8 | ${CMAKE_SOURCE_DIR}/resources/3D_models/3D_models.qrc
9 | )
10 |
11 | add_library(
12 | augmentation
13 | STATIC
14 | augmentation_view.cpp
15 | augmentation_renderer.cpp
16 | model_loader.cpp
17 | ${augmentation_RESOURCES}
18 | )
19 |
20 | target_link_libraries(augmentation frame_data movement3d Qt::Core Qt::Gui Qt::Quick Qt::OpenGL $<$:GLESv3>)
21 | target_include_directories(augmentation PUBLIC ${INCLUDE_DIR})
22 |
--------------------------------------------------------------------------------
/tests/classification/demo.cpp:
--------------------------------------------------------------------------------
1 | #include "vision/algorithms/utils/classification.hpp"
2 | #include
3 | #include
4 | #include
5 |
6 | int main () {
7 | Classification test_operators;
8 | // clang-format off
9 | points_t ref = {
10 | { 1, { 0, 10 } }, { 2, { 10, 10 }},
11 | { 3, { 0, 0 } }, { 4, { 10, 0 } }
12 | };
13 | points_t points_scaled = {
14 | { 1, { 0, 5 } }, { 2, { 5, 5 } },
15 | { 3, { 0, 0 } }, { 4, { 5, 0 } }
16 | };
17 | // clang-format on
18 | std::cout << "classification demo" << std::endl;
19 | std::cout << "scale: " << test_operators.scale (ref, points_scaled, 5) << std::endl;
20 | return 0;
21 | }
22 |
--------------------------------------------------------------------------------
/source/vision/algorithms/algorithm_interface.hpp:
--------------------------------------------------------------------------------
1 | // vision_algorithm.hpp
2 |
3 | #ifndef VISION_ALGORITHM_HPP
4 | #define VISION_ALGORITHM_HPP
5 |
6 | #include
7 |
8 | #include "shared/frame_data.hpp"
9 |
10 | class AlgorithmInterface {
11 | public:
12 | virtual ~AlgorithmInterface () = default;
13 |
14 | [[nodiscard]] virtual int MaxDebugLevel () const = 0;
15 | [[nodiscard]] virtual int DebugLevel () const = 0;
16 | virtual void SetDebugLevel (const int& new_level) = 0;
17 |
18 | virtual void SetReference () = 0;
19 | virtual FrameData Execute (const QVideoFrame& const_buffer) = 0;
20 | };
21 |
22 | #endif // VISION_ALGORITHM_HPP
23 |
--------------------------------------------------------------------------------
/source/shared/movement3d/movement3d_filter.cpp:
--------------------------------------------------------------------------------
1 | #include "movement3d_filter.hpp"
2 | #include "movement3d.hpp"
3 |
4 | Movement3DFilter::Movement3DFilter (unsigned int samples)
5 | : _samples (samples) {
6 | }
7 |
8 | Movement3DFilter::~Movement3DFilter () {
9 | }
10 |
11 | Movement3D Movement3DFilter::average () {
12 | Movement3D average;
13 | for (Movement3D movement : _movements) {
14 | average += movement;
15 | }
16 | if (!_movements.empty ()) {
17 | average /= _movements.size ();
18 | }
19 | return average;
20 | }
21 |
22 | Movement3D Movement3DFilter::average (Movement3D movement) {
23 | _movements.push_back (movement);
24 | if (_movements.size () > _samples) {
25 | _movements.pop_front ();
26 | }
27 | return average ();
28 | }
29 |
--------------------------------------------------------------------------------
/source/shared/frame_data.hpp:
--------------------------------------------------------------------------------
1 | // frame_data.hpp
2 | #ifndef FRAME_DATA_HPP
3 | #define FRAME_DATA_HPP
4 |
5 | #include
6 | #include
7 | #include