Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1.  
  2. public class Recognition {
  3.  
  4. private static final String TAG = "Recoc";
  5.  
  6. public Recognition() {
  7. }
  8.  
  9. public Bitmap recognize(Bitmap bmp) {
  10. Log.v(TAG,"enter");
  11.  
  12. org.opencv.core.Mat image = new org.opencv.core.Mat();
  13.  
  14. Utils.bitmapToMat(bmp,image);
  15.  
  16. CascadeClassifier lower_body_cascade = new CascadeClassifier("resources/haarcascades/haarcascade_lowerbody.xml");
  17.  
  18. MatOfRect legs = new MatOfRect();
  19. // Find the faces in “image”:
  20. lower_body_cascade.detectMultiScale(image, legs);
  21.  
  22. for (int i = 0; i < legs.width(); i++) {
  23. Rect leg_i = legs.;
  24. rectangle(image, leg_i, new Scalar(0, 255, 0, 1));
  25. }
  26.  
  27. return bmp;
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement