|
1 | | -posproc_libdir = get_option('prefix') / get_option('libdir') / 'rpicam-apps-pp' |
| 1 | +posproc_libdir = get_option('prefix') / get_option('libdir') / 'rpicam-apps-postproc' |
2 | 2 |
|
3 | 3 | conf_data = configuration_data() |
4 | 4 | conf_data.set('POSTPROC_LIB_DIR', '"' + posproc_libdir + '"') |
5 | 5 | configure_file(output : 'postproc_lib.h', configuration : conf_data) |
6 | 6 |
|
| 7 | +# Core postprocessing framework files. |
7 | 8 | rpicam_app_src += files([ |
8 | | - 'hdr_stage.cpp', |
9 | 9 | 'histogram.cpp', |
10 | | - 'motion_detect_stage.cpp', |
11 | | - 'negate_stage.cpp', |
12 | 10 | 'post_processing_stage.cpp', |
13 | 11 | 'pwl.cpp', |
14 | 12 | ]) |
15 | 13 |
|
16 | | -post_processing_headers = files([ |
17 | | - 'histogram.hpp', |
18 | | - 'object_detect.hpp', |
19 | | - 'post_processing_stage.hpp', |
20 | | - 'pwl.hpp', |
21 | | - 'segmentation.hpp', |
22 | | - 'tf_stage.hpp', |
| 14 | +# Core postprocessing stages. |
| 15 | +core_postproc_src = files([ |
| 16 | + 'hdr_stage.cpp', |
| 17 | + 'motion_detect_stage.cpp', |
| 18 | + 'negate_stage.cpp', |
23 | 19 | ]) |
24 | 20 |
|
25 | | -enable_opencv = get_option('enable_opencv') |
26 | | -opencv_dep = dependency('opencv4', required : false) |
27 | | -if enable_opencv and opencv_dep.found() |
28 | | - rpicam_app_src += files([ |
| 21 | +core_postproc_lib = shared_module('core-postproc', core_postproc_src, |
| 22 | + include_directories : '../..', |
| 23 | + dependencies : libcamera_dep, |
| 24 | + cpp_args : cpp_arguments, |
| 25 | + install : true, |
| 26 | + install_dir : posproc_libdir, |
| 27 | + name_prefix : '', |
| 28 | + ) |
| 29 | + |
| 30 | +# OpenCV based postprocessing stages. |
| 31 | +enable_opencv = false |
| 32 | +opencv_dep = dependency('opencv4', required : get_option('enable_opencv')) |
| 33 | +if opencv_dep.found() |
| 34 | + opencv_postproc_src = files([ |
29 | 35 | 'sobel_cv_stage.cpp', |
30 | 36 | 'face_detect_cv_stage.cpp', |
31 | 37 | 'annotate_cv_stage.cpp', |
32 | 38 | 'plot_pose_cv_stage.cpp', |
33 | 39 | 'object_detect_draw_cv_stage.cpp', |
34 | 40 | ]) |
35 | | - rpicam_app_dep += opencv_dep |
36 | | -else |
37 | | - enable_opencv = false |
| 41 | + |
| 42 | + opencv_postproc_lib = shared_module('opencv-postproc', opencv_postproc_src, |
| 43 | + include_directories : '../..', |
| 44 | + dependencies : [libcamera_dep, opencv_dep], |
| 45 | + cpp_args : cpp_arguments, |
| 46 | + install : true, |
| 47 | + install_dir : posproc_libdir, |
| 48 | + name_prefix : '', |
| 49 | + ) |
| 50 | + enable_opencv = true |
38 | 51 | endif |
39 | 52 |
|
40 | | -enable_tflite = get_option('enable_tflite') |
41 | | -tflite_dep = dependency('tensorflow-lite', required : false) |
42 | | -if enable_tflite and tflite_dep.found() |
43 | | - rpicam_app_src += files([ |
| 53 | +# TFlite based postprocessing stages. |
| 54 | +enable_tflite = false |
| 55 | +tflite_dep = dependency('tensorflow-lite', required : get_option('enable_tflite')) |
| 56 | +if tflite_dep.found() |
| 57 | + tflite_postproc_src = files([ |
44 | 58 | 'tf_stage.cpp', |
45 | 59 | 'object_classify_tf_stage.cpp', |
46 | 60 | 'pose_estimation_tf_stage.cpp', |
47 | 61 | 'object_detect_tf_stage.cpp', |
48 | 62 | 'segmentation_tf_stage.cpp', |
49 | 63 | ]) |
50 | | - rpicam_app_dep += tflite_dep |
51 | | -else |
52 | | - enable_tflite = false |
| 64 | + |
| 65 | + tflite_postproc_lib = shared_module('tflite-postproc', tflite_postproc_src, |
| 66 | + include_directories : '../..', |
| 67 | + dependencies : [libcamera_dep, tflite_dep], |
| 68 | + cpp_args : cpp_arguments, |
| 69 | + install : true, |
| 70 | + install_dir : posproc_libdir, |
| 71 | + name_prefix : '', |
| 72 | + ) |
| 73 | + enable_tflite = true |
53 | 74 | endif |
54 | 75 |
|
| 76 | +post_processing_headers = files([ |
| 77 | + 'histogram.hpp', |
| 78 | + 'object_detect.hpp', |
| 79 | + 'post_processing_stage.hpp', |
| 80 | + 'pwl.hpp', |
| 81 | + 'segmentation.hpp', |
| 82 | + 'tf_stage.hpp', |
| 83 | +]) |
| 84 | + |
55 | 85 | install_headers(post_processing_headers, subdir: meson.project_name() / 'post_processing_stages') |
0 commit comments