# Histogram Of Gradients

- enum fadasHOGNormMethod

    - Defines the normalization method in the HOG extraction process.

*Values:*

- enumerator FADAS\_HOG\_NORM\_REGULAR

    - Regular normalization method.

- enumerator FADAS\_HOG\_NORM\_RENORMALIZATION

    - Re-normalization.

- enumerator FADAS\_HOG\_NORM\_FHOG

    - F-HOG method.

- enumerator FADAS\_HOG\_NORM\_END

    - Check invalid enum values.

- enumerator FADAS\_HOG\_NORM\_MAX

    - Do not use.

- FadasError\_e FadasHOG\_Init(const char \*licenseKey)

    - Initialize the HOG module. **WARNING:** Must be called once before other FastADAS functions except FadasVersion().

- Parameters:

    - **licenseKey** – Pointer to the license key string.

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- FadasError\_e FadasHOG\_DeInit(void)

    - Deinitialize the HOG module. **WARNING:** Must be called once after all other FastADAS functions except FadasVersion().

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- FadasError\_e FadasHOG\_Create(uint32\_t width, uint32\_t height, uint32\_t cellSize, uint32\_t blockSize, uint32\_t blockStep, uint32\_t binSize, fadasHOGNormMethod normMethod, uint32\_t \*vecLength, void \*\*hogHandle)

    - Create the HOG vector and calculate the length of the output vector for HOG extraction.

- Parameters:

    - - **width** – Input window width.
- **height** – Input window height.
- **cellSize** – The size of one cell in pixels. The typical cell size is four.
- **blockSize** – Block size in pixels; must be a multiple of cellSize. **WARNING:** When the normMethod parameter is FADAS\_HOG\_NORM\_FHOG, the blockStep parameter is by default equal to the cellSize parameter.
- **blockStep** – Block step in pixels when sliding the block over the image. If the blockStep is a multiple of cellSize, faster approach would be taken when normMethod is FADAS\_HOG\_NORM\_REGULAR or FADAS\_HOG\_NORM\_RENORMALIZATION. **WARNING:** When the normMethod parameter is FADAS\_HOG\_NORM\_FHOG, blockStep is by default equal to the cellSize parameter.
- **binSize** – Number of bins in the gradient histogram. Typical binSize is 9.
- **normMethod** – Enum parameter to specify the normalization method for the HOG descriptor construction. See fadasHOGNormMethod() for details.
- **vecLength** – Pointer to the length of the HOG vector in uint32\_t.
- **hogHandle** – Handle to the HOG object.

- FadasError\_e FadasHOG\_Destroy(void \*hogHandle)

    - Function to release HOG resources.

- Parameters:

    - **hogHandle** – Handle to the HOG object.

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- FadasError\_e FadasHOG\_Run(FadasImage\_t \*src, uint16\_t \*\_\_restrict hogVector, uint32\_t hogVectorLen, void \*hogHandle)

    - Extract a histogram of oriented gradients (HOG) descriptor given a grayscale image.

- Parameters:

    - - **src** – Pointer to the input grayscale image object to extract HOG descriptors.
- **hogVector** – Pointer to the output descriptor vector in uint16\_t.
- **hogVectorLen** – Length of the output descriptor vector.
- **hogHandle** – Handle to the HOG object.

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- void \*FadasHOG\_CreateWorkers(uint32\_t nThreads, int32\_t pThreadsAffinity[])

    - Creates a multithreaded worker pool for the HOG feature.

- Parameters:

    - - **nThreads** – Requested number of threads; can be limited to the maximum number of threads if requesting more than that limit. The maximum is the maximum number of physical or logical cores. If requesting 0 threads, use the maximum number.
- **pThreadsAffinity** – Array to set thread affinities.

- Returns:

    - Pointer to a worker pool.

- FadasError\_e FadasHOG\_DestroyWorkers(void \*wrkrs)

    - Destroys HOG worker pool.

- Parameters:

    - **wrkrs** – Worker pool created by FadasHOG\_CreateWorkers().

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- FadasError\_e FadasHOG\_RunMT(void \*wrkrs, FadasImage\_t \*src, uint16\_t \*\_\_restrict hogVector, uint32\_t hogVectorLen, void \*hogHandle)

    - Extract a histogram of oriented gradients (HOG) descriptor given a grayscale image.

- Parameters:

    - - **wrkrs** – Worker pool created by FadasHOG\_CreateWorkers().
- **src** – Pointer to the input grayscale image object to extract HOG descriptors.
- **hogVector** – Pointer to the output descriptor vector in uint16\_t.
- **hogVectorLen** – Length of the output descriptor vector.
- **hogHandle** – Handle to the HOG object.

- Returns:

    - FADAS\_ERROR\_NONE — Success.

Last Published: Sep 30, 2024

Previous Topic
 
Feature Point Tracking Next Topic

Hungarian