This is the number of neighbors a candidate rectangle should have in order to retain it.įinally, we'll loop through the faces and save the result: Rect facesArray = facesDetected.toArray() Int minFaceSize = Math.round(loadedImage.rows() * 0.1f) ĬascadeClassifier.load("./src/main/resources/haarcascades/haarcascade_frontalface_alt.xml") ĬtectMultiScale(loadedImage,Ībove, the parameter 1.1 denotes the scale factor we want to use, specifying how much the image size is reduced at each image scale. Next, we need to initialize the CascadeClassifier to do the recognition: CascadeClassifier cascadeClassifier = new CascadeClassifier() Then, we'll declare a MatOfRect object to store the faces we find: MatOfRect facesDetected = new MatOfRect() ![]() Mat loadedImage = loadImage(sourceImagePath)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |