pub fn load_training_data(
filename: &str,
images: &mut Vector<String>,
face_points: &mut impl ToOutputArray,
delim: char,
offset: f32,
) -> Result<bool>Expand description
A utility to load facial landmark dataset from a single file.
§Parameters
- filename: The filename of a file that contains the dataset information. Each line contains the filename of an image followed by pairs of x and y values of facial landmarks points separated by a space. Example
/home/user/ibug/image_003_1.jpg 336.820955 240.864510 334.238298 260.922709 335.266918 ...
/home/user/ibug/image_005_1.jpg 376.158428 230.845712 376.736984 254.924635 383.265403 ...- images: A vector where each element represent the filename of image in the dataset. Images are not loaded by default to save the memory.
- facePoints: The loaded landmark points for all training data.
- delim: Delimiter between each element, the default value is a whitespace.
- offset: An offset value to adjust the loaded points.
Example of usage
cv::String imageFiles = "../data/images_train.txt";
cv::String ptsFiles = "../data/points_train.txt";
std::vector<String> images;
std::vector<std::vector<Point2f> > facePoints;
loadTrainingData(imageFiles, ptsFiles, images, facePoints, 0.0f);§C++ default parameters
- delim: ’ ’
- offset: 0.0f