-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a Face_Tracking node. This node now includes Optical flow to tr…
…ack faces after they have been detected. Both Face_Tracking and Face_Detection now publish the coordinates of the faces. The example node Face_Listener shows how to read the data the other nodes.
- Loading branch information
Showing
11 changed files
with
7,445 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/usr/bin/env python | ||
PACKAGE = "face_detection" | ||
|
||
from dynamic_reconfigure.parameter_generator_catkin import * | ||
|
||
|
||
gen = ParameterGenerator() | ||
gen.add("imageInput", str_t, 0, | ||
"Subscribe to this image topic", | ||
"/camera/image_raw") | ||
gen.add("imageOutput", str_t, 0, | ||
"Publish to this image topic", | ||
"/facerec/image_raw") | ||
gen.add("skipFrames", int_t, 0, | ||
"Skip frames that are used for detection", | ||
1, 1, 20) | ||
|
||
|
||
imgScale_enum = gen.enum([ gen.const("No_Resize", double_t, 1, ""), | ||
gen.const("Resize_by_0_875", double_t, 0.875, ""), | ||
gen.const("Resize_by_0_75", double_t, 0.75, ""), | ||
gen.const("Resize_by_0_625", double_t, 0.625, ""), | ||
gen.const("Resize_by_0_5", double_t, 0.5, ""), | ||
gen.const("Resize_by_0_375", double_t, 0.375, ""), | ||
gen.const("Resize_by_0_25", double_t, 0.25, ""), | ||
gen.const("Resize_by_0_125", double_t, 0.125, "")], | ||
"The detection image will be resized by this value. (great performance increase).") | ||
gen.add("imgScale", double_t, 0, "Select a scaling factor for the detection image", 1, edit_method=imgScale_enum) | ||
|
||
|
||
gen.add("neighborsValue", int_t, 0, | ||
"The number of neiboring detections required for a sucessfull detection", | ||
2, 0, 8) | ||
gen.add("scaleValue", double_t, 0, | ||
"Multiplicator for each step of the detection", | ||
1.2, 1.01, 1.50) | ||
gen.add("minSize", int_t, 0, | ||
"Minimum size for the search window.", | ||
13, 1, 100) | ||
gen.add("maxSize", int_t, 0, | ||
"Maximum size for the search window.", | ||
250, 5, 1024) | ||
|
||
cascade_enum = gen.enum([ gen.const("haarcascade_frontalface_alt", int_t, 0, ""), | ||
gen.const("haarcascade_frontalface_alt2", int_t, 1, ""), | ||
gen.const("haarcascade_frontalface_alt_tree", int_t, 2, ""), | ||
gen.const("haarcascade_frontalface_default", int_t, 3, "")], | ||
"An enum to set size") | ||
gen.add("cascadeValue", int_t, 0, "Select a Cascade", 2, edit_method=cascade_enum) | ||
|
||
myflag_enum = gen.enum([ gen.const("Scale", int_t, 0, "Standart type"), | ||
gen.const("Biggest", int_t, 1, "Only returns the biggest detection"), | ||
gen.const("Canny", int_t, 2, "Reduces Canny pruning to reduce the number of false detections"), | ||
gen.const("Rough", int_t, 3, "Rought Detection Search")], | ||
"An enum to set size") | ||
gen.add("myflag", int_t, 0, "Select a type of detection", 2, edit_method=myflag_enum) | ||
|
||
|
||
debug_enum = gen.enum([ gen.const("No_Debugging", int_t, 0, ""), | ||
gen.const("Displays_Image", int_t, 1, ""), | ||
gen.const("Displays_Detection_Image", int_t, 2, "")], | ||
"An enum to set debugging") | ||
gen.add("debug", int_t, 0, "Select type of debugging", 1, edit_method=debug_enum) | ||
|
||
pixelSwitch_enum = gen.enum([ gen.const("Detection_Boxes", int_t, 0, "Draws Detection Boxes"), | ||
gen.const("Pixelise", int_t, 1, "Pixelises the detected Faces")], | ||
"An enum to set pixelSwitch") | ||
gen.add("pixelSwitch", int_t, 1, "Select a detection display type", 0, edit_method=pixelSwitch_enum) | ||
|
||
|
||
|
||
gen.add("contrastFactor", double_t, 0, | ||
"The contrast factor applied to the image to improve detection", | ||
1.5, 0.2, 2.5) | ||
gen.add("histOnOff", int_t, 0, | ||
"Activates histogram equalisation", | ||
0, 0, 1) | ||
gen.add("blurFactor", int_t, 0, | ||
"blurs the image a little, used to reduce noise on full resolution images (imageScaleValue = 1)", | ||
0, 0, 10) | ||
gen.add("brightnessFactor", int_t, 0, | ||
"brightens up the image", | ||
0, 0, 5) | ||
gen.add("inputSkipp", int_t, 0, | ||
"start skipping frames from the input after X frames, generally use '1' for realtime feedback, or much higher values for saving image sequences to disk", | ||
1, 1, 10000) | ||
|
||
|
||
exit(gen.generate(PACKAGE, "face_detection", "face_det")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#!/usr/bin/env python | ||
PACKAGE = "face_detection" | ||
|
||
from dynamic_reconfigure.parameter_generator_catkin import * | ||
|
||
|
||
gen = ParameterGenerator() | ||
gen.add("imageInput", str_t, 0, | ||
"Subscribe to this image topic", | ||
"/ardrone/image_raw") | ||
gen.add("imageOutput", str_t, 0, | ||
"Publish to this image topic", | ||
"/facerec/image_raw") | ||
gen.add("skipFrames", int_t, 0, | ||
"Skip frames that are used for detection", | ||
1, 1, 20) | ||
|
||
imgScale_enum = gen.enum([ gen.const("No_Resize", double_t, 1, ""), | ||
gen.const("Resize_by_0_875", double_t, 0.875, ""), | ||
gen.const("Resize_by_0_75", double_t, 0.75, ""), | ||
gen.const("Resize_by_0_625", double_t, 0.625, ""), | ||
gen.const("Resize_by_0_5", double_t, 0.5, ""), | ||
gen.const("Resize_by_0_375", double_t, 0.375, ""), | ||
gen.const("Resize_by_0_25", double_t, 0.25, ""), | ||
gen.const("Resize_by_0_125", double_t, 0.125, "")], | ||
"The detection image will be resized by this value. (great performance increase).") | ||
gen.add("imgScale", double_t, 0, "Select a scaling factor for the detection image", 0.625, edit_method=imgScale_enum) | ||
|
||
|
||
gen.add("neighborsValue", int_t, 0, | ||
"The number of neiboring detections required for a sucessfull detection", | ||
2, 0, 8) | ||
gen.add("scaleValue", double_t, 0, | ||
"Multiplicator for each step of the detection", | ||
1.2, 1.01, 1.50) | ||
gen.add("minSize", int_t, 0, | ||
"Minimum size for the search window.", | ||
13, 1, 100) | ||
gen.add("maxSize", int_t, 0, | ||
"Maximum size for the search window.", | ||
250, 5, 1024) | ||
|
||
cascade_enum = gen.enum([ gen.const("haarcascade_frontalface_alt", int_t, 0, ""), | ||
gen.const("haarcascade_frontalface_alt2", int_t, 1, ""), | ||
gen.const("haarcascade_frontalface_alt_tree", int_t, 2, ""), | ||
gen.const("haarcascade_frontalface_default", int_t, 3, "")], | ||
"An enum to set size") | ||
gen.add("cascadeValue", int_t, 0, "Select a Cascade", 2, edit_method=cascade_enum) | ||
|
||
myflag_enum = gen.enum([ gen.const("Scale", int_t, 0, "Standart type"), | ||
gen.const("Biggest", int_t, 1, "Only returns the biggest detection"), | ||
gen.const("Canny", int_t, 2, "Reduces Canny pruning to reduce the number of false detections"), | ||
gen.const("Rough", int_t, 3, "Rought Detection Search")], | ||
"An enum to set size") | ||
gen.add("myflag", int_t, 0, "Select a type of detection", 2, edit_method=myflag_enum) | ||
|
||
|
||
debug_enum = gen.enum([ gen.const("No_Debugging", int_t, 0, ""), | ||
gen.const("Displays_Image", int_t, 1, ""), | ||
gen.const("Displays_Detection_Image", int_t, 2, ""), | ||
gen.const("Displays_Image_noPublishing", int_t, 3, "")], | ||
"An enum to set debugging") | ||
gen.add("debug", int_t, 0, "Select type of debugging", 1, edit_method=debug_enum) | ||
|
||
pixelSwitch_enum = gen.enum([ gen.const("Detection_Boxes", int_t, 0, "Draws Detection Boxes"), | ||
gen.const("Pixelise", int_t, 1, "Pixelises the detected Faces")], | ||
"An enum to set pixelSwitch") | ||
gen.add("pixelSwitch", int_t, 1, "Select a detection display type", 0, edit_method=pixelSwitch_enum) | ||
|
||
|
||
gen.add("contrastFactor", double_t, 0, | ||
"The contrast factor applied to the image to improve detection", | ||
1.5, 0.2, 2.5) | ||
|
||
histOnOff_enum = gen.enum([ gen.const("Histogram_Equalisation_OFF", int_t, 0, ""), | ||
gen.const("Histogram_Equalisation_ON", int_t, 1, "")], | ||
"An enum to set pixelSwitch") | ||
gen.add("histOnOff", int_t, 1, "Select a detection display type", 0, edit_method=histOnOff_enum) | ||
|
||
|
||
|
||
gen.add("blurFactor", int_t, 0, | ||
"blurs the image a little, used to reduce noise on full resolution images (imageScaleValue = 1)", | ||
0, 0, 10) | ||
gen.add("brightnessFactor", int_t, 0, | ||
"brightens up the image", | ||
0, 0, 5) | ||
gen.add("inputSkipp", int_t, 0, | ||
"start skipping frames from the input after X frames, generally use '1' for realtime feedback, or much higher values for saving image sequences to disk", | ||
1, 1, 10000) | ||
|
||
|
||
|
||
gen.add("maxNumFeatures", int_t, 0, | ||
"Number of features used to track each face", | ||
15, 1, 100) | ||
|
||
gen.add("maxTrackingNum", int_t, 0, | ||
"Number of times a face is tracked after being detected again", | ||
60, 1, 200) | ||
|
||
gen.add("initialDetectionNum", int_t, 0, | ||
"Number of times a face is tracked after the first detection", | ||
4, 1, 10) | ||
|
||
gen.add("trackSearchWinSize", int_t, 0, | ||
"Number of times a face is tracked after the first detection", | ||
30, 5, 200) | ||
|
||
# needs file name and config name | ||
exit(gen.generate(PACKAGE, "face_tracking", "face_track")) |
Oops, something went wrong.