Skip to content

Commit de6995e

Browse files
committed
1 parent e313986 commit de6995e

File tree

9 files changed

+534
-0
lines changed

9 files changed

+534
-0
lines changed

CMakeLists.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ generate_dynamic_reconfigure_options(
6666
cfg/HSVColorFilter.cfg
6767
cfg/LabColorFilter.cfg
6868
cfg/WatershedSegmentation.cfg
69+
#
70+
cfg/Tracking.cfg
6971
)
7072

7173
## Generate messages in the 'msg' folder
@@ -107,6 +109,7 @@ add_message_files(
107109
add_service_files(
108110
FILES
109111
FaceRecognitionTrain.srv
112+
SetImages.srv
110113
)
111114

112115
## Generate added messages and services with any dependencies listed here
@@ -327,6 +330,36 @@ opencv_apps_add_nodelet(segment_objects src/nodelet/segment_objects_nodelet.cpp)
327330
# ./videostab.cpp
328331
opencv_apps_add_nodelet(watershed_segmentation src/nodelet/watershed_segmentation_nodelet.cpp) # ./watershed.cpp
329332

333+
# contrib modules (https://docs.opencv.org/4.x/d3/d81/tutorial_contrib_root.html)
334+
# alphamat. Information Flow Alpha Matting
335+
# aruco. ArUco marker detection (aruco module)
336+
# barcode. Tutorials for barcode module
337+
# bgsegm. Tutorials for bgsegm module
338+
# bioinspired. Discovering the human retina and its use for image processing
339+
# ccalib. Multi-camera Calibration
340+
# ccalib. Omnidirectional Camera Calibration
341+
# cvv. Interactive Visual Debugging of Computer Vision applications
342+
# dnn_objdetect. Object Detection using CNNs
343+
# dnn_superres. Super Resolution using CNNs
344+
# face. Tutorials for face module
345+
# face. Tutorial on Facial Landmark Detector API
346+
# fuzzy. Fuzzy image processing tutorials
347+
# hdf. The Hierarchical Data Format (hdf) I/O
348+
# julia. Introduction to Julia OpenCV Binding
349+
# line_descriptor. Line Features Tutorial
350+
# mcc. Color Correction Model
351+
# mcc. ColorChecker Detection
352+
# phase_unwrapping. Phase Unwrapping tutorial
353+
# sfm. Structure From Motion
354+
# stereo. Quasi Dense Stereo (stereo module)
355+
# structured_light. Structured Light tutorials
356+
# text. Text module
357+
# tracking. Customizing the CN Tracker
358+
if(OpenCV_VERSION VERSION_GREATER "4.0")
359+
opencv_apps_add_nodelet(tracking src/nodelet/tracking_nodelet.cpp) # tracking. Introduction to OpenCV Tracker
360+
endif()
361+
# tracking. Using MultiTracker
362+
330363
# ros examples
331364
opencv_apps_add_nodelet(simple_example src/nodelet/simple_example_nodelet.cpp)
332365
opencv_apps_add_nodelet(simple_compressed_example src/nodelet/simple_compressed_example_nodelet.cpp)
@@ -387,6 +420,9 @@ if(CATKIN_ENABLE_TESTING)
387420
message(WARNING "roslaunch_add_file check fails with unsupported doc attributes ${roslaunch_VERSION}")
388421
else()
389422
file(GLOB LAUNCH_FILES launch/*.launch)
423+
if(NOT OpenCV_VERSION VERSION_GREATER "4.0")
424+
list(REMOVE_ITEM LAUNCH_FILES ${CMAKE_CURRENT_SOURCE_DIR}/launch/tracking.launch)
425+
endif()
390426
foreach(LAUNCH_FILE ${LAUNCH_FILES})
391427
roslaunch_add_file_check(${LAUNCH_FILE})
392428
endforeach()

cfg/Tracking.cfg

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#! /usr/bin/env python
2+
3+
PACKAGE = "opencv_apps"
4+
5+
from dynamic_reconfigure.parameter_generator_catkin import *
6+
7+
gen = ParameterGenerator()
8+
9+
gen.add("use_camera_info", bool_t, 0, "Indicates that the camera_info topic should be subscribed to to get the default input_frame_id. Otherwise the frame from the image message will be used.", False)
10+
11+
tracking_algorithm = gen.enum([gen.const("MIL", int_t, 0, "MIL (Multiple Instance Learning) tracker"),
12+
gen.const("BOOSTING", int_t, 1, "On-line version of the AdaBoost tracker"),
13+
gen.const("MEDIANFLOW", int_t, 2, "Median Flow tracker"),
14+
gen.const("TLD", int_t, 3, "TLD (Tracking, learning and detection) tracker"),
15+
gen.const("KCF", int_t, 4, "KCF (Kernelized Correlation Filter) tracker"),
16+
gen.const("GOTURN", int_t, 5, "GOTURN (Generic Object Tracking Using Regression Networks) tracker"),
17+
gen.const("MOSSE", int_t, 6, "MOSSE (Minimum Output Sum of Squared Error) tracker"),],
18+
"An enum for Tracking Algorithms")
19+
20+
gen.add("tracking_algorithm", int_t, 0, "Tracking Algorithm", 4, 0, 6, edit_method=tracking_algorithm)
21+
22+
exit(gen.generate(PACKAGE, "tracking", "Tracking"))
23+

launch/tracking.launch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<launch>
2+
<arg name="node_name" default="tracking" />
3+
<arg name="image" default="image" doc="The image topic. Should be remapped to the name of the real image topic." />
4+
5+
<arg name="use_camera_info" default="false" doc="Indicates that the camera_info topic should be subscribed to to get the default input_frame_id. Otherwise the frame from the image message will be used." />
6+
<arg name="debug_view" default="true" doc="Specify whether the node displays a window to show edge image" />
7+
<arg name="queue_size" default="3" doc="Specigy queue_size of input image subscribers" />
8+
9+
<arg name="tracking_algorithm" default="4" doc="Tracking algorithm 0: MIL, 1: Boosting, 2: Medianflow, 3: TLD, 4: KCF, 5: GOTURN, 6: MOSSE" />
10+
11+
<!-- threshold.cpp -->
12+
<node name="$(arg node_name)" pkg="opencv_apps" type="tracking" output="screen">
13+
<remap from="image" to="$(arg image)" />
14+
<param name="use_camera_info" value="$(arg use_camera_info)" />
15+
<param name="debug_view" value="$(arg debug_view)" />
16+
<param name="queue_size" value="$(arg queue_size)" />
17+
<param name="tracking_algorithm" value="$(arg tracking_algorithm)" />
18+
</node>
19+
20+
</launch>

nodelet_plugins.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@
127127
<description>Nodelet for histogram equalization</description>
128128
</class>
129129

130+
<class name="opencv_apps/tracking" type="opencv_apps::TrackingNodelet" base_class_type="nodelet::Nodelet">
131+
<description>Nodelet for tracking</description>
132+
</class>
133+
130134
<!--
131135
for backward compatibility, can be removed in M-turtle
132136
-->

0 commit comments

Comments
 (0)