Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Recognition {
- private static final String TAG = "Recoc";
- public Recognition() {
- }
- public Bitmap recognize(Bitmap bmp) {
- Log.v(TAG,"enter");
- org.opencv.core.Mat image = new org.opencv.core.Mat();
- Utils.bitmapToMat(bmp,image);
- CascadeClassifier lower_body_cascade = new CascadeClassifier("resources/haarcascades/haarcascade_lowerbody.xml");
- MatOfRect legs = new MatOfRect();
- // Find the faces in “image”:
- lower_body_cascade.detectMultiScale(image, legs);
- for (int i = 0; i < legs.width(); i++) {
- Rect leg_i = legs.;
- rectangle(image, leg_i, new Scalar(0, 255, 0, 1));
- }
- return bmp;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement