Face detection based on Boost method (5): Detecting faces in a single image

Source: Internet
Author: User
Tags scalar



for (rate = 2; rate <= 7; + + + 1)//for each window {len = baselen*rate;//detection of the Face's edge length (default square) [50, 75, 100, 125,
			175] cout << "Current Window len is:" << len << Endl;
			Step = LEN/2;  for (x = 0; x < image->width-len; x + = Step)//for each x {for (y = 0; y < image->height-len; y + +
					Step)//for each y {int faceflag = 1;
						for (j = 0; J < Strclfinfolist.size (); j + +)//for each str clf {strclfinfo = strclfinfolist[j]; result = MYFD (x, y, Len, Len, Sumpixel, Strclfinfo, featurelist);
							(int x, int y, int w, int h) if (result = = 0)//one Str CLF say this isn't a face, then regect this image { cout << "x=" << x << "; y= "<< y <<";
							Len= "<< len <<" ==> not a Face "<< Endl;
							Faceflag = 0;
						Break }} if (Faceflag = = 1)//all Str CLF say this was a face and then draw {//draw window on the IMG Point Center (x + len*0.5, y + len*0.5);
						Ellipse (IMG, center, Size (len*0.5, len*0.5), 0, 0,, Scalar (255, 0, 255), 4, 8, 0);
						Rectangle (IMG, point (x, y), point (x + len, y + len), Scalar (0, 255, 255));
						Imshow ("Facedection", IMG);
					Waitkey (0); }
				}
			}

		}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.