40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
#pragma once
|
|
#include "data.hpp"
|
|
|
|
/**
|
|
* @brief Transform the input images in integrated images.
|
|
*
|
|
* @param X Dataset of images
|
|
* @return Dataset of integrated images
|
|
*/
|
|
np::Array<uint32_t> set_integral_image(const np::Array<uint8_t>&) noexcept;
|
|
|
|
/**
|
|
* @brief Apply the features on a integrated image dataset.
|
|
*
|
|
* @param feats Features to apply
|
|
* @param X_ii Integrated image dataset
|
|
* @return Applied features
|
|
*/
|
|
np::Array<int32_t> apply_features(const np::Array<uint8_t>&, const np::Array<uint32_t>&) noexcept;
|
|
|
|
/**
|
|
* @brief Train the weak classifiers on a given dataset.
|
|
*
|
|
* @param X_feat Feature images dataset
|
|
* @param X_feat_argsort Sorted indexes of the integrated features
|
|
* @param y Labels of the features
|
|
* @param weights Weights of the features
|
|
* @return Trained weak classifiers
|
|
*/
|
|
np::Array<float64_t> train_weak_clf(const np::Array<int32_t>&, const np::Array<uint16_t>&, const np::Array<uint8_t>&,
|
|
const np::Array<float64_t>&) noexcept;
|
|
|
|
/**
|
|
* @brief Perform an indirect sort on each column of a given 2D array
|
|
*
|
|
* @param a 2D Array to sort
|
|
* @return 2D Array of indices that sort the array
|
|
*/
|
|
np::Array<uint16_t> argsort_2d(const np::Array<int32_t>&) noexcept;
|