First time here? Check out the FAQ!

Ask Your Question
0

Face image evaluation

asked Oct 28 '15

Aj-9011 gravatar image

I am doing Near Infrared image face detection (video based). But I want to save the detected image with a good quality only; here I think I will focus on sharpness and illumination of the detected face. Any idea on how to this with OpenCV?

Preview: (hide)

Comments

2

take a look at http://answers.opencv.org/question/5395 to measure sharpness of the image.

sturkmen gravatar imagesturkmen (Oct 28 '15)edit
1

Be carefull to use the C++ API, C-API is deprecated and may not work

thdrksdfthmn gravatar imagethdrksdfthmn (Oct 28 '15)edit

1 answer

Sort by » oldest newest most voted
1

answered Oct 29 '15

Aj-611 gravatar image

updated Oct 29 '15

This work for me in C++. The one that I learnt from http://answers.opencv.org/question/5395

 double contrast_measure(const Mat&img)
{
    Mat dx, dy;
    Sobel(img, dx, CV_32F, 1, 0, 3);
    Sobel(img, dy, CV_32F, 0, 1, 3);
    magnitude(dx, dy, dx);
    return sum(dx)[0];
}

int main(int argc, const char** argv)
{
//my coding

std::cout << "contrast=" << contrast_measure(face) / 1e3 << std::endl; //face is my image name

//my coding
}
Preview: (hide)

Comments

cont_meas ?? please take a look at CodingStyleGuide about function names.

sturkmen gravatar imagesturkmen (Oct 29 '15)edit

@sturkmen It's a variable, is it? So I can put any name right?

Aj-611 gravatar imageAj-611 (Oct 29 '15)edit

of cource you can put any name on your own code. but IMHO when we share a code we must follow some rules.

sturkmen gravatar imagesturkmen (Oct 29 '15)edit

also Mat contrast = cont_meas(face) / 1e3; ??

sturkmen gravatar imagesturkmen (Oct 29 '15)edit

thank you.

sturkmen gravatar imagesturkmen (Oct 29 '15)edit

is @Aj-9011 and @Aj-611 one user?

sturkmen gravatar imagesturkmen (Oct 29 '15)edit

@sturkmen sorry. I'll learn from mistake. Thank you sir. Actually I can log in to this account before. So I create another account. But today suddenly I can access to this account. Going to use this account anywhere.

Aj-611 gravatar imageAj-611 (Oct 29 '15)edit

no problem. just curiosity.

sturkmen gravatar imagesturkmen (Oct 29 '15)edit

Question Tools

1 follower

Stats

Asked: Oct 28 '15

Seen: 636 times

Last updated: Oct 29 '15