I want to remove some indexes from a vector inside a loop.
I currently have the following code:
static void store_faces(Mat image, vector<Rect> faces, string path, string fileName){
SkinDetector mySkinDetector;
int counter = 0;
for(int i = 0; i < faces.size(); i++){
Mat temp = image(faces.at(i));
double ratio= mySkinDetector.getSkin(temp);
cout << "found face skin ratio.. " << ratio << endl;
string file_name = path+ fileName + "_"+ NumberToString(counter)+".jpg";
imwrite(file_name, temp);
counter+=1;
}
}
and I want to delete those faces that have ratio < 0.5
. How is it possible to remove items from the vector<Rect> faces
?