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

24
LINES

< > BotCompany Repo | #1019054 // HaarCascade_FaceDetector

JavaX fragment (include) [tags: use-pretranspiled]

Uses 21723K of libraries. Click here for Pure Java version (4234L/24K).

1  
!include once #1010056 // OpenIMAJ
2  
import java.awt.Image;
3  
4  
static LS _stickyLibs_HaarCascade_FaceDetector = ll(#1009014, #1009015, #1009016);
5  
6  
lib 1009014 // processing.face
7  
lib 1009015 // object detection
8  
lib 1009016 // xpp (xmlpull implementation) for the above
9  
10  
import org.openimaj.image.ImageUtilities;
11  
import org.openimaj.image.processing.face.detection.DetectedFace;
12  
import org.openimaj.image.processing.face.detection.HaarCascadeDetector;
13  
14  
sclass HaarCascade_FaceDetector extends F1<BufferedImage, L<RectAndConfidence>> {
15  
  new HaarCascadeDetector detector;
16  
  
17  
  public L<RectAndConfidence> get(BufferedImage img) {
18  
    if (img == null) null;
19  
    ret map(detector.detectFaces(ImageUtilities.createFImage(img)),
20  
      func(DetectedFace f) -> RectAndConfidence {
21  
        RectAndConfidence(openImajRectangleToRect(f.getBounds()), f.getConfidence())
22  
      });
23  
  }
24  
}

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: #1019054
Snippet name: HaarCascade_FaceDetector
Eternal ID of this version: #1019054/9
Text MD5: 60e449cce347fb9f0a803fd7e5942467
Transpilation MD5: edcc9b2f50ed8b4724cabb39983635ab
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-09 18:32:44
Source code size: 891 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 379 / 986
Version history: 8 change(s)
Referenced in: [show references]