Commit 76daa708d81f8619417c8a4a4aa08eea037ccca4
1 parent
02fd1424
Add a few example algorithms using Stream for video processing
DisplayVideo just shows the frames of a video sequentially, PerFrameDetection does face/eye detection on every frame and displays the results, AgeGenderDemo uses AgeRegressor and GenderClassifier for age/gender detection, and displays the results. These algorithms expect a gallery with the name of one (or more) video sources video sources can be the location of a video (including the address of an ip camera), or the index of a webcam.
Showing
1 changed file
with
5 additions
and
0 deletions
openbr/plugins/algorithms.cpp
| ... | ... | @@ -45,6 +45,11 @@ class AlgorithmsInitializer : public Initializer |
| 45 | 45 | Globals->abbreviations.insert("FaceRecognition2", "{PP5Register+Affine(128,128,0.25,0.35)+Cvt(Gray)}+(Gradient+Bin(0,360,9,true))/(Blur(1)+Gamma(0.2)+DoG(1,2)+ContrastEq(0.1,10)+LBP(1,2,true)+Bin(0,10,10,true))+Merge+Integral+RecursiveIntegralSampler(4,2,8,LDA(.98)+Normalize(L1))+Cat+PCA(768)+Normalize(L1)+Quantize:UCharL1"); |
| 46 | 46 | Globals->abbreviations.insert("CropFace", "Open+Cvt(Gray)+Cascade(FrontalFace)+ASEFEyes+Affine(128,128,0.25,0.35)"); |
| 47 | 47 | |
| 48 | + // Video | |
| 49 | + Globals->abbreviations.insert("DisplayVideo", "Stream([Show(false)+Discard])"); | |
| 50 | + Globals->abbreviations.insert("PerFrameDetection", "Stream([SaveMat(original)+Cvt(Gray)+Cascade(FrontalFace)+ASEFEyes+RestoreMat(original)+Draw(inPlace=true),Show(false)+Discard])"); | |
| 51 | + Globals->abbreviations.insert("AgeGenderDemo", "Stream([SaveMat(original)+Cvt(Gray)+Cascade(FrontalFace)+Expand+<FaceClassificationRegistration>+<FaceClassificationExtraction>+(<AgeRegressor>+Rename(Subject,Age)+Discard)/(<GenderClassifier>+Rename(Subject,Gender)+Discard)+RestoreMat(original)+Draw(inPlace=true)+DrawPropertiesPoint([Age,Gender],Affine_0,inPlace=true)+SaveMat(original)+Discard+Contract,RestoreMat(original)+FPSCalc+Show(false,[AvgFPS,Age,Gender])+Discard])"); | |
| 52 | + | |
| 48 | 53 | // Generic Image Processing |
| 49 | 54 | Globals->abbreviations.insert("SIFT", "Open+KeyPointDetector(SIFT)+KeyPointDescriptor(SIFT):KeyPointMatcher(BruteForce)"); |
| 50 | 55 | Globals->abbreviations.insert("SURF", "Open+KeyPointDetector(SURF)+KeyPointDescriptor(SURF):KeyPointMatcher(BruteForce)"); | ... | ... |