Aircraft Detection 1.0
|
#include <opencv2/opencv.hpp>
#include <string>
#include <vector>
Go to the source code of this file.
Functions | |
std::vector< std::vector< float > > | hog_features_extraction (const std::vector< cv::Rect > &rois, const cv::Mat &image) |
Extracts HOG features from specified regions of interest (ROIs) in an image. | |
void | writeHogFeaturesToCsv (const std::vector< std::vector< float > > &hog_features, const std::string &filename) |
Writes HOG features to a CSV file. | |
std::vector< std::vector< float > > hog_features_extraction | ( | const std::vector< cv::Rect > & | rois, |
const cv::Mat & | image ) |
Extracts HOG features from specified regions of interest (ROIs) in an image.
This function takes a vector of regions of interest (ROIs) and an image, extracts each ROI from the image, resizes it to 64x64, and computes the HOG (Histogram of Oriented Gradients) descriptors for each resized ROI. The HOG features are then returned in a vector of vectors, where each inner vector corresponds to the HOG descriptors of a single ROI.
[in] | rois | A vector of cv::Rect defining the regions of interest in the image. |
[in] | image | The input image from which the ROIs are extracted. |
void writeHogFeaturesToCsv | ( | const std::vector< std::vector< float > > & | hog_features, |
const std::string & | filename ) |
Writes HOG features to a CSV file.
This function takes a vector of HOG feature vectors and writes them to a specified CSV file. Each row in the CSV file corresponds to one HOG feature vector, and each value in the vector is written with a fixed precision of 6 decimal places.
[in] | hog_features | A vector of HOG feature vectors to be written to the CSV file. |
[in] | filename | The name of the CSV file to write the HOG features to. |
openFile
function, which is assumed to return a file stream. The features are written in a consistent format with a fixed precision to ensure proper formatting regardless of locale settings.