OpenCV image processing in android - 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.

Related

Photoshop Vibrance effect in OpenCV

I want to implement Photoshop Vibrance effect in OpenCV C++, can anyone tell me a mathematical formula for implementing the exact effect for a value of vibrance given by the user.
have a look at the following link.
http://www.photo-mark.com/notes/2009/jan/19/analyzing-photoshop-vibrance-and-saturation/
it seems for me that the vibrance effect controls the saturation channel on HSB or HSV colormodel with gamma adjustment.

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.

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.

What algorithm can i use to refine image selection mask?

I need an algorithm to be able to contrast detect edges in a photo.
Users will roughly paint the mask over an object in an image with their fingers on android phone and then i want to refine the selection mask with the code that detects the edges and adjusts the mask to the edges.
please read about hough transform also canny and you can decide which are better/
this not an easy thing to do.
i would suggest you try to understand how do they work with matlab first this is very C-like language.
http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.html

Red eye removal android

I want to implement red eye removal application on android. Is there any api or built in android method to do this? If no then please tell me how can we detect eyes from image? I know how to remove red color but Im having difficulty in detecting eyes from image.
Use the OpenCV to detect the eyes and then in the circular region where you expect the pupils to be, take the pixel value and set the Red value to, say, 20% of its original value while leaving the Green and Blue channels untouched.
There is also the FaceDetector.findFaces() which works for Bitmaps. However, it will just give you a Rectangle of the Face. But it should be easier to search in that rectangle for red-saturated pixels and desaturate the color as Alexander suggested. But this way you don't necessarly need another library.

Categories

Resources