Android: how to add blush on face - android

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.

Related

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.

Detect eye ball

I am developing an app which will change the color of your eye. I need some help about detecting eye ball. Currently i have a selector that will be used to reduce ROI. It look like
this
So who we can detect eye ball from that selected region. I was thinking about changing the image to grayscale and then detect big black spot from that and then change color of it which will be the next step. i'll really appreciate any help.
Your way of thinking about a returning pattern is a good start. I am doing some work on a pattern recognition chair as well, so here is some help for your task:
using a grayscale is a good start btw ;)
There are some "facts" that are always applicable to a non pathologic eye:
the center is dark
left and right side surrounding dark ball are almost white (depends on how open the eye is)
do not forget: you have 2 eyes. link them together in some way (usually they are on an approximately horizontal line)
there is usually motion in the eyes while the other regions of the picture are relatively calm
Of course I cannot provide any code here, this would blast this whole post, but I hope I could help you in some way.
I found some link these guys detecting pupil of the eye. May b this will help you . See here and here
you could use the template matching method from open cv. template matching
this will help you find the eye in most of the cases.
Another solution would be to convert your image into an edge image with e.g. canny edge detector from opencv. and then search for this pattern with the template matcher. Using the edges makes you independent of the color. Using grayscale images will also facilitate the procedure.

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 :)

Implementing Oil Painting effect in android

i am trying to implement some photo effects i try different effect like sketch painting effect, Emboss effect,
and now i m trying to implement Oil Painting Effect.
i found this link
http://supercomputingblog.com/graphics/oil-painting-algorithm/
but at my level this to hard to understand plz help me in this, or any other reference link for it.
Download JHLabs Library for Android from the following link.
https://code.google.com/p/android-jhlabs/
https://code.google.com/p/android-jhlabs/downloads/list
There are the effects given for oil painting, Emboss nad many more.
You can create pencil sketch effect from DoG Filter followed by GrayScale given in the library.
I think oil paintings are simulated best using a technique called "Stroke Based Rendering" (SBR) pioneered by Aaron Hertzmann. It's been around for a long time. Whether you do this in android or any other os doesn't make much of a difference.
What you need is a function that takes a rectangle and an orientation, and place a brush stroke on the current canvas. The brush itself is defined as a set of 2 texture grayscale images: one for the opacity and one for the height. You need one for the height so that you can use create a bump map alongside the canvas (the rendered image). Now, the tough part is to get good texture maps for your brushes so that it looks realistic. That's where you need to experiment quite a bit and see what you like best. Everybody has its own idea of what looks best.
To define the rectangle and its orientation, you can use image moments. The end result is that your brush strokes will kinda follow the contours of objects, which is usually what artists do (not always though).
In any case, this methodology is better explained here (this is link to my blog):
http://3dstereophoto.blogspot.com/2018/07/non-photorealistic-rendering-software.html
You can try the software called "The Painter" which I wrote (free and works on windows 64 bit) to see what can be done using SBR. Maybe it's not what you want at all. Here's the link to the software (also includes toon shading and watercolor rendering):
http://3dstereophoto.blogspot.com/p/painting-software.html
Again, this is a link to my blog which deals primarily with 3d photography. I happen to also like painting a lot.

How to project a picture onto a bubble surface programmatically

I want to implement an effect that, showing a picture on a bubble surface with the picture looks like surrounding the bubble surface. But I don't know how to do this kind of things...
I am doing it in Android platform, should I use OpenGL ES for this ? Or just some 2D transformation can achieve this effect ?
One more question is, I want to create many interesting graphics effects like the PhotoShop's various filter, is there any books/articles I can refer for this kind of things ? Is this kind of work belongs to the "Digital Image Processing" field or some other computer graphics related fields ?
Or just some 2D transformation
This effect is a nonlinear transformation, so doing through the 2D (linear) transformations being available will not work. You can do it using OpenGL by numerous ways. I'm currently thinking about some easy to understand way to convey, what you need to do. Basically you need to implement some kind of refraction or nonlinear radial warp.
Say p is the center of your bubble (in 2D), and r the position relative to p, then the undistorted picture is given by r+p. Now you want to distort it toward the edges. A parabolic distortion comes to mid, i.e. instead of r+p you'd show the pixel r + (|p|^2)*p/|p|

Categories

Resources