Lens AI Profiler Cpp
Public Member Functions | List of all members
ImageProfile Class Reference

A class for analyzing and storing image statistics. More...

#include <imageprofile.h>

Public Member Functions

 ~ImageProfile ()
 Destructor to clean up resources.
 
 ImageProfile (const std::string &conf_path, int save_interval, int channels=1)
 Constructs an ImageProfile object with the specified image characteristics. More...
 
int profile (cv::Mat &img, bool save_sample=false)
 Logs image statistics for the provided image data. More...
 

Detailed Description

A class for analyzing and storing image statistics.

Class for computing and managing various image statistics.

This class provides functionalities for analyzing image properties like distribution of pixel values, contrast, brightness, etc. It utilizes KLL sketches for memory-efficient storage of these statistics.

Constructor & Destructor Documentation

◆ ImageProfile()

ImageProfile::ImageProfile ( const std::string &  conf_path,
int  save_interval,
int  channels = 1 
)

Constructs an ImageProfile object with the specified image characteristics.

Constructor to initialize ImageProfile object.

Parameters
channelsThe number of channels in the image (e.g., grayscale: 1, RGB: 3).
img_typeThe image type (implementation specific).
metricsThe set of image metrics to be tracked (e.g., "contrast", "brightness").

Constructor to initialize ImageProfile object

Parameters
conf_pathPath to configuration file
save_intervalInterval for saving statistics
channelsNumber of image channels (default: 1)
conf_pathPath to configuration file
save_intervalInterval for saving statistics
channelsNumber of image channels (default: 1)

Member Function Documentation

◆ profile()

int ImageProfile::profile ( cv::Mat &  img,
bool  save_sample = false 
)

Logs image statistics for the provided image data.

Computes and logs selected image statistics.

This function analyzes the provided image data and updates the internal KLL sketches with relevant statistics.

Parameters
imgThe image data as a vector of bytes.
image_widthThe width of the image in pixels.
image_heightThe height of the image in pixels.
imgpixels_statA map to store per-channel statistics (implementation specific).
imgprofile_mapA map to store various image profile metrics (e.g., "contrast").

Computes and logs selected image statistics

Parameters
imgOpenCV image matrix
save_sampleFlag indicating whether to save samples exceeding thresholds
Returns
1 on success, error code on failure
Parameters
imgOpenCV image matrix
save_sampleFlag indicating whether to save samples exceeding thresholds
Returns
1 on success, error code on failure

The documentation for this class was generated from the following files: