Create Face Mask from Original Image - android

In my case, I have an image which detects a face using face-detection. now I want to try to create a face mask of detected face but I have no idea how to create a face mask of detected faces.so please help me how can I create a face mask of the original image. In face detection, I can use google-vision to detect a face like an oval. I can use this to detect a face.
Thank you in advance.

Related

Detect whole face through MLKit in Android

I am using MLKit for face detection, it is working fine. But there is a use case in which I am getting trouble.
MLKit is too Fast, it can detect half face too.
I want to detect whole face, I want to know whether there is the complete face in the frame or not?
E.g: I apply MLKit' Face Detection on the attached Image, it is returning me all the Landmarks positions, all the contours etc. It is also returning me the smiling probability even there are no lips in the image.
I think you can call face.getBoundingBox() to get the coordinates of the bounding box, and check whether all the corners are in the frame.
I used MediaPipe' Face Mesh solution. Through it, I am getting Face contours, these (36) points are in oval, from 0 to 35.

OpenCV image processing in android

Please check out the image links and can you please suggest the best possible way to detect the ball in the image? I tried edge detection with contours, hough circles and most of the regular ways probably but I get too much background noise.
Can someone please suggest a way to detect the ball in both of the linked images?
https://i.stack.imgur.com/zuLa7.jpg
http://imgur.com/a/nsOSU
Sure.
I have detected the colored object with HSV feature before.
I converted RGB image to HSV image and then detect the object with using the range of hue for the target color.
After threshold with range of hue(inrange), find contour function of OpenCV was used.
In this case, the color detection would be useful rather the shape features.
I have worked such project before, and I have solved this in HSV space.
At first, I converted the image from RGB to HSV.
And then create binary image with threshold function for target color range.
At last, located the position of object(ball) with Hough Circle detect function.
Please check follow, it would be help you, I think:
http://www.pyimagesearch.com/2014/08/04/opencv-python-color-detection/
Thanks.

Crop path within canvas Android

In the below image red color is the canvas. The black color part is the figure I am drawing in my canvas. I want to crop the black color part from my canvas. How shall I do it?.
I tried using canvas.clipPath() but I guess its no longer supported in Android now, due to hardware acceleration. I tried disableing the hardware acceleration also but it dint work so I gave up on canvas.clipPath().
Is there any other way I can use to crop path within canvas?
Any help will be appreciated. Thanks in advance :)

Android: how to add blush on face

I have worked on face detection and use http://www.milbo.users.sonic.net/stasm/ for landmark detection.
I have detected all face landmarks, now i want to add simple red blush on cheek.
I have prepared image for and overlap on cheek, it work with white face but when i use dark face then it show me like jokar, which it not corrrent,so the blushing should be depends on skin color.if there any way to dynamic image as attached.
Can any one let me know how can i do that.
Thank you in advance.
Not a precise answer, but I hope it guides you on the right direction:
Use a Paint with a Shader using Overlay or Multiply to blend the face bitmap with the blush bitmap
Try using cv2.seamlessClone() function, it has pretty good results at embedding pictures after alpha blending. I'm sure it will look much better.

Trapezoid to Rectangle

I am collecting frames from Camera and trying to do some image processing and OCR on them. When the camera is perpendicular to the target, i have no problem with cropping and image processing. But when i try to capture the frame with angle, the target expectedly turns into a Trapezoid rather than rectangle.
I am using OpenCV for all the image processing stuff. I was wondering , what can i do to get the area that i want when its trapezoid?
For example Can i somehow transform that trapezoid image to rectangle with OpenCV?
Thanks
Your problem is called keystone correction:
http://en.wikipedia.org/wiki/Keystone_effect
Look at the similar question:
Executing cv::warpPerspective for a fake deskewing on a set of cv::Point

Categories

Resources