Ask Your Question
0

Face image evaluation

asked 2015-10-28 03:49:38 -0500

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?

edit retag flag offensive close merge delete

Comments

2

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

sturkmen gravatar imagesturkmen ( 2015-10-28 03:58:35 -0500 )edit
1

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

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-10-28 07:43:38 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-10-29 02:02:05 -0500

Aj-611 gravatar image

updated 2015-10-29 06:35:02 -0500

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
}
edit flag offensive delete link more

Comments

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

sturkmen gravatar imagesturkmen ( 2015-10-29 02:47:52 -0500 )edit

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

Aj-611 gravatar imageAj-611 ( 2015-10-29 03:47:09 -0500 )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 ( 2015-10-29 05:06:43 -0500 )edit

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

sturkmen gravatar imagesturkmen ( 2015-10-29 05:11:27 -0500 )edit

thank you.

sturkmen gravatar imagesturkmen ( 2015-10-29 06:44:17 -0500 )edit

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

sturkmen gravatar imagesturkmen ( 2015-10-29 08:25:01 -0500 )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 ( 2015-10-29 15:32:34 -0500 )edit

no problem. just curiosity.

sturkmen gravatar imagesturkmen ( 2015-10-29 16:17:39 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-10-28 03:49:38 -0500

Seen: 284 times

Last updated: Oct 29 '15