Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

32
LINES

< > BotCompany Repo | #1019063 // Test HaarCascade_FaceDetector (new version of OpenIMAJ)

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 1501K of libraries. Click here for Pure Java version (14827L/102K).

1  
!7
2  
3  
static LS _stickyLibs_HaarCascade_FaceDetector = ll(#1400137, #1400138, #1400139, #1009016, #1004908, #1003727);
4  
5  
lib 1400137 // OpenIMAJ
6  
lib 1400138 // OpenIMAJ-image-faces
7  
lib 1400139 // OpenIMAJ-image-objectdetection
8  
lib 1009016 // xpp (xmlpull implementation) for the above
9  
lib 1004908 // sanselan
10  
lib 1003727 // commons-lang
11  
12  
import org.openimaj.image.ImageUtilities;
13  
import org.openimaj.image.processing.face.detection.DetectedFace;
14  
import org.openimaj.image.processing.face.detection.HaarCascadeDetector;
15  
16  
sclass HaarCascade_FaceDetector extends F1<BufferedImage, L<RectAndConfidence>> {
17  
  new HaarCascadeDetector detector;
18  
  
19  
  public L<RectAndConfidence> get(BufferedImage img) {
20  
    if (img == null) null;
21  
    ret map(detector.detectFaces(ImageUtilities.createFImage(img)),
22  
      func(DetectedFace f) -> RectAndConfidence {
23  
        RectAndConfidence(openImajRectangleToRect(f.getBounds()), f.getConfidence())
24  
      });
25  
  }
26  
}
27  
28  
module HCFD > DynSingleFunctionWithPrintLog {
29  
  void doIt {
30  
    pnl(new HaarCascade_FaceDetector().get(loadImage2(#1101409)));
31  
  }
32  
}

Author comment

Began life as a copy of #1019055

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019063
Snippet name: Test HaarCascade_FaceDetector (new version of OpenIMAJ)
Eternal ID of this version: #1019063/9
Text MD5: f7b8c6b3356970fef012713a65a7dd4d
Transpilation MD5: 9166f14482232f75849285a796cd993e
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-21 23:36:56
Source code size: 1103 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 265 / 444
Version history: 8 change(s)
Referenced in: [show references]