[][src]Function opencv::face::load_training_data_1

pub fn load_training_data_1(
    image_list: &str,
    ground_truth: &str,
    images: &mut Vector<String>,
    face_points: &mut dyn ToOutputArray,
    offset: f32
) -> Result<bool>

A utility to load facial landmark information from the dataset.

Parameters

  • imageList: A file contains the list of image filenames in the training dataset.
  • groundTruth: A file contains the list of filenames where the landmarks points information are stored. The content in each file should follow the standard format (see face::loadFacePoints).
  • 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.
  • 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);

example of content in the images_train.txt

/home/user/ibug/image_003_1.jpg
/home/user/ibug/image_004_1.jpg
/home/user/ibug/image_005_1.jpg
/home/user/ibug/image_006.jpg

example of content in the points_train.txt

/home/user/ibug/image_003_1.pts
/home/user/ibug/image_004_1.pts
/home/user/ibug/image_005_1.pts
/home/user/ibug/image_006.pts

C++ default parameters

  • offset: 0.0f