Ask Your Question

moodyman's profile - activity

2016-04-15 11:03:53 -0600 received badge  Enthusiast
2016-04-06 09:58:54 -0600 received badge  Editor (source)
2016-04-06 09:37:46 -0600 asked a question draw another rect after facedetection

Hello,

i am trying to locate the hair area after face detecting, and i thought about drawing a smaller rectangle at a certain position inside the face detection area. Assuming that the hair will always be on top of the face, i have been thinking of drawing a rectangle from the positions given by the face detection, and by modifying them to draw the new one. Now I am quite new to objectiv-C, and I would like some help to draw the rectangle, Here is my code:

#pragma mark - CvVideoCameraDelegate
- (void)processImage:(cv::Mat &)image {
    Mat gray;
    std::vector<cv::Rect> faces;
    Scalar color = Scalar(0, 255, 0);
    cvtColor(image, gray, COLOR_BGR2GRAY);
    _faceDetector.detectMultiScale(gray, faces, 1.1, 2, 0, cv::Size(60, 60));
    for (int i = 0; i < faces.size(); i++) {
        rectangle(image, faces[i], color, 1);
        // I think that i should write here the code for the new rect, so now i've been thinking of that, please correct me if i am wrong
// x, y should move the rectangle to the desired position
    int x = faces[i].x + x/3;
    int y = faces[i].y*0.2 - y/3;
    // h, w should resize the rectangle 
    int h = y+faces[i].height*0.1 ; //the smaller rect should be at least 10 times smaller, in order to get few pixels 
    int w = x+faces[i].width*0.1;

    rectangle(image, Point (x,y),Point (w,h), Scalar(255,0,255), 2, 8, 0);

    }
}


@end

thank you for your time

2016-04-04 08:48:19 -0600 asked a question EM:: OPENCV 2.4.11

Hi,

i'm looking forward a simple tutorial that explains for noobs the Expectation Maximization, and how to implement it, to collect data from a picture for example, or real time camera.

Thank you for your consideration !

I'm using Xcode and OpenCV 2.4.11

2016-04-01 10:57:19 -0600 commented question FACE SEGMENTATION EM:: ALGORITHM C++

since i'm looking forward to find the hair area before confronting it to my needs. should'nt I use another method? such as GrabCut, just to cut out the hair area, in order to get a sample

2016-04-01 09:47:19 -0600 commented question FACE SEGMENTATION EM:: ALGORITHM C++

i'm not sure to get your question, but i'll try to give you as much details as possible, after detecting the face, a rectangle is drawn and expanded so it can include the hair too. My aim is to segment that rectangle (principally to differentiate the hair from the rest, assuming that the hair has a different color from everything else in that rectangle), really sorry if that still doesn't answer

2016-04-01 09:04:54 -0600 commented question FACE SEGMENTATION EM:: ALGORITHM C++

i want to run expectation maximization to segment facial region, from a picture or real time webcam

2016-04-01 08:25:41 -0600 asked a question FACE SEGMENTATION EM:: ALGORITHM C++

Hi everyone,

i've been trying to understand Expectation Maximization Algorithm to get it work into my personal project with no success. I've used Opencv library and documentation to get it work with no success as well. Okay so at this step of my project, i want to segment a facial region after detecting it. I could pass the first steps, it means that i can detect a face, and expand area aspect so i can get the hair and ears too. Well now i'm trying to implement a new program just to segment a picture first, so i can better understand how it works. If anyone could send me an easy .cpp code, that segmentates a given picture from my desktop for example, and tell me what libraries should i include, that would be really great. Don't tell to check on internet, cause i couldn't find any easy sample to understand with my newbie skills(even the one included in opencv, i couldn't get it work). Well i'm using OpenCV2.4.11 and XCode

Thank you for your help, MM