# Filtering

- enum FadasFilterPipeline\_e

    - Algorithm pipeline specifying what algorithm pipeline is run by subsequent calls to FadasFilter\_RunMT().

- Param FADAS\_FILTER\_PIPELINE\_CONVOLVE\_Y8\_BY\_3x3\_KERNEL:

    - Filter a Y8 image by convolution using 3x3 kernel.

- Param FADAS\_FILTER\_PIPELINE\_CONVOLVE\_Y8\_BY\_5x5\_KERNEL:

    - Filter a Y8 image by convolution using 5x5 kernel.

*Values:*

- enumerator FADAS\_FILTER\_PIPELINE\_CONVOLVE\_Y8\_BY\_3x3\_KERNEL

    - 

- enumerator FADAS\_FILTER\_PIPELINE\_CONVOLVE\_Y8\_BY\_5x5\_KERNEL

    - 

- enumerator FADAS\_FILTER\_PIPELINE\_END

    - To check invalid enum values.

- enumerator FADAS\_FILTER\_PIPELINE\_CONVOLVE\_MAX

    -

- enum FadasFilterThreshold\_e

    - Algorithm pipeline.

- Param FADAS\_FILTER\_THRESHOLD\_FIXED:

    - Thresholds the input grayscale image based on fixed threshold.

- Param FADAS\_FILTER\_THRESHOLD\_OTSU:

    - Thresholds the input grayscale image based on Otsu threshold.

*Values:*

- enumerator FADAS\_FILTER\_THRESHOLD\_FIXED

    - fixed threshold

- enumerator FADAS\_FILTER\_THRESHOLD\_OTSU

    - Otsu threshold.

- enumerator FADAS\_FILTER\_PIPELINE\_MAX

    - **WARNING:** Do not use.

- typedef struct FadasFilterWorkload FadasFilterWorkload\_t

    - FadasFilterWorkload structure.

- Param kernel:

    - pointer to kernel properties.

- Param FadasPadBuffer\_t:

    - pointer to pad buffers.

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

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

- Parameters:

    - **licenseKey** – License key string.

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- FadasError\_e FadasFilter\_DeInit(void)

    - Deinitialize the Filter feature. **WARNING:** This function must be called once after all other FastADAS functions.

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- void \*FadasFilter\_CreateWorkers(uint32\_t nThreads, int32\_t pThreadsAffinity[], FadasFilterPipeline\_e ePipeline)

    - Creates a multithreaded worker pool for the Image convolution 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.
- **ePipeline** – Execution pipeline to use with this worker pool.

- Returns:

    - Pointer to a worker pool.

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

    - destroys a multithreaded worker pool for the Image convolution feature.

- Parameters:

    - **wrkrs** – Pointer to a worker pool.

- Returns:

    - void

- FadasError\_e FadasFilter\_RunMT(void \*wrkrs, FadasImage\_t \*srcImg, FadasImage\_t \*dstImg, const FadasKernelProps\_t \*const kernel, FadasFilterBorderType\_e borderType, const uint8\_t constantValue)

    - Convolve the given srcImg using kernel and writes the output in dstImg **WARNING:** This function must be called once after all other FastADAS functions.

- Parameters:

    - - **wrkrs** – pointer to worker pool for running the multithreaded version of image filter technique.
- **srcImg** – Input Image
- **dstImg** – Output Image
- **kernel** – Object of kernel struct to be used for convolution
- **borderType** – enum of border type to pad the boundary values of the source image before convolution
- **constantValue** – Constant value in case the boundary padding has to be done with a given constant

- Returns:

    - FADAS\_ERROR\_NONE : SuccessFADAS\_ERROR\_NULL\_PTR : Input/Output pointer is nullptr

- FadasError\_e FadasFilter\_Convolve(const FadasImage\_t \*const srcImg, FadasImage\_t \*dstImg, const FadasKernelProps\_t \*const kernel, FadasFilterBorderType\_e borderType = FADAS\_FILTER\_BORDER\_TYPE\_ZEROS, const uint8\_t constantValue = 0)

    - Convolve the given srcImg using kernel and writes the output in dstImg **WARNING:** This function must be called once after all other FastADAS functions.

- Parameters:

    - - **srcImg** – Input Image
- **dstImg** – Output Image
- **kernel** – Object of kernel struct to be used for convolution
- **borderType** – enum of border type to pad the boundary values of the source image before convolution
- **constantValue** – Constant value in case the boundary padding has to be done with a given constant

- Returns:

    - FADAS\_ERROR\_NONE : SuccessFADAS\_ERROR\_NULL\_PTR : Input/Output pointer is nullptr

- FadasError\_e FadasFilter\_Init\_Calib(const char \*licenseKey)

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

- Parameters:

    - **licenseKey** – License key string.

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- FadasError\_e FadasFilter\_DeInit\_Calib(void)

    - Deinitialize filter module. **WARNING:** Must be called once after all other FastADAS functions.

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- FadasError\_e FadasFilter\_Thresholdu8(const FadasImage\_t \*src, FadasImage\_t \*dst, uint8\_t thresh = 128, FadasFilterThreshold\_e eType = FADAS\_FILTER\_THRESHOLD\_FIXED)

    - Converts grayscale image to binary image.

- Parameters:

    - - **src** – Pointer to the input image object.
- **dst** – Pointer to the output image object.
- **thresh** –

    Fixed threshold value to be used for binarization of the grayscale image.

    NOTE: This value is used only if eType is set to

FADAS\_FILTER\_THRESHOLD\_FIXED
- **eType** – Threshold method.

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- struct FadasFilterWorkload

    - FadasFilterWorkload structure.

- Param kernel:

    - pointer to kernel properties.

- Param FadasPadBuffer\_t:

    - pointer to pad buffers.

Public Members

- const FadasKernelProps \*kernel

    - 

- const FadasPadBuffer\_t \*padBuffer

    -

Last Published: Sep 30, 2024

Previous Topic
 
Fast Fourier Transform Next Topic

Feature Point Extraction