#ifndef FASTCV_H #define FASTCV_H /**============================================================================= @file fastcv.h @brief Public API Copyright (c) 2011-2013 Qualcomm Technologies Incorporated. All Rights Reserved Qualcomm Technologies Proprietary Export of this technology or software is regulated by the U.S. Government. Diversion contrary to U.S. law prohibited. All ideas, data and information contained in or disclosed by this document are confidential and proprietary information of Qualcomm Technologies Incorporated and all rights therein are expressly reserved. By accepting this material the recipient agrees that this material and the information contained therein are held in confidence and in trust and will not be used, copied, reproduced in whole or in part, nor its contents revealed in any manner to others without the express written permission of Qualcomm Technologies Incorporated. =============================================================================**/ /**============================================================================= @mainpage FastCV Public API Documentation @version 1.2.2 @section Overview Overview FastCV provides two main features to computer vision application developers: - First, it provides a library of frequently used computer vision (CV) functions, optimized to run efficiently on mobile devices. - Second, it provides a clean processor-agnostic hardware acceleration API, under which chipset vendors can hardware accelerate FastCV functions on their hardware. This initial release (FastCV 1.0) only supports Android mobile developers; however, we intend to support iOS and Windows devices as soon as possible. FastCV 1.0 is available for download for free from developer.qualcomm.com. FastCV 1.0 is released as a unified binary, a single binary containing two implementations of the library. - The first implementation runs on ARM processor, and is referred to as the "FastCV for ARM." - The second implementation runs only on Qualcomm Snapdragon chipsets, and is called "FastCV for Snapdragon." Releases are generally motivated for the following reasons: - Changes to previously released APIs - Addition of new functions - Performance improvements and/or bug fixes - also known as implementation modifications Each motivation has a varying degree of impact on the user of the library. The general release numbering scheme captures this variety of motivations. Given release ID: A.B.C An increase in "A" indicates that a previously released API has changed, so a developer may encounter compilation issues which require modification of their code in order to adhear to the modified API. Qualcomm will make every effort to minimize these changes. Additionally, new functions and implementation modifications may be present. An increase in "B" indicates that new functions have been added to the library, so additional functionality is available, however existing APIs have not changed. Additionally, implementation modifications may be present. An increase in "C" indicates that implementation modifications only have been made. @defgroup math_vector Math / Vector Operations @details Commonly used vector & math functions @defgroup image_processing Image processing @details Image filtering, convolution and scaling operations @defgroup image_transform Image transformation @details Warp perspective, affine transformations @defgroup feature_detection Feature detection @details Fast corner detection, harris corner detection, canny edge detection, etc. @defgroup object_detection Object detection @details Object detection functions such as NCC template match, etc. @defgroup 3D_reconstruction 3D reconstruction @details Homography, pose evaluation functions @defgroup color_conversion Color conversion @details Commonly used formats supported: e.g., YUV, RGB, YCrCb, etc. @defgroup clustering_and_search Clustering and search @details K clusters best fitting of a set of input points @defgroup Motion_and_Object_Tracking Motion and object tracking @details Supports and tracking functions @defgroup Structural_Analysis_and_Drawing Shape and drawing @details Contour and polygon drawing functions @defgroup mem_management Memory Management @details Functions to allocate and deallocate memory for use with fastCV. @defgroup misc Miscellaneous @details Support functions **/ //============================================================================== // Defines //============================================================================== #define FASTCV_VERSION 122 #ifdef __GNUC__ /// Macro to align memory at 4-bytes (32-bits) for GNU-based compilers. #define FASTCV_ALIGN32( VAR ) (VAR) __attribute__ ((aligned(4))) /// Macro to align memory at 8-bytes (64-bits) for GNU-based compilers. #define FASTCV_ALIGN64( VAR ) (VAR) __attribute__ ((aligned(8))) /// Macro to align memory at 16-bytes (128-bits) for GNU-based compilers. #define FASTCV_ALIGN128( VAR ) (VAR) __attribute__ ((aligned(16))) #ifdef BUILDING_SO /// MACRO enables function to be visible in shared-library case. #define FASTCV_API __attribute__ ((visibility ("default"))) #else /// MACRO empty for non-shared-library case. #define FASTCV_API #endif #else /// Macro to align memory at 4-bytes (32-bits) for MSVC compiler. #define FASTCV_ALIGN32( VAR ) __declspec(align(4)) (VAR) /// Macro to align memory at 8-bytes (64-bits) for MSVC compiler. #define FASTCV_ALIGN64( VAR ) __declspec(align(8)) (VAR) /// Macro to align memory at 16-bytes (128-bits) for MSVC compiler. #define FASTCV_ALIGN128( VAR ) __declspec(align(16)) (VAR) #ifdef BUILDING_DLL /// MACRO enables function to be visible in shared-library case. #define FASTCV_API __declspec(dllexport) #else /// MACRO empty for non-shared-library case. #define FASTCV_API #endif #endif //============================================================================== // Included modules //============================================================================== #include #ifndef FASTCV_STDINT #define FASTCV_STDINT #ifdef _MSC_VER #if _MSC_VER <= 1500 // stdint.h support for VS2008 and older #include "stdint_.h" #else #include #endif typedef float float32_t; typedef double float64_t; #else #ifdef __ARM_NEON__ #include #else #include typedef float float32_t; typedef double float64_t; #endif #endif #endif //============================================================================== // Declarations //============================================================================== //------------------------------------------------------------------------------ /// @brief /// Defines operational mode of interface to allow the end developer to /// dictate how the target optimized implementation should behave. //------------------------------------------------------------------------------ typedef enum { /// Target-optimized implementation uses lowest power consuming /// implementation. FASTCV_OP_LOW_POWER = 0, /// Target-optimized implementation uses higheset performance implementation. FASTCV_OP_PERFORMANCE = 1, /// Target-optimized implementation offloads as much of the CPU as possible. FASTCV_OP_CPU_OFFLOAD = 2, /// Values >= 0x80000000 are reserved FASTCV_OP_RESERVED = 0x80000000 } fcvOperationMode; //------------------------------------------------------------------------------ /// @brief /// Defines a structure to contain points correspondence data. //------------------------------------------------------------------------------ typedef struct { /// Tuples of 3 values: xFrom,yFrom,zFrom. Float array which this points to /// must be greater than or equal to 3 * numCorrespondences. const float32_t* from; /*~ FIELD fcvCorrespondences.from VARRAY LENGTH ( fcvCorrespondences.numCorrespondences * \ (fcvCorrespondences.fromStride ? fcvCorrespondences.fromStride : 3) ) */ /// Tuples of 2 values: xTo,yTo. Float array which this points to /// must be greater than or equal to 2 * numCorrespondences. const float32_t* to; /*~ FIELD fcvCorrespondences.to VARRAY LENGTH ( fcvCorrespondences.numCorrespondences * \ (fcvCorrespondences.toStride ? fcvCorrespondences.toStride : 2) ) */ /// Distance in bytes between two coordinates in the from array. /// If this parameter is set to 2 or 3, a dense array is assume (stride will /// be sizeof(float) times 2 or 3). The minimum value of fromStride /// should be 2. uint32_t fromStride; /// Distance in bytes between two coordinates in the to array. /// If this parameter is set to 2, a dense array is assume (stride will /// be 2 * sizeof(float)). The minimum value of toStride /// should be 2. uint32_t toStride; /// Number of points in points correspondences. uint32_t numCorrespondences; /// Array of inlier indices for corrs array. Processing will only occur on /// the indices supplied in this array. Array which this points to must be /// at least numIndices long. const uint16_t* indices; /*~ FIELD fcvCorrespondences.indices VARRAY LENGTH (fcvCorrespondences.numIndices) */ /// Length of indices array. uint32_t numIndices; } fcvCorrespondences; // ----------------------------------------------------------------------------- /// @brief /// Structure representing an image pyramid level //------------------------------------------------------------------------------ typedef struct { const void* ptr; unsigned int width; unsigned int height; } fcvPyramidLevel ; // ----------------------------------------------------------------------------- /// @brief /// Structure describing node of a tree; /// Assumption is that nodes of all trees are stored in in a single array /// and all indices refer to this array /// @remark /// if indices of both children are negative the node is a leaf // ---------------------------------------------------------------------------- typedef struct fcvKDTreeNodef32 { /// the split value at the node float32_t divVal; /// dimension at which the split is made; /// if this is a leaf (both children equal to -1) then this is /// the index of the dataset vector int32_t divFeat; /// index of the child node with dataset items to the left /// of the split value int32_t childLeft; /// index of the child node with dataset items to the right /// of the split value int32_t childRight; } fcvKDTreeNodef32; // ----------------------------------------------------------------------------- /// @brief /// structure describing a branch (subtree) /// @remark /// branches are stored on the priority queue (heap) for backtracking // ----------------------------------------------------------------------------- typedef struct fcvKDTreeBranchf32 { /// square of minimal distance from query for all nodes below float32_t minDistSq; /// index of the top node of the branch int32_t topNode; } fcvKDTreeBranchf32; // ----------------------------------------------------------------------------- /// @brief /// Structure with KDTrees data // ----------------------------------------------------------------------------- typedef struct fcvKDTreeDatas8f32 { // info about the dataset for which KDTrees are constructed /// the dataset of vectors const int8_t *dataset; /// array with inverse lengths of dataset vectors const float32_t* invLen; /// number of vectors in the dataset int32_t numVectors; // info about trees /// indice of root nodes of trees int32_t* trees; /// array of nodes of all trees fcvKDTreeNodef32* nodes; /// number of all nodes int32_t numNodes; /// capacity of node array int32_t maxNumNodes; // info used during lookups /// priority queue fcvKDTreeBranchf32* heap; /// number of branches on the priority queue int32_t numBranches; /// capactiy of the priority queue int32_t maxNumBranches; /// array of indices to vectors in the dataset; /// during searches used to mark checkID; /// should have numVectors capacity int32_t* vind; /// unique ID for each lookup int32_t checkID; /// number of nearest neighbors to find int32_t numNNs; } fcvKDTreeDatas8f32; // ----------------------------------------------------------------------------- /// @brief /// fixed point kdtrees /// Structure describing node of tree; /// Assumption is that nodes of all trees are stored in in a single array /// and all indices refer to this array /// @remark /// if indices of both children are negative the node is a leaf // ---------------------------------------------------------------------------- typedef struct fcvKDTreeNodes32 { /// the split value at the node int32_t divVal; /// dimension at which the split is made; /// if this is a leaf (both children equal to -1) then this is /// the index of the dataset vector int32_t divFeat; /// index of the child node with dataset items to the left /// of the split value int32_t childLeft; /// index of the child node with dataset items to the right /// of the split value int32_t childRight; } fcvKDTreeNodes32; // ----------------------------------------------------------------------------- /// @brief /// fixed point kdtrees /// structure describing a branch (subtree) /// @remark /// branches are stored on the priority queue (heap) for backtracking // ----------------------------------------------------------------------------- typedef struct fcvKDTreeBranchs32 { /// square of minimal distance from query for all nodes below int32_t minDistSq; /// index of the top node of the branch int32_t topNode; } fcvKDTreeBranchs32; // ----------------------------------------------------------------------------- /// @brief /// fixed point kdtrees /// Structure with KDTrees data // ----------------------------------------------------------------------------- typedef struct fcvKDTreeDatas8s32 { // info about the dataset for which KDTrees are constructed /// the dataset of vectors const int8_t *dataset; /// array with inverse lengths of dataset vectors const int32_t* invLen; /// number of vectors in the dataset int32_t numVectors; // info about trees /// indices of root nodes of all trees int32_t* trees; /// number of trees used int32_t numTrees; /// array of nodes of all trees fcvKDTreeNodes32* nodes; /// number of all nodes int32_t numNodes; /// capacity of node array int32_t maxNumNodes; // info used during lookups /// priority queue fcvKDTreeBranchs32* heap; /// number of branches on the priority queue int32_t numBranches; /// capactiy of the priority queue int32_t maxNumBranches; /// array of indices to vectors in the dataset; /// during searches used to mark checkID; /// should have numVectors capacity int32_t* vind; /// unique ID for each lookup int32_t checkID; /// number of nearest neighbors to find int32_t numNNs; } fcvKDTreeDatas8s32; //------------------------------------------------------------------------------ /// @brief /// Defines a struct of rectangle //------------------------------------------------------------------------------ typedef struct { ///x-coordinate of the top-left corner int32_t x; ///y-coordinate of the top-left corner int32_t y; ///width of the rectangle uint32_t width; ///height of the rectangle uint32_t height; } fcvRectangleInt; //------------------------------------------------------------------------------ /// @brief /// Defines a struct of termination criteria //------------------------------------------------------------------------------ typedef struct { /// Maxmimum number of iteration int32_t max_iter; /// float32_t epsilon; }fcvTermCriteria; //------------------------------------------------------------------------------ /// @brief /// Defines a struct of 2D box used for tracking //------------------------------------------------------------------------------ typedef struct { // Center of the box ///x-coordinate of the 2D point int32_t x; ///y-coordinate of the 2D point int32_t y; // The box size int32_t columns; int32_t rows; // The orientation of the principal axis int32_t orientation; }fcvBox2D; //------------------------------------------------------------------------------ /// @brief /// Defines a struct of code word //------------------------------------------------------------------------------ typedef struct fcvBGCodeWord { /// Pointer to next codebook element struct fcvBGCodeWord* next; /// Last update time int32_t tLastUpdate; /// Longest period of inactivity int32_t stale; /// Min value of pixel for each channel uint8_t min0, min1, min2; /// Max value of pixel for each channel uint8_t max0, max1, max2; /// Min value of learning boundary for each channel uint8_t learnLow0, learnLow1, learnLow2; /// Max value of learning boundary for each channel uint8_t learnHigh0, learnHigh1, learnHigh2; } fcvBGCodeWord; //------------------------------------------------------------------------------ /// @brief /// Defines a struct for circle //------------------------------------------------------------------------------ typedef struct fcvCircle { int32_t x; int32_t y; int32_t radius; } fcvCircle; //============================================================================== // UTILITY FUNCTIONS //============================================================================== #ifdef __cplusplus extern "C" { #endif //------------------------------------------------------------------------------ /// @brief /// Retrieves version of FastCV library. /// /// @param version /// Pointer to location to put string. /// /// @param versionLength /// Length of storage for version string. /// /// @ingroup misc //------------------------------------------------------------------------------ FASTCV_API void fcvGetVersion( char* version, unsigned int versionLength ); //--------------------------------------------------------------------------- /// @brief /// Selects HW units for all routines at run-time. Can be called anytime to /// update choice. /// /// @param mode /// See enum for details. /// /// @return /// 0 if successful. /// 999 if minmum HW requirement not met. /// other #'s if unsuccessful. /// /// @ingroup misc //--------------------------------------------------------------------------- FASTCV_API int fcvSetOperationMode( fcvOperationMode mode ); //--------------------------------------------------------------------------- /// @brief /// Clean up FastCV resources. Must be called before the program exits. /// /// @ingroup misc //--------------------------------------------------------------------------- FASTCV_API void fcvCleanUp( void ); // ----------------------------------------------------------------------------- /// @brief /// Allocates memory for Pyramid /// /// @param pyr /// Pointer to an array of qcvaPyramidLevel /// /// @param baseWidth /// Width of the base level: the value assigned to pyr[0].width /// /// @param baseHeight /// Height of the base level: the value assigned to pyr[0].height /// /// @param bytesPerPixel /// Number of bytes per pixel: /// \n e.g for uint8_t pyramid, bytesPerPixel = 1 /// \n for int32_t pyramid, bytesPerPixel = 4 /// /// @param numLevels /// number of levels in the pyramid /// /// @param allocateBase /// \n if set to 1, memory will be allocated for the base level /// \n if set to 0, memory for the base level is allocated by the callee /// \n\b WARNING: How this parameter is set will impact how the memory is freed. /// Please refer to fcvPyramidDelete for details. /// /// @ingroup mem_management //---------------------------------------------------------------------------- FASTCV_API int fcvPyramidAllocate( fcvPyramidLevel* pyr, unsigned int baseWidth, unsigned int baseHeight, unsigned int bytesPerPixel, unsigned int numLevels, int allocateBase ); // ----------------------------------------------------------------------------- /// @brief /// Deallocates an array of fcvPyramidLevel. Can be used for any /// type(f32/s8/u8). /// /// @param pyr /// pyramid to deallocate /// /// @param numLevels /// Number of levels in the pyramid /// /// @param startLevel /// Start level of the pyramid /// \n\b WARNING: if pyr was allocated with allocateBase=0 which means baselevel memory /// was allocated outside of fcvPyramidAllocate, then startLevel /// for fcvPyramidDelete has to be set to 1 (or higher). /// /// @ingroup mem_management //---------------------------------------------------------------------------- FASTCV_API void fcvPyramidDelete( fcvPyramidLevel* pyr, unsigned int numLevels, unsigned int startLevel ); //------------------------------------------------------------------------------ /// @brief /// Allocates aligned memory. /// /// @param nBytes /// Number of bytes. /// /// @param byteAlignment /// Alignment specified in bytes (e.g., 16 = 128-bit alignment). /// \n\b WARNING: must be < 255 bytes /// /// @return /// SUCCESS: pointer to aligned memory /// FAILURE: 0 /// /// @ingroup mem_management //------------------------------------------------------------------------------ FASTCV_API void* fcvMemAlloc( unsigned int nBytes, unsigned int byteAlignment ); //------------------------------------------------------------------------------ /// @brief /// Frees memory allocated by fcvMemAlloc(). /// /// @param ptr /// Pointer to memory. /// /// @ingroup mem_management //------------------------------------------------------------------------------ FASTCV_API void fcvMemFree( void* ptr ); #ifdef __cplusplus }//extern "C" #endif //End - Utility functions //============================================================================== // FUNCTIONS //============================================================================== //------------------------------------------------------------------------------ /// @brief /// Blurs an image with 3x3 median filter /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterMedian3x3u8_v2(). In the 2.0.0 release, /// fcvFilterMedian3x3u8_v2 will be renamed to fcvFilterMedian3x3u8 /// and the signature of fcvFilterMedian3x3u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Border values are ignored. The 3x3 mask convolves with the image area /// | a(1,1) , a12, ..., a(1,srcWidth-2) |\n /// | ... , ..., ..., ... |\n /// | a(srcHeight-2,1), ..., ..., a1(srcHeight-2,srcWidth-2) |\n /// /// @param srcImg /// Input 8-bit image. Size of buffer is srcWidth*srcHeight byte. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param dstImg /// Output 8-bit image. Size of buffer is srcWidth*srcHeight byte. /// \n\b NOTE: data should be 128-bit aligned. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterMedian3x3u8( const uint8_t* __restrict srcImg, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dstImg ); //------------------------------------------------------------------------------ /// @brief /// Blurs an image with 3x3 median filter /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterMedian3x3u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterMedian3x3u8, /// \a fcvFilterMedian3x3u8_v2 will be removed, and the current signature /// for \a fcvFilterMedian3x3u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterMedian3x3u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Border values are ignored. The 3x3 mask convolves with the image area /// | a(1,1) , a12, ..., a(1,srcWidth-2) |\n /// | ... , ..., ..., ... |\n /// | a(srcHeight-2,1), ..., ..., a1(srcHeight-2,srcWidth-2) |\n /// /// @param srcImg /// Input 8-bit image. Size of buffer is srcStride*srcHeight byte. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dstImg /// Output 8-bit image. Size of buffer is dstStride*srcHeight byte. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dstStride /// Output stride. /// \n\b NOTE: if 0, dstStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterMedian3x3u8_v2( const uint8_t* __restrict srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dstImg, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Blurs an image with 3x3 Gaussian filter /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterGaussian3x3u8_v2(). In the 2.0.0 release, /// fcvFilterGaussian3x3u8_v2 will be renamed to fcvFilterGaussian3x3u8 /// and the signature of fcvFilterGaussian3x3u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Gaussian kernel: /// \n 1 2 1 /// \n 2 4 2 /// \n 1 2 1 /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight byte. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param dst /// Output 8-bit image. Destination buffer size is srcWidth*srcHeight. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param blurBorder /// If set to 1, border is blurred by 0-padding adjacent values. If set to 0, /// borders up to half-kernel width are ignored (e.g. 1 pixel in the 3x3 /// case). /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterGaussian3x3u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst, int blurBorder ); //------------------------------------------------------------------------------ /// @brief /// Blurs an image with 3x3 Gaussian filter /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterGaussian3x3u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterGaussian3x3u8, /// \a fcvFilterGaussian3x3u8_v2 will be removed, and the current signature /// for \a fcvFilterGaussian3x3u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterGaussian3x3u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Convolution with 3x3 Gaussian kernel: /// \n 1 2 1 /// \n 2 4 2 /// \n 1 2 1 /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit image. Size of buffer is dstStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dstStride /// Output stride. /// \n\b NOTE: if 0, dstStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as dstWidth if not 0. /// /// @param blurBorder /// If set to 1, border is blurred by 0-padding adjacent values. If set to 0, /// borders up to half-kernel width are ignored (e.g. 1 pixel in the 3x3 /// case). /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterGaussian3x3u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride, int blurBorder ); //------------------------------------------------------------------------------ /// @brief /// Blurs an image with 5x5 Gaussian filter /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterGaussian5x5u8_v2(). In the 2.0.0 release, /// fcvFilterGaussian5x5u8_v2 will be renamed to fcvFilterGaussian5x5u8 /// and the signature of fcvFilterGaussian5x5u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Convolution with 5x5 Gaussian kernel: /// \n 1 4 6 4 1 /// \n 4 16 24 16 4 /// \n 6 24 36 24 6 /// \n 4 16 24 16 4 /// \n 1 4 6 4 1 /// /// @param src /// Input int data (can be sq. of gradient, etc). Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param dst /// Output 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param blurBorder /// If set to 1, border is blurred by 0-padding adjacent values. If set to 0, /// borders up to half-kernel width are ignored (e.g. 2 pixel in the 5x5 /// case). /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterGaussian5x5u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst, int blurBorder ); //------------------------------------------------------------------------------ /// @brief /// Blurs an image with 5x5 Gaussian filter /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterGaussian5x5u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterGaussian5x5u8, /// \a fcvFilterGaussian5x5u8_v2 will be removed, and the current signature /// for \a fcvFilterGaussian5x5u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterGaussian5x5u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Convolution with 5x5 Gaussian kernel: /// \n 1 4 6 4 1 /// \n 4 16 24 16 4 /// \n 6 24 36 24 6 /// \n 4 16 24 16 4 /// \n 1 4 6 4 1 /// /// @param src /// Input int data (can be sq. of gradient, etc). Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, dstStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit image. Size of buffer is dstStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dstStride /// Output stride. /// \n\b NOTE: if 0, dstStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as dstWidth if not 0. /// /// @param blurBorder /// If set to 1, border is blurred by 0-padding adjacent values. If set to 0, /// borders up to half-kernel width are ignored (e.g. 2 pixel in the 5x5 /// case). /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterGaussian5x5u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride, int blurBorder ); //------------------------------------------------------------------------------ /// @brief /// Blurs an image with 11x11 Gaussian filter /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterGaussian11x11u8_v2(). In the 2.0.0 release, /// fcvFilterGaussian11x11u8_v2 will be renamed to fcvFilterGaussian11x11u8 /// and the signature of fcvFilterGaussian11x11u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Convolution with 11x11 Gaussian kernel: /// \n 1 10 45 120 210 252 210 120 45 10 1 /// \n 10 100 450 1200 2100 2520 2100 1200 450 100 10 /// \n 45 450 2025 5400 9450 11340 9450 5400 2025 450 45 /// \n 120 1200 5400 14400 25200 30240 25200 14400 5400 1200 120 /// \n 210 2100 9450 25200 44100 52920 44100 25200 9450 2100 210 /// \n 252 2520 11340 30240 52920 63504 52920 30240 11340 2520 252 /// \n 210 2100 9450 25200 44100 52920 44100 25200 9450 2100 210 /// \n 120 1200 5400 14400 25200 30240 25200 14400 5400 1200 120 /// \n 45 450 2025 5400 9450 11340 9450 5400 2025 450 45 /// \n 10 100 450 1200 2100 2520 2100 1200 450 100 10 /// \n 1 10 45 120 210 252 210 120 45 10 , 1 /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param dst /// Output 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param blurBorder /// If set to 1, border is blurred by 0-padding adjacent values. If set to 0, /// borders up to half-kernel width are ignored (e.g. 5 pixel in the 11x11 /// case). /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterGaussian11x11u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst, int blurBorder ); //------------------------------------------------------------------------------ /// @brief /// Blurs an image with 11x11 Gaussian filter /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterGaussian11x11u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterGaussian11x11u8, /// \a fcvFilterGaussian11x11u8_v2 will be removed, and the current signature /// for \a fcvFilterGaussian11x11u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterGaussian11x11u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Convolution with 11x11 Gaussian kernel: /// \n 1 10 45 120 210 252 210 120 45 10 1 /// \n 10 100 450 1200 2100 2520 2100 1200 450 100 10 /// \n 45 450 2025 5400 9450 11340 9450 5400 2025 450 45 /// \n 120 1200 5400 14400 25200 30240 25200 14400 5400 1200 120 /// \n 210 2100 9450 25200 44100 52920 44100 25200 9450 2100 210 /// \n 252 2520 11340 30240 52920 63504 52920 30240 11340 2520 252 /// \n 210 2100 9450 25200 44100 52920 44100 25200 9450 2100 210 /// \n 120 1200 5400 14400 25200 30240 25200 14400 5400 1200 120 /// \n 45 450 2025 5400 9450 11340 9450 5400 2025 450 45 /// \n 10 100 450 1200 2100 2520 2100 1200 450 100 10 /// \n 1 10 45 120 210 252 210 120 45 10 , 1 /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, dstStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit image. Size of buffer is dstStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dstStride /// Output stride. /// \n\b NOTE: if 0, dstStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param blurBorder /// If set to 1, border is blurred by 0-padding adjacent values. If set to 0, /// borders up to half-kernel width are ignored (e.g. 5 pixel in the 11x11 /// case). /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterGaussian11x11u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride, int blurBorder ); //------------------------------------------------------------------------------ /// @brief /// Color conversion from YUV (YCrCb) 4:2:0 PesudoPlanar (Interleaved) to RGB 8888. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvColorYCrCb420PseudoPlanarToRGB8888u8. In the 2.0.0 release, /// the signature of fcvColorYUV420toRGB8888u8 as it appears now, /// will be removed. /// \n\n /// /// @param src /// 8-bit image of input YUV 4:2:0 values. /// \n\b NOTE: must be 128-bit aligned. /// /// The input are one Y plane followed by one interleaved and 2D (both /// horizontally and vertically) sub-sampled CrCb plane: /// Y plane : Y00 Y01 Y02 Y03 ... /// Y10 Y11 Y12 Y13 ... /// Interleaved and 2D sub-sampled plane: Cr0 Cb0 Cr1 Cb1 ... /// /// @param dst /// 32-bit image of output RGB 8888 values. R is at LSB. /// \n\b WARNING: size must match input yuv420. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// /// /// @ingroup color_conversion //------------------------------------------------------------------------------ FASTCV_API void fcvColorYUV420toRGB8888u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint32_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Color conversion from YUV (YCrCb) 4:2:0 PesudoPlanar (Interleaved CrCb) to RGB 888. /// /// \n\b ATTENTION: The name of this function will be changed when the 2.0.0 release /// of this library is made. /// Until 2.0.0, the developer should use this implementation with the expectation of /// moving to a different name when transitioning to 2.0.0. /// \n\n /// /// @param src /// 8-bit image of input YUV picture. /// \n\b NOTE: must be 128-bit aligned. /// /// The input are one Y plane followed by one interleaved and 2D (both /// horizontally and vertically) sub-sampled CrCb plane: /// Y plane : Y00 Y01 Y02 Y03 ... /// Y10 Y11 Y12 Y13 ... /// Interleaved and 2D sub-sampled plane: Cr0 Cb0 Cr1 Cb1 ... /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param srcYStride /// Stride (in bytes) of input image Y component (i.e., number of bytes between /// column 0 of row 1 and column 0 of row 2). /// \n\b WARNING: Must be multiple of 8 (8 * 1-byte values). /// /// @param srcCStride /// Stride (in bytes) of input image Chroma component (i.e., number of bytes between /// column 0 of row 1 and column 0 of row 2) /// \n\b WARNING: Must be multiple of 4 (4 * 1-byte values). /// /// @param dst /// 32-bit image of output RGB 8888 values. R in LSB. /// \n\b WARNING: size must match input yuv420. /// \n\b NOTE: must be 128-bit aligned. /// /// @param dstStride /// Stride of output RGB image (i.e., number of bytes between column 0 of /// row 1 and column 0 of row 2) /// \n\b WARNING: Must be multiple of 32 (8 * 4-byte values). /// /// /// /// @ingroup color_conversion //------------------------------------------------------------------------------ FASTCV_API void fcvColorYCrCb420PseudoPlanarToRGB8888u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcYStride, unsigned int srcCStride, uint32_t* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Color conversion from YUV (YCbCr) 4:2:0 PesudoPlanar (Interleaved CbCr) to RGB 565. /// /// \n\b ATTENTION: The name of this function will be changed when the 2.0.0 release /// of this library is made. /// Until 2.0.0, the developer should use this implementation with the expectation of /// moving to a different name when transitioning to 2.0.0. /// \n\n /// /// @param src /// 8-bit image of input YUV 4:2:0 values. /// \n\b NOTE: must be 128-bit aligned. /// /// The input are one Y plane followed by one interleaved and 2D (both /// horizontally and vertically) sub-sampled CbCr plane: /// Y plane : Y00 Y01 Y02 Y03 ... /// Y10 Y11 Y12 Y13 ... /// Interleaved and 2D sub-sampled plane: Cb0 Cr0 Cb1 Cr1 ... /// /// @param dst /// 16-bit image of output RGB 565 values. R in LSBs. /// 2 pixels are packed into one 32-bit output /// \n\b WARNING: size must match input yuv420. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: Must be multiple of 4 /// /// @param srcHeight /// Image height. /// /// /// /// @ingroup color_conversion //------------------------------------------------------------------------------ FASTCV_API void fcvColorYUV420toRGB565u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint32_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Color conversion from YCbCr H1V1 to RGB 888. /// /// @details /// Color conversion from YCbCr H1V1 (YCbCr 4:4:4 planar) to RGB 888. /// \n R = Y + 1.40200*(Cr-128) /// \n G = Y - 0.34414*(Cb-128) - 0.71414*(Cr-128) /// \n B = Y + 1.77200*(CB-128) /// /// @param src /// 8-bit image of input values. Stored as YCbCr H1V1 planar format in 8x8 blocks for Y,Cb,Cr. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: Must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param dst /// 8-bit image of output RGB 888 values. R in LSB. /// \n\b WARNING: size must match input crcb. /// \n\b NOTE: must be 128-bit aligned. /// /// /// /// @ingroup color_conversion //------------------------------------------------------------------------------ FASTCV_API void fcvColorYCrCbH1V1toRGB888u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Color conversion from YCbCr H2V2 to RGB 888. /// /// @details /// Color conversion from YCbCr H2V2 (YCbCr 4:2:0 planar) to RGB 888. /// \n R = Y + 1.40200*(Cr-128) /// \n G = Y - 0.34414*(Cb-128) - 0.71414*(Cr-128) /// \n B = Y + 1.77200*(CB-128) /// /// @param ysrc /// 8-bit input values. Stored as YCbCr H2V2 planar format in 16x16 blocks for Y, 8x8 blocks for Cb, Cr. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: Must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param dst /// 8-bit image of output RGB 888 values. R in LSB. /// \n\b WARNING: size must match input crcb. /// \n\b NOTE: must be 128-bit aligned. /// /// /// /// @ingroup color_conversion //------------------------------------------------------------------------------ FASTCV_API void fcvColorYCrCbH2V2toRGB888u8( const uint8_t* __restrict ysrc, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Color conversion from YCbCr H2V1 to RGB 888. /// /// @details /// Color conversion from YCbCr H2V1 (YCbCr 4:2:2) to RGB 888. /// \n R = Y + 1.40200*(Cr-128) /// \n G = Y - 0.34414*(Cb-128) - 0.71414*(Cr-128) /// \n B = Y + 1.77200*(CB-128) /// /// @param src /// 8-bit input values. Stored as YCbCr H2V1 planar format in 16x8 blocks for Y, 8x8 blocks for Cb, Cr. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: Must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param dst /// 8-bit image of output RGB 888 values. R in LSB. /// \n\b WARNING: size must match input crcb. /// \n\b NOTE: must be 128-bit aligned. /// /// /// /// @ingroup color_conversion //------------------------------------------------------------------------------ FASTCV_API void fcvColorYCrCbH2V1toRGB888u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Color conversion from YCbCr H1V2 to RGB 888. /// /// @details /// Color conversion from YCbCr H1V2 (YCbCr 4:2:2) to RGB 888. /// \n R = Y + 1.40200*(Cr-128) /// \n G = Y - 0.34414*(Cb-128) - 0.71414*(Cr-128) /// \n B = Y + 1.77200*(CB-128) /// /// @param ysrc /// 8-bit input values. Stored as YCbCr H1V2 planar format in 8x16 blocks for Y, 8x8 blocks for Cb, Cr. /// \n\b NOTE: must be 128-bit aligned. /// /// /// @param srcWidth /// Image width. /// \n\b WARNING: Must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param dst /// 8-bit image of output RGB 888 values. R in LSB. /// \n\b WARNING: size must match input crcb. /// \n\b NOTE: must be 128-bit aligned. /// /// /// /// @ingroup color_conversion //------------------------------------------------------------------------------ FASTCV_API void fcvColorYCrCbH1V2toRGB888u8( const uint8_t* __restrict ysrc, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Color conversion from RGB 888 to YCrCb. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvColorRGB888toYCrCbu8_v2(). In the 2.0.0 release, /// fcvColorRGB888toYCrCbu8_v2 will be renamed to fcvColorRGB888toYCrCbu8 /// and the signature of fcvColorRGB888toYCrCbu8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Color conversion from RGB 888 to YCrCb 4:4:4 interleaved. /// /// @param src /// 8-bit input values. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: Must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param dst /// 8-bit output values. Stored as Y, Cr, Cb interleaved format. /// \n\b WARNING: size must match input crcb. /// \n\b NOTE: must be 128-bit aligned. /// /// /// /// @ingroup color_conversion //------------------------------------------------------------------------------ FASTCV_API void fcvColorRGB888toYCrCbu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Color conversion from RGB 888 to YCrCb 4:4:4 (Full interleaved, similar to /// 3-channel RGB). /// /// \n\b ATTENTION: This function is a duplication of of /// fcvColorRGB888toYCrCbu8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvColorRGB888toYCrCbu8, /// \a fcvColorRGB888toYCrCbu8_v2 will be removed, and the current signature /// for \a fcvColorRGB888toYCrCbu8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvColorRGB888toYCrCbu8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Color conversion from RGB 888 to YCrCb 4:4:4 interleaved. /// /// @param src /// 8-bit input values. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: Must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride (in bytes). /// \n\b WARNING: Must be at least 3*srcWidth. /// /// @param dst /// 8-bit output values. Stored as Y, Cr, Cb interleaved format. /// \n\b WARNING: size must match input crcb. /// \n\b NOTE: must be 128-bit aligned. /// /// @param dstStride /// Output stride (in bytes). /// \n\b WARNING: Must be at least 3*srcWidth. /// /// /// /// @ingroup color_conversion //------------------------------------------------------------------------------ FASTCV_API void fcvColorRGB888toYCrCbu8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Create a 36-dimension gradient based descriptor on 17x17 patch. /// /// @details /// /// @param patch /// Input luminance data for 17x17 patch to describe. /// /// @param descriptorChar /// Output descriptor vector. 36 x 8-bit vector. Normalized and quantized to range [-127, 127] /// /// @param descriptorNormSq /// Output squared norm (L2 norm) of the descriptor vector. /// /// /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API int fcvDescriptor17x17u8To36s8( const uint8_t* __restrict patch, int8_t* __restrict descriptorChar, int32_t* __restrict descriptorNormSq ); //--------------------------------------------------------------------------- /// @brief /// Dot product of two 8-bit vectors. /// /// @param a /// Vector. /// /// @param b /// Vector. /// /// @param abSize /// Number of elements in A and B. /// /// @return /// Dot product . /// /// @ingroup math_vector //--------------------------------------------------------------------------- FASTCV_API int32_t fcvDotProducts8( const int8_t* __restrict a, const int8_t* __restrict b, unsigned int abSize ); //------------------------------------------------------------------------------ /// @brief /// Dot product of two 8-bit vectors. /// /// @param a /// Vector A. /// /// @param b /// Vector B. /// /// @param abSize /// Number of elements in A and B. /// /// @return /// Dot product . /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvDotProductu8( const uint8_t* __restrict a, const uint8_t* __restrict b, unsigned int abSize ); //--------------------------------------------------------------------------- /// @brief /// Dot product of two 36-byte vectors. /// /// @param a /// Vector. /// /// @param b /// Vector. /// /// @return /// Dot product . /// /// @ingroup math_vector //--------------------------------------------------------------------------- FASTCV_API int32_t fcvDotProduct36x1s8( const int8_t* __restrict a, const int8_t* __restrict b ); //--------------------------------------------------------------------------- /// @brief /// Dot product of one 36-byte vector against 4 others. /// /// @details /// Dot product of 36-byte vector (a) against 4 others (b,c,d,e):\n /// , , , /// /// @param a /// Vector. /// /// @param b /// Vector. /// /// @param c /// Vector. /// /// @param d /// Vector. /// /// @param e /// Vector. /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //--------------------------------------------------------------------------- FASTCV_API void fcvDotProduct36x4s8( const int8_t* __restrict a, const int8_t* __restrict b, const int8_t* __restrict c, const int8_t* __restrict d, const int8_t* __restrict e, int32_t* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Normalized dot product of one 36-byte vector against 4 others. /// /// @details /// Dot product of 36-byte vector (a) against 4 others (b0,b1,b2,b3):\n /// , , , /// using their given inverse lengths for normalization. /// /// @param a /// Vector. /// /// @param invLengthA /// Inverse of vector A. /// /// @param b0 /// Vector. /// /// @param b1 /// Vector. /// /// @param b2 /// Vector. /// /// @param b3 /// Vector. /// /// @param invLengthsB /// Pointer to an array of the inverse values of each B vector. /// The pointer must point to 4 floating point values. /// \n\b WARNING: array must be 128-bit aligned /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvDotProductNorm36x4s8( const int8_t* __restrict a, float invLengthA, const int8_t* __restrict b0, const int8_t* __restrict b1, const int8_t* __restrict b2, const int8_t* __restrict b3, float* __restrict invLengthsB, float* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Dot product of two 36-byte vectors. /// /// @param a /// Vector. /// /// @param b /// Vector. /// /// @return /// Dot product . /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvDotProduct36x1u8( const uint8_t* __restrict a, const uint8_t* __restrict b ); //------------------------------------------------------------------------------ /// @brief /// Dot product of one 36-byte vector against 4 others. /// /// @details /// Dot product of 36-byte vector (a) against 4 others (b,c,d,e):\n /// , , , /// /// @param a /// Vector. /// /// @param b /// Vector. /// /// @param c /// Vector. /// /// @param d /// Vector. /// /// @param e /// Vector. /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvDotProduct36x4u8( const uint8_t* __restrict a, const uint8_t* __restrict b, const uint8_t* __restrict c, const uint8_t* __restrict d, const uint8_t* __restrict e, uint32_t* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Normalized dot product of one 36-byte vector against 4 others. /// /// @details /// Dot product of 36-byte vector (a) against 4 others (b0,b1,b2,b3):\n /// , , , /// using their given inverse lengths for normalization. /// /// @param a /// Vector. /// /// @param invLengthA /// Inverse of vector A. /// /// @param b0 /// Vector. /// /// @param b1 /// Vector. /// /// @param b2 /// Vector. /// /// @param b3 /// Vector. /// /// @param invLengthsB /// Pointer to an array of the inverse values of each B vector. /// The pointer must point to 4 floating point values. /// \n\b WARNING: array must be 128-bit aligned /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvDotProductNorm36x4u8( const uint8_t* __restrict a, float invLengthA, const uint8_t* __restrict b0, const uint8_t* __restrict b1, const uint8_t* __restrict b2, const uint8_t* __restrict b3, float* __restrict invLengthsB, float* __restrict dotProducts ); //--------------------------------------------------------------------------- /// @brief /// Dot product of two 64-byte vectors. /// /// @param a /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @return /// Dot product . /// /// @ingroup math_vector //--------------------------------------------------------------------------- FASTCV_API int32_t fcvDotProduct64x1s8( const int8_t* __restrict a, const int8_t* __restrict b ); //--------------------------------------------------------------------------- /// @brief /// Dot product of one 64-byte vector against 4 others. /// /// @details /// Dot product of vector (a) against 4 others (b,c,d,e):\n /// , , , /// /// @param a /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param c /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param d /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param e /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //--------------------------------------------------------------------------- FASTCV_API void fcvDotProduct64x4s8( const int8_t* __restrict a, const int8_t* __restrict b, const int8_t* __restrict c, const int8_t* __restrict d, const int8_t* __restrict e, int32_t* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Normalized dot product of one 64-byte vector against 4 others. /// /// @details /// Dot product of 36-byte vector (a) against 4 others (b0,b1,b2,b3):\n /// , , , /// using their given inverse lengths for normalization. /// /// @param a /// Vector. /// /// @param invLengthA /// Inverse of vector A. /// /// @param b0 /// Vector. /// /// @param b1 /// Vector. /// /// @param b2 /// Vector. /// /// @param b3 /// Vector. /// /// @param invLengthsB /// Pointer to an array of the inverse values of each B vector. /// The pointer must point to 4 floating point values. /// \n\b WARNING: array must be 128-bit aligned /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvDotProductNorm64x4s8( const int8_t* __restrict a, float invLengthA, const int8_t* __restrict b0, const int8_t* __restrict b1, const int8_t* __restrict b2, const int8_t* __restrict b3, float* __restrict invLengthsB, float* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Dot product of two 64-byte vectors. /// /// @param a /// Vector. /// /// @param b /// Vector. /// /// @return /// Dot product . /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvDotProduct64x1u8( const uint8_t* __restrict a, const uint8_t* __restrict b ); //------------------------------------------------------------------------------ /// @brief /// Dot product of one 64-byte vector against 4 others. /// /// @details /// Dot product of 36-byte vector (a) against 4 others (b,c,d,e):\n /// , , , /// /// @param a /// Vector. /// /// @param b /// Vector. /// /// @param c /// Vector. /// /// @param d /// Vector. /// /// @param e /// Vector. /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvDotProduct64x4u8( const uint8_t* __restrict a, const uint8_t* __restrict b, const uint8_t* __restrict c, const uint8_t* __restrict d, const uint8_t* __restrict e, uint32_t* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Normalized dot product of one 64-byte vector against 4 others. /// /// @details /// Dot product of 36-byte vector (a) against 4 others (b0,b1,b2,b3):\n /// , , , /// using their given inverse lengths for normalization. /// /// @param a /// Vector. /// /// @param invLengthA /// Inverse of vector A. /// /// @param b0 /// Vector. /// /// @param b1 /// Vector. /// /// @param b2 /// Vector. /// /// @param b3 /// Vector. /// /// @param invLengthsB /// Pointer to an array of the inverse values of each B vector. /// The pointer must point to 4 floating point values. /// \n\b WARNING: array must be 128-bit aligned /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvDotProductNorm64x4u8( const uint8_t* __restrict a, float invLengthA, const uint8_t* __restrict b0, const uint8_t* __restrict b1, const uint8_t* __restrict b2, const uint8_t* __restrict b3, float* __restrict invLengthsB, float* __restrict dotProducts ); //--------------------------------------------------------------------------- /// @brief /// Dot product of two 128-byte vectors. /// /// @param a /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @return /// Dot product . /// /// @ingroup math_vector //--------------------------------------------------------------------------- FASTCV_API int32_t fcvDotProduct128x1s8( const int8_t* __restrict a, const int8_t* __restrict b ); //--------------------------------------------------------------------------- /// @brief /// Dot product of one 128-byte vector against 4 others. /// /// @details /// Dot product of vector (a) against 4 others (b,c,d,e):\n /// , , , /// /// @param a /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param c /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param d /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param e /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //--------------------------------------------------------------------------- FASTCV_API void fcvDotProduct128x4s8( const int8_t* __restrict a, const int8_t* __restrict b, const int8_t* __restrict c, const int8_t* __restrict d, const int8_t* __restrict e, int32_t* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Normalized dot product of one 128-byte vector against 4 others. /// /// @details /// Dot product of vector (a) against 4 others (b0,b1,b2,b3):\n /// , , , /// using their given inverse lengths for normalization. /// /// @param a /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param invLengthA /// Inverse of vector A. /// /// @param b0 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b1 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b2 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b3 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param invLengthsB /// Pointer to an array of the inverse values of each B vector. /// The pointer must point to 4 floating point values. /// \n\b WARNING: array must be 128-bit aligned /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvDotProductNorm128x4s8( const int8_t* __restrict a, float invLengthA, const int8_t* __restrict b0, const int8_t* __restrict b1, const int8_t* __restrict b2, const int8_t* __restrict b3, float* __restrict invLengthsB, float* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Dot product of two 128-byte vectors. /// /// @param a /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @return /// Dot product . /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvDotProduct128x1u8( const uint8_t* __restrict a, const uint8_t* __restrict b ); //------------------------------------------------------------------------------ /// @brief /// Dot product of one 128-byte vector against 4 others. /// /// @details /// Dot product of vector (a) against 4 others (b,c,d,e):\n /// , , , /// /// @param a /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param c /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param d /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param e /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvDotProduct128x4u8( const uint8_t* __restrict a, const uint8_t* __restrict b, const uint8_t* __restrict c, const uint8_t* __restrict d, const uint8_t* __restrict e, uint32_t* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Normalized dot product of one 128-byte vector against 4 others. /// /// @details /// Dot product of vector (a) against 4 others (b0,b1,b2,b3):\n /// , , , /// using their given inverse lengths for normalization. /// /// @param a /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param invLengthA /// Inverse of vector A. /// /// @param b0 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b1 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b2 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b3 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param invLengthsB /// Pointer to an array of the inverse values of each B vector. /// The pointer must point to 4 floating point values. /// /// @param dotProducts /// Output of the 4 results { , , , }. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvDotProductNorm128x4u8( const uint8_t* __restrict a, float invLengthA, const uint8_t* __restrict b0, const uint8_t* __restrict b1, const uint8_t* __restrict b2, const uint8_t* __restrict b3, float* __restrict invLengthsB, float* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Dot product of 1 patch (8x8 byte square) with several (n) 8x8 squares /// along a line of pixels in an image. /// /// @param patchPixels /// Pointer to 8-bit patch pixel values linearly laid out in memory. /// /// @param imagePixels /// Pointer to 8-bit image pixel values linearly laid out in memory. /// /// @param imgW /// Width in pixels of the source image. /// /// @param imgH /// Height in pixels of the source image. /// /// @param nX /// X location on image of starting search pixel. /// /// @param nY /// Y location on image of starting search pixel. /// /// @param nNum /// Number of pixels (in X direction) on image to sweep. /// /// @param dotProducts /// Output dot product values of nNum pixels. /// \n\b WARNING: array size must be a multiple of 4 (e.g., 4, 8, 12, ...) /// \n\b NOTE: array should be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvDotProduct8x8u8( const uint8_t* __restrict patchPixels, const uint8_t* __restrict imagePixels, unsigned short imgW, unsigned short imgH, int nX, int nY, unsigned int nNum, int32_t* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// Dot product of 1 patch (8x8 byte square) with 8x8 squares in 11x12 /// rectangle around the center search pixel (iX,iY). /// /// @param patchPixels /// Pointer to 8-bit patch pixel values linearly laid out in memory. /// /// @param imagePixels /// Pointer to 8-bit image pixel values linearly laid out in memory. /// /// @param imgW /// Width in pixels of the image. /// /// @param imgH /// Height in pixels of the image. /// /// @param iX /// X location on image of the center of the search window. /// /// @param iY /// Y location on image of the center of the search window. /// /// @param dotProducts /// Output 11x12 dot product values. /// \n\b WARNING: array must be 128-bit aligned /// /// @ingroup math_vector //--------------------------------------------------------------------------- FASTCV_API void fcvDotProduct11x12u8( const uint8_t* __restrict patchPixels, const uint8_t* __restrict imagePixels, unsigned short imgW, unsigned short imgH, int iX, int iY, int32_t* __restrict dotProducts ); //------------------------------------------------------------------------------ /// @brief /// 3x3 Sobel edge filter /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterSobel3x3u8_v2(). In the 2.0.0 release, /// fcvFilterSobel3x3u8_v2 will be renamed to fcvFilterSobel3x3u8 /// and the signature of fcvFilterSobel3x3u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// This function calculates an image derivative by convolving the image with an appropriate 3x3 kernel. /// Border values are ignored. The 3x3 mask convolves with the image area /// | a(1,1) , a12, ..., a(1,srcWidth-2) |\n /// | ... , ..., ..., ... |\n /// | a(srcHeight-2,1), ..., ..., a1(srcHeight-2,srcWidth-2) |\n /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: data must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param dst /// Output 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: dst is saturated to 255 /// \n\b WARNING: data must be 128-bit aligned. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterSobel3x3u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// 3x3 Sobel edge filter /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterSobel3x3u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterSobel3x3u8, /// \a fcvFilterSobel3x3u8_v2 will be removed, and the current signature /// for \a fcvFilterSobel3x3u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterSobel3x3u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// This function calculates an image derivative by convolving the image with an appropriate 3x3 kernel. /// Border values are ignored. The 3x3 mask convolves with the image area /// | a(1,1) , a12, ..., a(1,srcWidth-2) |\n /// | ... , ..., ..., ... |\n /// | a(srcHeight-2,1), ..., ..., a1(srcHeight-2,srcWidth-2) |\n /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: data must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit image. Size of buffer is dstStride*srcHeight bytes. /// \n\b NOTE: dst is saturated to 255 /// \n\b WARNING: data must be 128-bit aligned. /// /// @param dstStride /// Output stride. /// \n\b NOTE: if 0, dstStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as dstWidth if not 0. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterSobel3x3u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Canny edge filter /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterCanny3x3u8_v2(). In the 2.0.0 release, /// fcvFilterCanny3x3u8_v2 will be renamed to fcvFilterCanny3x3u8 /// and the signature of fcvFilterCanny3x3u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Canny edge detector applied to a 8 bit grayscale image. The min threshold /// is set to 0 and the max threshold is set to 15. The aperture size used /// is set to 3. This function will output the edge, since its working with a /// 3x3 window, it leaves one row/col of pixels at the corners /// map stored as a binarized image (0x0 - not an edge, 0xFF - edge). /// | a(1,1) , a12, ..., a(1,srcWidth-2) |\n /// | ... , ..., ..., ... |\n /// | a(srcHeight-2,1), ..., ..., a1(srcHeight-2,srcWidth-2) |\n /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: data must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param dst /// Output 8-bit image containing the edge detection results. /// Size of buffer is srcWidth*srcHeight bytes. /// /// @param lowThresh /// For all the intermediate pixels along the edge, the magnitude of the /// gradient at the pixel locations should be greater than 'low' /// (sqrt(gx^2 + gy^2) > low, where gx and gy are X and Y gradient) /// /// @param highThresh /// For an edge starting point, i.e. either the first or last /// pixel of the edge, the magnitude of the gradient at the pixel should be /// greater than 'high' (sqrt(gx^2 + gy^2) > high, where gx and gy are X and /// Y gradient). /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterCanny3x3u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst, int lowThresh, int highThresh ); //------------------------------------------------------------------------------ /// @brief /// Canny edge filter /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterCanny3x3u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterCanny3x3u8, /// \a fcvFilterCanny3x3u8_v2 will be removed, and the current signature /// for \a fcvFilterCanny3x3u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterCanny3x3u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Canny edge detector applied to a 8 bit grayscale image. The Canny edge /// detector uses min/max threshold to classify an edge. The min threshold /// is set to 0 and the max threshold is set to 15. The aperture size used /// in the Canny edge detector will be same as the filter footprint in the /// Sobel edge detector and is set to 3. This function will output the edge /// map stored as a binarized image (0x0 - not an edge, 0xFF - edge), since /// it works with 3x3 windows, it leaves 1 row/col of pixels at the corners. /// | a(1,1) , a12, ..., a(1,srcWidth-2) |\n /// | ... , ..., ..., ... |\n /// | a(srcHeight-2,1), ..., ..., a1(srcHeight-2,srcWidth-2) |\n /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: data must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit image containing the edge detection results. /// Size of buffer is dstStride*srcHeight bytes. /// /// @param dstStride /// Output stride. /// \n\b NOTE: if 0, dstStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as dstWidth if not 0. /// /// @param lowThresh /// For all the intermediate pixels along the edge, the magnitude of the /// gradient at the pixel locations should be greater than 'low' /// (sqrt(gx^2 + gy^2) > low, where gx and gy are X and Y gradient) /// /// @param highThresh /// For an edge starting point, i.e. either the first or last /// pixel of the edge, the magnitude of the gradient at the pixel should be /// greater than 'high' (sqrt(gx^2 + gy^2) > high, where gx and gy are X and /// Y gradient). /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterCanny3x3u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride, int lowThresh, int highThresh ); //------------------------------------------------------------------------------ /// @brief /// Performs image difference by subracting src2 from src1. dst=src1-src2. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageDiffu8_v2(). In the 2.0.0 release, /// fcvImageDiffu8_v2 will be renamed to fcvImageDiffu8 /// and the signature of fcvImageDiffu8 as it appears now, /// will be removed. /// \n\n /// /// @details /// dst[i,j] = (uint8_t) max( min((short)(src1[i,j]-src2[i,j]), 255), 0 ); /// /// @param src1 /// First source image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param src2 /// Second source image, must be same size as src1. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be a multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param dst /// Destination. Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: Must be same size as src1 and src2. /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageDiffu8( const uint8_t* __restrict src1, const uint8_t* __restrict src2, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Performs image difference by subracting src2 from src1. dst=src1-src2. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageDiffu8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageDiffu8, /// \a fcvImageDiffu8_v2 will be removed, and the current signature /// for \a fcvImageDiffu8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageDiffu8 when transitioning to 2.0.0. /// \n\n /// /// @details /// dst[i,j] = (uint8_t) max( min((short)(src1[i,j]-src2[i,j]), 255), 0 ); /// /// @param src1 /// First source image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param src2 /// Second source image, must be same size as src1. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be a multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Stride of input image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Destination. Size of buffer is dstStride*srcHeight bytes. /// \n\b NOTE: Must be same size as src1 and src2. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Stride of output image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as dstWidth if not 0. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageDiffu8_v2( const uint8_t* __restrict src1, const uint8_t* __restrict src2, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride ); //-------------------------------------------------------------------------- /// @brief /// Compute image difference src1-src2 /// /// @param src1 /// Input image1 of int16 type. Size of buffer is srcStride*srcHeight*2 bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param src2 /// Input image2, must have same size as src1 /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Input image width /// \n\b WARNING: must be multiple of 8 /// /// @param srcHeight /// Input image height /// /// @param srcStride /// Stride of input image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output image, saturated for int16 type. Size of buffer is dstStride*srcHeight*2 bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Stride of output image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, dstStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @ingroup image_processing ////------------------------------------------------------------------------ FASTCV_API void fcvImageDiffs16( const int16_t* __restrict src1, const int16_t* __restrict src2, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Performs image difference by subracting src2 from src1. dst=src1-src2. /// /// @details /// /// @param src1 /// First source image. Size of buffer is srcStride*srcHeight*4 bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param src2 /// Second source image, must be same size as src1. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Stride of input image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Destination. Size of buffer is dstStride*srcHeight*4 bytes. /// \n\b NOTE: Must be same size as src1 and src2. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Stride of output image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, dstStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageDifff32( const float* __restrict src1, const float* __restrict src2, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Performs image difference by promoting both src1 and src 2 to /// floating point values and then subracting src2 from src1. dst=src1-src2. /// /// @details /// /// @param src1 /// First source image /// /// @param src2 /// Second source image, must be same size as src1. /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Stride of input image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b WARNING: must be multiple of 8. /// /// @param dst /// Destination image in float type /// \n\b NOTE: Must be same size as src1 and src2. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Stride of output image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b WARNING: must be multiple of 8. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageDiffu8f32( const uint8_t* __restrict src1, const uint8_t* __restrict src2, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Performs image difference by subracting src2 from src1. /// dst = ( src1 >> 1) - ( src2 >> 1). /// /// @details /// /// @param src1 /// First source image /// /// @param src2 /// Second source image, must be same size as src1. /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Stride of input image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b WARNING: must be multiple of 8. /// /// @param dst /// Destination image in int8 type /// \n\b NOTE: Must be same size as src1 and src2. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Stride of output image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b WARNING: must be multiple of 8. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageDiffu8s8( const uint8_t* __restrict src1, const uint8_t* __restrict src2, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int8_t* __restrict dst, unsigned int dstStride ); //--------------------------------------------------------------------------- /// @brief /// Creates 2D gradient from source illuminance data. /// This function considers only the left/right neighbors /// for x-gradients and top/bottom neighbors for y-gradients. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientInterleaveds16_v2(). In the 2.0.0 release, /// fcvImageGradientInterleaveds16_v2 will be renamed to fcvImageGradientInterleaveds16 /// and the signature of fcvImageGradientInterleaveds16 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param gradients /// Buffer to store gradient. Must be 2*(width-1)*(height-1) in size. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientInterleaveds16( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict gradients ); //--------------------------------------------------------------------------- /// @brief /// Creates 2D gradient from source illuminance data. /// This function considers only the left/right neighbors /// for x-gradients and top/bottom neighbors for y-gradients. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageGradientInterleaveds16() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageGradientInterleaveds16, /// \a fcvImageGradientInterleaveds16_v2 will be removed, and the current signature /// for \a fcvImageGradientInterleaveds16 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageGradientInterleaveds16 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param gradients /// Buffer to store gradient. Must be 2*(width-1)*(height-1) in size. /// /// @param gradStride /// Stride in bytes of the interleaved gradients array. /// \n\b NOTE: if 0, srcStride is set as 4*(srcWidth-2). /// \n\b WARNING: must be multiple of 16 ( 8 * 2-byte values ), and at least as much as 4*(srcWidth-2) if not 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientInterleaveds16_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict gradients, unsigned int gradStride ); //--------------------------------------------------------------------------- /// @brief /// Function to initialize MSER. To invoke MSER functionality, 3 functions have to be called: /// fcvMserInit, fcvMseru8, fcvMserRelease. /// /// Heris the typical usage: /// /// void *mserHandle; /// if (fcvMserInit (width,........,&mserHandle)) /// { /// fcvmseru8 (mserHandle,...); /// fcvRelease(mserHandle); /// } /// /// /// @param width Width of the image for which MSER has to be done. /// @param height Height of the image for which MSER has to be done. /// @param delta Delta to be used in MSER algorithm (the difference in grayscale /// values within which the region is stable ). /// Typical value range [0.8 8], typical value 2 /// @param minArea Minimum area (number of pixels) of a mser contour. /// Typical value range [10 50], typical value 30 /// @param maxArea Maximum area (number of pixels) of a mser contour. /// Typical value 14400 or 0.25*width*height /// @param maxVariation Maximum variation in grayscale between 2 levels allowed. /// Typical value range [0.1 1.0], typical value 0.15 /// @param minDiversity Minimum diversity in grayscale between 2 levels allowed. /// Typical value range [0.1 1.0], typical value 0.2 /// @param mserHandle Return value: the mserHandle to be used in subsequent calls. /// /// @return int 1 if mserInit is successful, if 0, mserHandle is invalid. /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API int fcvMserInit(const unsigned int width, const unsigned int height, unsigned int delta, unsigned int minArea , unsigned int maxArea , float maxVariation , float minDiversity , void ** mserHandle ); //--------------------------------------------------------------------------- /// @brief /// Function to release MSER resources. /// /// /// /// @param mserHandle Handle to be used to free up MSER resources. /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API void fcvMserRelease(void *mserHandle); ///--------------------------------------------------------------------------- /// @brief /// Function to invoke MSER. /// /// \n\b ATTENTION: The signature of this function will be changed to reduce complexity /// and memory usage when the 2.0.0 release of this library is made. /// Until 2.0.0, the developer should use this implementation with the expectation of /// moving to a different signature when transitioning to 2.0.0. /// \n\n /// /// /// @param mserHandle The MSER Handle returned by init. /// @param srcPtr Pointer to an image array (unsigned char ) for which MSER has to be done. /// @param srcWidth Width of the source image. /// @param srcHeight Height of the source image. /// @param srcStride Stride of the source image. /// @param maxContours Maximum contours that will be returned. Must be set to 2x the maximum contours. /// @param numContours Output, Number of MSER contours in the region. /// @param numPointsInContour Output, Number of points in each contour. This will have values filled up /// for the first (*numContours) values. This memory has to be allocated by /// the caller. /// @param pointsArraySize Size of the output points Array. /// Typical size: (# of pixels in source image) * 30 /// @param pointsArray Output. This is the points in all the contours. This is a linear array, whose memory /// has to be allocated by the caller. /// Typical allocation size: pointArraySize /// pointsArray[0...numPointsInContour[0]-1] defines the first MSER region, /// pointsArray[numPointsInContour[0] .. numPointsInContour[1]-1] defines 2nd MSER region /// and so on. /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API void fcvMseru8( void *mserHandle, const uint8_t* __restrict srcPtr,unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, unsigned int maxContours, unsigned int * __restrict numContours, unsigned int * __restrict numPointsInContour , unsigned int pointsArraySize, unsigned int* __restrict pointsArray ); ///--------------------------------------------------------------------------- /// @brief /// Function to invoke MSER, with additional outputs for each contour. /// /// \n\b ATTENTION: The signature of this function will be changed to reduce complexity /// and memory usage when the 2.0.0 release of this library is made. /// Until 2.0.0, the developer should use this implementation with the expectation of /// moving to a different signature when transitioning to 2.0.0. /// \n\n /// /// @param mserHandle The MSER Handle returned by init. /// @param srcPtr Pointer to an image array (unsigned char ) for which MSER has to be done. /// @param srcWidth Width of the source image. /// @param srcHeight Height of the source image. /// @param srcStride Stride of the source image. /// @param maxContours Maximum contours that will be returned. Need to be set to 2x the maximum contours. /// Application dependent. OCR usually requires 100-1000 contours /// Segmentation usually requires 50-100 /// @param numContours Output, Number of MSER contours in the region. /// @param numPointsInContour Output, Number of points in each contour. This will have values filled up /// for the first (*numContours) values. This memory has to be allocated by /// the caller. /// @param pointsArraySize Size of the output points Array. /// Typical size: (# of pixels in source image)*30 /// @param pointsArray Output. This is the points in all the contours. This is a linear array, whose memory /// has to be allocated by the caller. /// Typical allocation size: pointArraySize /// pointsArray[0...numPointsInContour[0]-1] defines the first MSER region; /// pointsArray[numPointsInContour[0] .. numPointsInContour[1]-1] defines 2nd MSER region /// and so on. /// @param contourVariation Output, Variation for each contour from previous grey level. /// This will have values filled up /// for the first (*numContours) values. This memory has to be allocated by /// the caller with size of maxContours. /// @param contourPolarity Output, Polarity for each contour. This value is 1 if this is a MSER+ region, /// -1 if this is a MSER- region. . This will have values filled up /// for the first (*numContours) values. This memory has to be allocated by /// the caller with size of maxContours. /// @param contourNodeId Output, Node id for each contour. This will have values filled up /// for the first (*numContours) values. This memory has to be allocated by /// the caller with size of maxContours /// @param contourNodeCounter Output, Node counter for each contour. This will have values filled up /// for the first (*numContours) values. This memory has to be allocated by /// the caller with size of maxContours. /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API void fcvMserExtu8( void *mserHandle, const uint8_t* __restrict srcPtr,unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, unsigned int maxContours, unsigned int * __restrict numContours, unsigned int * __restrict numPointsInContour , unsigned int* __restrict pointsArray, unsigned int pointsArraySize, unsigned int * __restrict contourVariation, int * __restrict contourPolarity, unsigned int * __restrict contourNodeId, unsigned int * __restrict contourNodeCounter ); //--------------------------------------------------------------------------- /// @brief /// Creates 2D gradient from source illuminance data. /// This function considers only the left/right neighbors /// for x-gradients and top/bottom neighbors for y-gradients. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientInterleavedf32_v2(). In the 2.0.0 release, /// fcvImageGradientInterleavedf32_v2 will be renamed to fcvImageGradientInterleavedf32 /// and the signature of fcvImageGradientInterleavedf32 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param gradients /// Buffer to store gradient. Must be 2*(width-1)*(height-1) in size. /// \n\b NOTE: data should be 128-bit aligned. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientInterleavedf32( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* __restrict gradients ); //--------------------------------------------------------------------------- /// @brief /// Creates 2D gradient from source illuminance data. /// This function considers only the left/right neighbors /// for x-gradients and top/bottom neighbors for y-gradients. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageGradientInterleavedf32() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageGradientInterleavedf32, /// \a fcvImageGradientInterleavedf32_v2 will be removed, and the current signature /// for \a fcvImageGradientInterleavedf32 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageGradientInterleavedf32 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param gradients /// Buffer to store gradient. Must be 2*(width-1)*(height-1) in size. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param gradStride /// Stride (in bytes) of the interleaved gradients array. /// \n\b NOTE: if 0, srcStride is set as (srcWidth-2)*2*sizeof(float). /// \n\b WARNING: must be multiple of 32 ( 8 * 4-byte values ), and at least as much as 8 * srcWidth if not 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientInterleavedf32_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* __restrict gradients, unsigned int gradStride ); //--------------------------------------------------------------------------- /// @brief /// Creates 2D gradient from source illuminance data. /// This function considers only the left/right neighbors /// for x-gradients and top/bottom neighbors for y-gradients. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientPlanars16_v2(). In the 2.0.0 release, /// fcvImageGradientPlanars16_v2 will be renamed to fcvImageGradientPlanars16 /// and the signature of fcvImageGradientPlanars16 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param dx /// Buffer to store horizontal gradient. Must be (srcWidth)*(srcHeight) in size. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (srcWidth)*(srcHeight) in size. /// \n\b NOTE: data should be 128-bit aligned. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientPlanars16( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict dx, int16_t* __restrict dy ); //--------------------------------------------------------------------------- /// @brief /// Creates 2D gradient from source illuminance data. /// This function considers only the left/right neighbors /// for x-gradients and top/bottom neighbors for y-gradients. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageGradientPlanars16() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageGradientPlanars16, /// \a fcvImageGradientPlanars16_v2 will be removed, and the current signature /// for \a fcvImageGradientPlanars16 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageGradientPlanars16 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dx /// Buffer to store horizontal gradient. Must be (srcWidth)*(srcHeight) in size. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (srcWidth)*(srcHeight) in size. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dxyStride /// Stride (in bytes) of 'dx' and 'dy' arrays. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 16 (8 * 2-bytes per gradient value), and at least as much as srcWidth if not 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientPlanars16_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict dx, int16_t* __restrict dy, unsigned int dxyStride ); //--------------------------------------------------------------------------- /// @brief /// Creates 2D gradient from source illuminance data. /// This function considers only the left/right neighbors /// for x-gradients and top/bottom neighbors for y-gradients. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientPlanarf32_v2(). In the 2.0.0 release, /// fcvImageGradientPlanarf32_v2 will be renamed to fcvImageGradientPlanarf32 /// and the signature of fcvImageGradientPlanarf32 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// /// @param dx /// Buffer to store horizontal gradient. Must be (width)*(height) in size. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (width)*(height) in size. /// \n\b NOTE: data should be 128-bit aligned. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientPlanarf32( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* __restrict dx, float* __restrict dy ); //--------------------------------------------------------------------------- /// @brief /// Creates 2D gradient from source illuminance data. /// This function considers only the left/right neighbors /// for x-gradients and top/bottom neighbors for y-gradients. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageGradientPlanarf32() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageGradientPlanarf32, /// \a fcvImageGradientPlanarf32_v2 will be removed, and the current signature /// for \a fcvImageGradientPlanarf32 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageGradientPlanarf32 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dx /// Buffer to store horizontal gradient. Must be (srcWidth)*(srcHeight) in size. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (srcWidth)*(srcHeight) in size. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dxyStride /// Stride of Gradient values ('dx' and 'dy' arrays) measured in bytes. /// \n\b NOTE: if 0, srcStride is set as 4*srcWidth. /// \n\b WARNING: must be multiple of 32 (8 * 4-bytes per gradient value), and at least as much as 4*srcWidth if not 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientPlanarf32_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* __restrict dx, float* __restrict dy, unsigned int dxyStride ); //------------------------------------------------------------------------------ /// @brief /// Extracts FAST corners from the image. This function tests the whole image /// for corners (apart from the border). FAST-9 looks for continuous segments on the /// pixel ring of 9 pixels or more. /// /// @param src /// Pointer to grayscale image with one byte per pixel /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Input image width /// \n\b WARNING: must be a multiple of 8. /// \n\b WARNING: must be <= 2048. /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). If 0 is passed, srcStride is set to width. /// \n\b WARNING: must be a multiple of 8. /// /// @param barrier /// FAST threshold. The threshold is used to compare difference between intensity value of /// the central pixel and pixels on a circle surrounding this pixel. /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// pointer to the output array containing the interleaved x,y position of the /// detected corners /// \n e.g. struct { int x, y; } xy; /// \n\b WARNING: must be 128-bit aligned. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// /// @param nCornersMax /// Maximum number of corners. The function exits when the maximum number of /// corners is exceeded /// /// @param nCorners /// pointer to an integer storing the number of corners detected /// /// @return /// 0 if successful. /// /// /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvCornerFast9u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int barrier, unsigned int border, uint32_t* __restrict xy, unsigned int nCornersMax, uint32_t* __restrict nCorners ); //------------------------------------------------------------------------------ /// @brief /// Extracts FAST corners from the image. This function takes a bit mask so /// that only image areas masked with '0' are tested for corners (if these /// areas are also not part of the border). FAST-9 looks for continuous segments on the /// pixel ring of 9 pixels or more. /// /// @param src /// pointer to grayscale image with one byte per pixel /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// image width /// \n\b WARNING: must be <= 2048. /// \n\b WARNING: must be a multiple of 8. /// /// @param srcHeight /// image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// \n\b WARNING: must be a multiple of 8. If left at 0 srcStride is default to srcWidth. /// /// @param barrier /// FAST threshold. The threshold is used to compare difference between intensity value of /// the central pixel and pixels on a circle surrounding this pixel. /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// pointer to the output array containing the interleaved x,y position of the /// detected corners /// \n\b WARNING: must be 128-bit aligned. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// /// @param nCornersMax /// Maximum number of corners. The function exits when the maximum number of corners /// is exceeded /// /// @param nCorners /// pointer to an integer storing the number of corners detected /// /// @param mask /// Per-pixel mask for each pixel represented in input image. /// If a bit set to 0, pixel will be a candidate for corner detection. /// If a bit set to 1, pixel will be ignored. /// /// @param maskWidth /// Width of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @param maskHeight /// Height of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @return /// 0 if successful. /// /// /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvCornerFast9InMasku8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int barrier, unsigned int border, uint32_t* __restrict xy, unsigned int nCornersMax, uint32_t* __restrict nCorners, const uint8_t* __restrict mask, unsigned int maskWidth, unsigned int maskHeight ); //------------------------------------------------------------------------------ /// @brief /// Extracts FAST corners from the image. This function tests the whole image /// for corners (apart from the border). FAST-10 looks for continuous segments on the /// pixel ring of 10 pixels or more. /// /// @param src /// Pointer to grayscale image with one byte per pixel /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Input image width /// \n\b WARNING: must be a multiple of 8. /// \n\b WARNING: must be <= 2048. /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). If 0 is passed, srcStride is set to width. /// /// @param barrier /// FAST threshold. The threshold is used to compare difference between intensity value of /// the central pixel and pixels on a circle surrounding this pixel. /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// pointer to the output array containing the interleaved x,y position of the /// detected corners /// \n e.g. struct { int x, y; } xy; /// \n\b WARNING: must be 128-bit aligned. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// /// @param nCornersMax /// Maximum number of corners. The function exists when the maximum number of /// corners is exceeded /// /// @param nCorners /// pointer to an integer storing the number of corners detected /// /// @return /// 0 if successful. /// /// /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvCornerFast10u8( const uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int32_t barrier, uint32_t border, uint32_t* __restrict xy, uint32_t nCornersMax, uint32_t* __restrict nCorners); //------------------------------------------------------------------------------ /// @brief /// Extracts FAST corners from the image. This function takes a bit mask so /// that only image areas masked with '0' are tested for corners (if these /// areas are also not part of the border). FAST-10 looks for continuous segments on the /// pixel ring of 10 pixels or more. /// /// @param src /// pointer to grayscale image with one byte per pixel /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// image width /// \n\b WARNING: must be <= 2048. /// \n\b WARNING: must be a multiple of 8. /// /// @param srcHeight /// image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param barrier /// FAST threshold. The threshold is used to compare difference between intensity value of /// the central pixel and pixels on a circle surrounding this pixel. /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// pointer to the output array containing the interleaved x,y position of the /// detected corners /// \n\b WARNING: must be 128-bit aligned. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// /// @param nCornersMax /// Maximum number of corners. The function exists when the maximum number of corners /// is exceeded /// /// @param nCorners /// pointer to an integer storing the number of corners detected /// /// @param mask /// Per-pixel mask for each pixel represented in input image. /// If a bit set to 0, pixel will be a candidate for corner detection. /// If a bit set to 1, pixel will be ignored. /// /// @param maskWidth /// Width of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @param maskHeight /// Height of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @return /// 0 if successful. /// /// /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvCornerFast10InMasku8( const uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int32_t barrier, uint32_t border, uint32_t* __restrict xy, uint32_t nCornersMax, uint32_t* __restrict nCorners, const uint8_t* __restrict mask, uint32_t maskWidth, uint32_t maskHeight ); //------------------------------------------------------------------------------ /// @brief /// Extracts Harris corners from the image. This function tests the whole /// image for corners (apart from the border). /// /// @param src /// Pointer to grayscale image with one byte per pixel /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Input image width /// \n\b WARNING: must be a multiple of 8. /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// pointer to the output array containing the interleaved x,y position of the /// detected corners /// \n\b WARNING: must be 128-bit aligned. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// /// @param nCornersMax /// Maximum number of corners. The function exits when the maximum number of /// corners is exceeded /// /// @param nCorners /// pointer to an integer storing the number of corners detected /// /// @param threshold /// Minimum "Harris Score" or "Harris Corner Response" of a pixel for it to be /// regarded as a corner. /// /// @return /// 0 if successful. /// /// /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvCornerHarrisu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, unsigned int border, uint32_t* __restrict xy, unsigned int nCornersMax, uint32_t* __restrict nCorners, int threshold ); //------------------------------------------------------------------------------ /// @brief /// Local Harris Max applies the Harris Corner algorithm on an 11x11 patch /// within an image to determine if a corner is present. /// /// @param src /// Pointer to grayscale image with one byte per pixel /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Input image width /// \n\b WARNING: must be a multiple of 8. /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). If srcStride == 0, then will use srcWidth. /// /// @param posX /// Center X coordinate of the search window /// /// @param posY /// Center Y coordinate of the search window /// /// @param maxX /// pointer to the X coordinate identified as a corner /// /// @param maxY /// pointer to the Y coordinate identified as a corner /// /// @param maxScore /// pointer to the Harris score associated with the corner /// /// @return /// 0 if no corner is found (maxX, maxY, and maxScore are invalid) /// or if posX and/or posY position the patch outside of the range of /// the source image. /// 1 if a corner is found (maxX, maxY, and maxScore are valid) /// /// /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API unsigned int fcvLocalHarrisMaxu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, unsigned int posX, unsigned int posY, unsigned int *maxX, unsigned int *maxY, int *maxScore); //------------------------------------------------------------------------------ /// @brief /// Extracts Harris corners from the image. This function takes a bit mask so /// that only image areas masked with '0' are tested for corners (if these /// areas are also not part of the border). /// /// @param src /// pointer to grayscale image with one byte per pixel /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// image width /// \n\b WARNING: must be a multiple of 8. /// /// @param srcHeight /// image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// pointer to the output array containing the interleaved x,y position of the /// detected corners /// \n\b WARNING: must be 128-bit aligned. /// /// @param nCornersMax /// Maximum number of corners. The function exits when the maximum number of corners /// is exceeded /// /// @param nCorners /// pointer to an integer storing the number of corners detected /// /// @param threshold /// Minimum "Harris Score" or "Harris Corner Respose" of a pixel for it to be /// regarded as a corner. /// /// @param mask /// Per-pixel mask for each pixel represented in input image. /// If a bit set to 0, pixel will be a candidate for corner detection. /// If a bit set to 1, pixel will be ignored. /// /// @param maskWidth /// Width of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @param maskHeight /// Height of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @return /// 0 if successful. /// /// /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvCornerHarrisInMasku8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, unsigned int border, uint32_t* __restrict xy, unsigned int nCornersMax, uint32_t* __restrict nCorners, int threshold, const uint8_t* __restrict mask, unsigned int maskWidth, unsigned int maskHeight ); //--------------------------------------------------------------------------- /// @brief /// Computes affine trans. for a given set of corresponding features points /// using a linear least square colver based on Cholkesky decomposition. /// /// @param corrs /// Correspondence data struct containing coords of points in two frames /// /// @param affine /// 3 x 3 affine matrix (computed best fit affine transformation) /// /// @ingroup 3D_reconstruction //--------------------------------------------------------------------------- FASTCV_API void fcvGeomAffineFitf32( const fcvCorrespondences* __restrict corrs, float* __restrict affine ); //------------------------------------------------------------------------------ /// @brief /// Evaluates specified affine transformation against provided points /// correspondences. Checks which correspondence members have a projection /// error that is smaller than the given one (maxSquErr). /// /// @param corrs /// Pointer to correspondences structure. /// /// @param affine /// Affine matrix representing relationship between ptTo and ptFrom /// correspondences stored as 3x3 floating point matrix formatted as /// @todo r0h0, r0h1 /// Pointer storage must be at least a 9-element floating point array. /// /// @param maxsqerr /// Maximum error value squared. /// /// @param inliers /// Output array for those indices that passed the test - the array MUST /// be able to store numIndices items. /// /// @param numinliers /// Output number of corrs that passed the test. /// /// @return /// /// /// /// @ingroup 3D_reconstruction //------------------------------------------------------------------------------ FASTCV_API int fcvGeomAffineEvaluatef32( const fcvCorrespondences* __restrict corrs, float* __restrict affine, float maxsqerr, uint16_t* __restrict inliers, int32_t* numinliers ); //------------------------------------------------------------------------------ /// @brief /// Performs cholesky homography fitting on specified points correspondences. /// /// @details /// Output precision is within 3e-3 /// /// @param corrs /// Pointer to correspondences structure. /// /// @param homography /// 3x3 floating point matrix formatted as @todo r0h0, r0h1 /// Pointer storage must be at least a 9-element floating point array. /// /// /// /// @ingroup 3D_reconstruction //------------------------------------------------------------------------------ FASTCV_API void fcvGeomHomographyFitf32( const fcvCorrespondences* __restrict corrs, float* __restrict homography ); //------------------------------------------------------------------------------ /// @brief /// Evaluates specified homography against provided points correspondences. /// Check which correspondence members have a projection error that is /// smaller than the given one (maxSquErr). /// /// @param corrs /// Pointer to correspondences structure. /// /// @param homography /// Homography representing relationship between ptTo and ptFrom /// correspondences stored as 3x3 floating point matrix formatted as /// @todo r0h0, r0h1 /// Pointer storage must be at least a 9-element floating point array. /// /// @param maxsqerr /// Maximum error value squared. /// /// @param inliers /// Output array for those indices that passed the test - the array MUST /// be able to store numIndices items. /// /// @param numinliers /// Output number of corrs that passed the test. /// /// @return /// 0 that error is less than maximum error, -1 greater or equal to maximum /// error. /// /// /// /// @ingroup 3D_reconstruction //------------------------------------------------------------------------------ FASTCV_API int fcvGeomHomographyEvaluatef32( const fcvCorrespondences* __restrict corrs, float* __restrict homography, float maxsqerr, uint16_t* __restrict inliers, int32_t* numinliers ); //------------------------------------------------------------------------------ /// @brief /// Performs cholesky pose fitting on specified points correspondences. /// Takes a pose and uses the correspondences to refine it using iterative /// Gauss-Newton optimization. /// /// @param corrs /// Pointer to correspondences structure. /// /// @param minIterations /// Minimum number of iterations to refine. /// /// @param maxIterations /// Maximum number of iterations to refine. /// /// @param stopCriteria /// Improvement threshold, iterations stop if improvement is less than this /// value. /// /// @param initpose /// Pose representing initial pose /// correspondences stored as a /// 3x4 transformation matrix in the form [R|t], where R is a 3x3 rotation /// matrix and t is the translation vector. The matrix stored in pose is row /// major ordering: \n /// a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34 where the /// matrix is: \n /// | a11, a12, a13 , a14|\n /// | a21, a22, a23, a24 |\n /// | a31, a32, a33, a34 |\n /// Pointer storage must be at least a 12-element floating point array. /// /// @param refinedpose /// Pose representing refined pose /// correspondences stored as a /// 3x4 transformation matrix in the form [R|t], where R is a 3x3 rotation /// matrix and t is the translation vector. The matrix stored in pose is row /// major ordering: \n /// a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34 where the /// matrix is: \n /// | a11, a12, a13 , a14|\n /// | a21, a22, a23, a24 |\n /// | a31, a32, a33, a34 |\n /// Pointer storage must be at least a 12-element floating point array. /// /// @return /// Final reprojection error. /// /// /// /// @ingroup 3D_reconstruction //------------------------------------------------------------------------------ FASTCV_API float fcvGeomPoseRefineGNf32( const fcvCorrespondences* __restrict corrs, short minIterations, short maxIterations, float stopCriteria, float* initpose, float* refinedpose ); //------------------------------------------------------------------------------ /// @brief /// Update and compute the differential pose based on the specified points correspondences /// This function and fcvGeomPoseOptimizeGNf32 /// can be used iteratively to perform poseRefine GN. /// /// @param projected /// 2D position after projection /// /// @param reprojErr /// 2D reprojection error in camera coordinates (not in pixels!) /// /// @param invz /// Inverse depth (z) /// /// @param reprojVariance /// Reprojection variance in camera coordinates /// /// @param numpts /// Number of points /// /// @param pose /// Pose representing differential pose /// correspondences stored as a /// 3x4 transformation matrix in the form [R|t], where R is a 3x3 rotation /// matrix and t is the translation vector. The matrix stored in pose is row /// major ordering: \n /// a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34 where the /// matrix is: \n /// | a11, a12, a13 , a14|\n /// | a21, a22, a23, a24 |\n /// | a31, a32, a33, a34 |\n /// Pointer storage must be at least a 12-element floating point array. /// /// @return /// 0 if successfully clustered, otherwise error code /// /// /// /// @ingroup 3D_reconstruction //------------------------------------------------------------------------------ FASTCV_API int fcvGeomPoseUpdatef32( const float* __restrict projected, const float* __restrict reprojErr, const float* __restrict invz, const float* __restrict reprojVariance, unsigned int numpts, float* __restrict pose ); //------------------------------------------------------------------------------ /// @brief /// Update the pose based on the specified points correspondences /// using Gauss-Newton optimization. This function and fcvGeomPoseEvaluateErrorf32 /// can be used iteratively to perform poseRefine GN. /// /// @param projected /// 2D position after projection /// /// @param reprojErr /// 2D reprojection error in camera coordinates (not in pixels!) /// /// @param invz /// Inverse depth (z) /// /// @param reprojVariance /// Reprojection variance in camera coordinates /// /// @param numpts /// Number of points /// /// @param pose /// Pose representing updated pose /// correspondences stored as a /// 3x4 transformation matrix in the form [R|t], where R is a 3x3 rotation /// matrix and t is the translation vector. The matrix stored in pose is row /// major ordering: \n /// a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34 where the /// matrix is: \n /// | a11, a12, a13 , a14|\n /// | a21, a22, a23, a24 |\n /// | a31, a32, a33, a34 |\n /// Pointer storage must be at least a 12-element floating point array. /// /// @return /// 0 if successfully clustered, otherwise error code /// /// /// /// @ingroup 3D_reconstruction //------------------------------------------------------------------------------ FASTCV_API int fcvGeomPoseOptimizeGNf32( const float* __restrict projected, const float* __restrict reprojErr, const float* __restrict invz, const float* __restrict reprojVariance, unsigned int numpts, float* __restrict pose ); //------------------------------------------------------------------------------ /// @brief /// Calculate the reprojection error based on the input pose. /// This function and fcvGeomPoseOptimizef32 can be used iteratively /// to perform poseRefine (GN or LM).. /// /// @param corrs /// Pointer to correspondences structure. /// /// @param pose /// Pose representing updated pose /// correspondences stored as a /// 3x4 transformation matrix in the form [R|t], where R is a 3x3 rotation /// matrix and t is the translation vector. The matrix stored in pose is row /// major ordering: \n /// a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34 where the /// matrix is: \n /// | a11, a12, a13 , a14|\n /// | a21, a22, a23, a24 |\n /// | a31, a32, a33, a34 |\n /// Pointer storage must be at least a 12-element floating point array. /// /// @param projected /// 2D position after projection /// /// @param reprojErr /// 2D reprojection error in camera coordinates (not in pixels!) /// /// @param invz /// Inverse depth (z) /// /// @param reprojVariance /// Reprojection variance in camera coordinates /// /// @return /// Reprojection error. /// /// /// /// @ingroup 3D_reconstruction //------------------------------------------------------------------------------ FASTCV_API float fcvGeomPoseEvaluateErrorf32( const fcvCorrespondences* __restrict corrs, const float* __restrict pose, float* __restrict projected, float* __restrict reprojErr, float* __restrict invz, float* __restrict reprojVariance ); //------------------------------------------------------------------------------ /// @brief /// Checks which members have a projection error that is smaller than the /// given one. /// /// @param corrs /// Pointer to correspondences structure. /// /// @param pose /// Pose representing relationship between ptTo and ptFrom /// correspondences stored as a /// 3x4 transformation matrix in the form [R|t], where R is a 3x3 rotation /// matrix and t is the translation vector. The matrix stored in pose is row /// major ordering: \n /// a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34 where the /// matrix is: \n /// | a11, a12, a13 , a14|\n /// | a21, a22, a23, a24 |\n /// | a31, a32, a33, a34 |\n /// Pointer storage must be at least a 12-element floating point array. /// /// @param maxSquErr /// Maximum error value squared. /// /// @param inliers /// Output array for those indices that passed the test - the array MUST /// be able to store numIndices items. /// /// @param numInliers /// Output number of corrs that passed the test. /// /// @return /// 0 that error is less than maximum error, -1 greater or equal to maximum /// error. /// /// /// /// @ingroup 3D_reconstruction //------------------------------------------------------------------------------ FASTCV_API int fcvGeomPoseEvaluatef32( const fcvCorrespondences* __restrict corrs, const float* pose, float maxSquErr, uint16_t* __restrict inliers, uint32_t* numInliers ); //------------------------------------------------------------------------------ /// @brief /// Estimates a 6DOF pose /// \n\b NOTE: Given the coordinates of three 3D points (in world reference frame), /// and their corresponding perspective projections in an image, /// this algorithm determines the position and orientation of the camera in /// the world reference frame. The function provides up to four solutions /// that can be disambiguated using a fourth point. /// When used in conjunction with RANSAC, this function can perform efficient outlier rejection. /// Two degenerate cases should be avoided when using this function: /// - Indeterminate configuration: /// When the three points are collinear in space, there will be a family of poses mapping the /// three points to the same image points. /// - Unstable configuration: /// The camera center is located on a circular cylinder passing through the three points and /// the camera optical axis is perpendicular to the plane derived by the three points. /// With this configuration, a small change in the position of the three points will /// result in a large change of the estimated pose.. /// /// @param corrs /// 2D-3D correspondence points /// /// @param pose /// computed pose (numPoses * 12 data) /// /// @param numPoses (max = 4) /// /// @ingroup 3D_reconstruction //------------------------------------------------------------------------------ FASTCV_API void fcvGeom3PointPoseEstimatef32( const fcvCorrespondences* __restrict corrs, float* pose, int32_t* numPoses ); //------------------------------------------------------------------------------ /// @brief /// 3x3 correlation with non-separable kernel. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterCorr3x3s8_v2(). In the 2.0.0 release, /// fcvFilterCorr3x3s8_v2 will be renamed to fcvFilterCorr3x3s8 /// and the signature of fcvFilterCorr3x3s8 as it appears now, /// will be removed. /// \n\n /// /// @param kernel /// 2-D 3x3 kernel. /// \n\b NOTE: Normalized to Q4.4 /// /// @param src /// Input image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be an even number /// /// @param srcHeight /// Image height. /// \n\b NOTE: must be an even number /// /// @param dst /// Output convolution. Border values are ignored in this function. /// Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: Must be same size as src /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterCorr3x3s8( const int8_t* __restrict kernel, const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// 3x3 correlation with non-separable kernel. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterCorr3x3s8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterCorr3x3s8, /// \a fcvFilterCorr3x3s8_v2 will be removed, and the current signature /// for \a fcvFilterCorr3x3s8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterCorr3x3s8 when transitioning to 2.0.0. /// \n\n /// /// @param kernel /// 2-D 3x3 kernel. /// \n\b NOTE: Normalized to Q4.4 /// /// @param src /// Input image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be an even number /// /// @param srcHeight /// Image height. /// \n\b NOTE: must be an even number /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output convolution. Size of buffer is dstStride*srcHeight bytes. /// \n\b NOTE: Must be same size as src /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Output stride. Border values are ignored in this function. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterCorr3x3s8_v2( const int8_t* __restrict kernel, const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// 9x9 correlation with separable kernel. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterCorrSep9x9s16_v2(). In the 2.0.0 release, /// fcvFilterCorrSep9x9s16_v2 will be renamed to fcvFilterCorrSep9x9s16 /// and the signature of fcvFilterCorrSep9x9s16 as it appears now, /// will be removed. /// \n\n /// /// @param kernel /// 1-D kernel in Q15. /// \n\b WARNING: must be 128-bit aligned. /// /// @param src /// Input image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// \n\b WARNING: must be > 8. /// /// @param srcHeight /// Image height. /// /// @param tmp /// Temporary image buffer used internally. /// Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: Must be same size as src /// \n\b WARNING: must be 128-bit aligned. /// /// @param dst /// Output correlation. Border values are ignored in this function. /// Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: Must be same size as src /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterCorrSep9x9s16( const int16_t* __restrict kernel, const int16_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, int16_t* __restrict tmp, int16_t* __restrict dst ); //--------------------------------------------------------------------------- /// @brief /// 9x9 FIR filter (convolution) with seperable kernel. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterCorrSep9x9s16() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterCorrSep9x9s16, /// \a fcvFilterCorrSep9x9s16_v2 will be removed, and the current signature /// for \a fcvFilterCorrSep9x9s16 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterCorrSep9x9s16 when transitioning to 2.0.0. /// \n\n /// /// @param kernel /// 1-D kernel. /// /// @param srcImg /// Input image. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned /// /// @param srcWidth /// Image tile width. /// /// @param srcHeight /// Image tile height. /// /// @param srcStride /// source Image width /// /// @param tmpImg /// Temporary image scratch space used internally. /// \n\b NOTE: Size = width * ( height + knlSize - 1 ) /// \n\b NOTE: data should be 128-bit aligned /// /// @param dstImg /// Output correlation. Border values are ignored in this function. /// Size of buffer is dstStride*srcHeight bytes. /// \n\b NOTE: Size = width * heigth /// \n\b NOTE: data should be 128-bit aligned /// /// @param dstStride /// dst Image width /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvFilterCorrSep9x9s16_v2( const int16_t* __restrict kernel, const int16_t* __restrict srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict tmpImg, int16_t* __restrict dstImg, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// 11x11 correlation with separable kernel. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterCorrSep11x11s16_v2(). In the 2.0.0 release, /// fcvFilterCorrSep11x11s16_v2 will be renamed to fcvFilterCorrSep11x11s16 /// and the signature of fcvFilterCorrSep11x11s16 as it appears now, /// will be removed. /// \n\n /// /// @param kernel /// 1-D kernel. /// \n\b NOTE: array must be >=12 elements with kernel[11]=0 /// \n\b WARNING: must be 128-bit aligned. /// \n\b NOTE: Normalized to Q1.15 /// /// @param src /// Input image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// \n\b WARNING: must be > 8. /// /// @param srcHeight /// Image height. /// /// @param tmpImg /// Temporary image scratch space used internally. /// \n\b NOTE: Must be same size as src /// \n\b WARNING: must be 128-bit aligned. /// /// @param dst /// Output correlation. Border values are ignored in this function. /// Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: Must be same size as src /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterCorrSep11x11s16( const int16_t* __restrict kernel, const int16_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, int16_t* __restrict tmpImg, int16_t* __restrict dst ); //--------------------------------------------------------------------------- /// @brief /// 11x11 FIR filter (convolution) with seperable kernel. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterCorrSep11x11s16() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterCorrSep11x11s16, /// \a fcvFilterCorrSep11x11s16_v2 will be removed, and the current signature /// for \a fcvFilterCorrSep11x11s16 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterCorrSep11x11s16 when transitioning to 2.0.0. /// \n\n /// /// @param kernel /// 1-D kernel. /// \n\b NOTE: data should be 128-bit aligned /// /// @param srcImg /// Input image. Size of buffer is srStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned /// /// @param srcWidth /// Image tile width. /// \n\b WARNING: must be multiple of 8. /// \n\b WARNING: must be > 8. /// /// @param srcHeight /// Image tile height. /// /// @param srcStride /// source Image width /// /// @param tmpImg /// Temporary image scratch space used internally. /// \n\b NOTE: Size = width * ( height + knlSize - 1 ) /// \n\b NOTE: data should be 128-bit aligned /// /// @param dstImg /// Output correlation. Border values are ignored in this function. /// \n\b NOTE: Size = dstStride * srcHeigth /// \n\b NOTE: data should be 128-bit aligned /// /// @param dstStride /// dst Image width /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvFilterCorrSep11x11s16_v2( const int16_t* __restrict kernel, const int16_t* __restrict srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict tmpImg, int16_t* __restrict dstImg, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// 13x13 correlation with separable kernel. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterCorrSep13x13s16_v2(). In the 2.0.0 release, /// fcvFilterCorrSep13x13s16_v2 will be renamed to fcvFilterCorrSep13x13s16 /// and the signature of fcvFilterCorrSep13x13s16 as it appears now, /// will be removed. /// \n\n /// /// @param kernel /// 1-D kernel. /// \n\b NOTE: Normalized to Q1.15 /// \n\b WARNING: must be 128-bit aligned. /// /// @param src /// Input image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// \n\b WARNING: must be > 8. /// /// @param srcHeight /// Image height. /// /// @param tmpImg /// Temporary image scratch space used internally. /// \n\b NOTE: Must be same size as src /// \n\b WARNING: must be 128-bit aligned. /// /// @param dst /// Output correlation. Border values are ignored in this function. /// \n\b NOTE: Must be same size as src /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterCorrSep13x13s16( const int16_t* __restrict kernel, const int16_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, int16_t* __restrict tmpImg, int16_t* __restrict dst ); //--------------------------------------------------------------------------- /// @brief /// 13x13 FIR filter (convolution) with seperable kernel. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterCorrSep13x13s16() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterCorrSep13x13s16, /// \a fcvFilterCorrSep13x13s16_v2 will be removed, and the current signature /// for \a fcvFilterCorrSep13x13s16 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterCorrSep13x13s16 when transitioning to 2.0.0. /// \n\n /// /// @param kernel /// 1-D kernel. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcImg /// Input image. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned /// /// @param srcWidth /// Image tile width. /// \n\b WARNING: must be multiple of 8. /// \n\b WARNING: must be > 8. /// /// @param srcHeight /// Image tile height. /// /// @param srcStride /// source Image width /// /// @param tmpImg /// Temporary image scratch space used internally. /// \n\b NOTE: Size = width * ( height + knlSize - 1 ) /// \n\b NOTE: data should be 128-bit aligned /// /// @param dstImg /// Output correlation. Border values are ignored in this function. /// \n\b NOTE: Size = dstStride * srcHeigth /// \n\b NOTE: data should be 128-bit aligned /// /// @param dstStride /// dst Image width /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvFilterCorrSep13x13s16_v2( const int16_t* __restrict kernel, const int16_t* __restrict srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict tmpImg, int16_t* __restrict dstImg, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// 15x15 correlation with separable kernel. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterCorrSep15x15s16_v2(). In the 2.0.0 release, /// fcvFilterCorrSep15x15s16_v2 will be renamed to fcvFilterCorrSep15x15s16 /// and the signature of fcvFilterCorrSep15x15s16 as it appears now, /// will be removed. /// \n\n /// /// @param kernel /// 1-D kernel. /// \n\b NOTE: array must be 16 elements with kernel[15]=0 /// \n\b NOTE: Normalized to Q1.15 /// \n\b NOTE: data should be 128-bit aligned /// /// @param src /// Input image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// \n\b WARNING: must be > 8. /// /// @param srcHeight /// Image height. /// /// @param tmpImg /// Temporary image scratch space used internally. /// \n\b NOTE: Must be same size as src /// \n\b NOTE: data should be 128-bit aligned /// /// @param dst /// Output correlation. Border values are ignored in this function. /// \n\b NOTE: Must be same size as src /// \n\b NOTE: data should be 128-bit aligned /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterCorrSep15x15s16( const int16_t* __restrict kernel, const int16_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, int16_t* __restrict tmpImg, int16_t* __restrict dst ); //--------------------------------------------------------------------------- /// @brief /// 15x15 FIR filter (convolution) with seperable kernel. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterCorrSep15x15s16() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterCorrSep15x15s16, /// \a fcvFilterCorrSep15x15s16_v2 will be removed, and the current signature /// for \a fcvFilterCorrSep15x15s16 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterCorrSep15x15s16 when transitioning to 2.0.0. /// \n\n /// /// @param kernel /// 1-D kernel. /// \n\b NOTE: array must be 16 elements with kernel[15]=0 /// \n\b NOTE: Normalized to Q1.15 /// \n\b NOTE: data should be 128-bit aligned /// /// @param srcImg /// Input image. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned /// /// @param srcWidth /// Image tile width. /// \n\b WARNING: must be multiple of 8. /// \n\b WARNING: must be > 8. /// /// @param srcHeight /// Image tile height. /// /// @param srcStride /// source Image width /// /// @param tmpImg /// Temporary image scratch space used internally. /// \n\b NOTE: Size = width * ( height + knlSize - 1 ) /// \n\b NOTE: data should be 128-bit aligned /// /// @param dstImg /// Output correlation. Border values are ignored in this function. /// \n\b NOTE: Size = dstStride * srcHeigth /// \n\b NOTE: data should be 128-bit aligned /// /// @param dstStride /// dst Image width /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvFilterCorrSep15x15s16_v2( const int16_t* __restrict kernel, const int16_t* __restrict srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict tmpImg, int16_t* __restrict dstImg, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// 17x17 correlation with separable kernel. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterCorrSep17x17s16_v2(). In the 2.0.0 release, /// fcvFilterCorrSep17x17s16_v2 will be renamed to fcvFilterCorrSep17x17s16 /// and the signature of fcvFilterCorrSep17x17s16 as it appears now, /// will be removed. /// \n\n /// /// @param kernel /// 1-D kernel. /// \n\b NOTE: Normalized to Q1.15 /// \n\b WARNING: must be 128-bit aligned. /// /// @param src /// Input image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// \n\b WARNING: must be > 8. /// /// @param srcHeight /// Image height. /// /// @param tmpImg /// Temporary image scratch space used internally. /// \n\b NOTE: Must be same size as src /// \n\b WARNING: must be 128-bit aligned. /// /// @param dst /// Output correlation.. Border values are ignored in this function. /// \n\b NOTE: Must be same size as src /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterCorrSep17x17s16( const int16_t* __restrict kernel, const int16_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, int16_t* __restrict tmpImg, int16_t* __restrict dst ); //--------------------------------------------------------------------------- /// @brief /// 17x17 FIR filter (convolution) with seperable kernel. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterCorrSep17x17s16() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterCorrSep17x17s16, /// \a fcvFilterCorrSep17x17s16_v2 will be removed, and the current signature /// for \a fcvFilterCorrSep17x17s16 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterCorrSep17x17s16 when transitioning to 2.0.0. /// \n\n /// /// @param kernel /// 1-D kernel. /// \n\b NOTE: data should be 128-bit aligned /// /// @param srcImg /// Input image. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned /// /// @param srcWidth /// Image tile width. /// /// @param srcHeight /// Image tile height. /// /// @param srcStride /// source Image width /// /// @param tmpImg /// Temporary image scratch space used internally. /// \n\b NOTE: Size = width * ( height + knlSize - 1 ) /// \n\b NOTE: data should be 128-bit aligned /// /// @param dstImg /// Output correlation. Border values are ignored in this function. /// \n\b NOTE: Size = dstStride * srcHeigth /// \n\b NOTE: data should be 128-bit aligned /// /// @param dstStride /// dst Image width /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvFilterCorrSep17x17s16_v2( const int16_t* __restrict kernel, const int16_t* __restrict srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict tmpImg, int16_t* __restrict dstImg, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Calculates the mean and variance of intensities of a rectangle in a /// grayscale image. /// /// @details /// /// @param src /// pointer to 8-bit grayscale image /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Width of source image /// \n\b WARNING: must be multiple of 8. /// /// @param xBegin /// x coordinate of of top left of rectangle /// /// @param yBegin /// y coordinate of of top left of rectangle /// /// @param recWidth /// width of rectangular region /// /// @param recHeight /// height of rectangular region /// /// @param mean /// output of mean of region /// /// @param variance /// output of variance of region /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageIntensityStats( const uint8_t* __restrict src, unsigned int srcWidth, int xBegin, int yBegin, unsigned int recWidth, unsigned int recHeight, float* mean, float* variance ); //------------------------------------------------------------------------------ /// @brief /// Creates a histogram of intensities for a rectangular region of a grayscale /// image. Bins each pixel into a histogram of size 256, depending on the /// intensity of the pixel (in the range 0 to 255). /// /// @details /// /// @param src /// pointer to 8-bit grayscale image /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Width of source image /// \n\b WARNING: must be multiple of 8. /// /// @param xBegin /// x coordinate of of top left of rectangle /// /// @param yBegin /// y coordinate of of top left of rectangle /// /// @param recWidth /// Width of rectangular region /// /// @param recHeight /// Height of rectangular region /// /// @param histogram /// Array of size 256 for storing the histogram /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageIntensityHistogram( const uint8_t* __restrict src, unsigned int srcWidth, int xBegin, int yBegin, unsigned int recWidth, unsigned int recHeight, int32_t* histogram ); //------------------------------------------------------------------------------ /// @brief /// Builds an integral image of the incoming 8-bit image and adds an /// unfilled border on top and to the left. /// \n NOTE: border usually zero filled elsewhere. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvIntegratePatchu8_v2(). In the 2.0.0 release, /// fcvIntegratePatchu8_v2 will be renamed to fcvIntegratePatchu8 /// and the signature of fcvIntegratePatchu8 as it appears now, /// will be removed. /// \n\n /// /// @details /// sum (X,Y) = sum_{x (patchW+1)(patchH+1) /// /// @param intgrlSqrdImgOut /// Integral image of squared values. /// \n\b NOTE: Memory must be > (patchW+1)(patchH+1) /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvIntegratePatchu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, int patchX, int patchY, unsigned int patchW, unsigned int patchH, uint32_t* __restrict intgrlImgOut, uint32_t* __restrict intgrlSqrdImgOut ); //------------------------------------------------------------------------------ /// @brief /// Builds an integral image of the incoming 8-bit patch values and their /// squares and adds an unfilled border on top and to the left. /// \n NOTE: border usually zero filled elsewhere. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvIntegratePatchu8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvIntegratePatchu8, /// \a fcvIntegratePatchu8_v2 will be removed, and the current signature /// for \a fcvIntegratePatchu8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvIntegratePatchu8 when transitioning to 2.0.0. /// \n\n /// /// @details /// sum (X,Y) = sum_{x (patchW+1)(patchH+1) /// /// @param intgrlSqrdImgOut /// Integral image of squared values. /// \n\b NOTE: Memory must be > (patchW+1)(patchH+1) /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvIntegratePatchu8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int patchX, int patchY, unsigned int patchW, unsigned int patchH, uint32_t* __restrict intgrlImgOut, uint32_t* __restrict intgrlSqrdImgOut ); //--------------------------------------------------------------------------- /// @brief /// Builds an integral image of the incoming 12x12 8-bit patch values and /// their squares. It also adds an unfilled border on top and to the left. /// \n NOTE: border usually zero filled elsewhere. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvIntegratePatch12x12u8_v2(). In the 2.0.0 release, /// fcvIntegratePatch12x12u8_v2 will be renamed to fcvIntegratePatch12x12u8 /// and the signature of fcvIntegratePatch12x12u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// sum (X,Y) = sum_{x (12+1)(12+1) /// /// @param intgrlSqrdImgOut /// Integral image of squared values. /// \n\b NOTE: Memory must be > (12+1)(12+1) /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvIntegratePatch12x12u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, int patchX, int patchY, uint32_t* __restrict intgrlImgOut, uint32_t* __restrict intgrlSqrdImgOut ); //--------------------------------------------------------------------------- /// @brief /// Builds an integral image of the incoming 12x12 8-bit patch values and /// their squares. It also adds an unfilled border on top and to the left. /// \n NOTE: border usually zero filled elsewhere. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvIntegratePatch12x12u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvIntegratePatch12x12u8, /// \a fcvIntegratePatch12x12u8_v2 will be removed, and the current signature /// for \a fcvIntegratePatch12x12u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvIntegratePatch12x12u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// sum (X,Y) = sum_{x (12+1)(12+1) /// /// @param intgrlSqrdImgOut /// Integral image of squared values. /// \n\b NOTE: Memory must be > (12+1)(12+1) /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvIntegratePatch12x12u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int patchX, int patchY, uint32_t* __restrict intgrlImgOut, uint32_t* __restrict intgrlSqrdImgOut ); //------------------------------------------------------------------------------ /// @brief /// Builds an integral image of the incoming 18x18 8-bit patch values and /// their squares. It also adds an unfilled border on top and to the left. /// \n NOTE: border usually zero filled elsewhere. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvIntegratePatch18x18u8_v2(). In the 2.0.0 release, /// fcvIntegratePatch18x18u8_v2 will be renamed to fcvIntegratePatch18x18u8 /// and the signature of fcvIntegratePatch18x18u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// sum (X,Y) = sum_{x (18+1)(18+1) /// /// @param intgrlSqrdImgOut /// Integral image of squared values. /// \n\b NOTE: Memory must be > (18+1)(18+1) /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvIntegratePatch18x18u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, int patchX, int patchY, uint32_t* __restrict intgrlImgOut, uint32_t* __restrict intgrlSqrdImgOut ); //------------------------------------------------------------------------------ /// @brief /// Builds an integral image of the incoming 18x18 8-bit patch values and /// their squares. It also adds an unfilled border on top and to the left. /// \n NOTE: border usually zero filled elsewhere. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvIntegratePatch18x18u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvIntegratePatch18x18u8, /// \a fcvIntegratePatch18x18u8_v2 will be removed, and the current signature /// for \a fcvIntegratePatch18x18u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvIntegratePatch18x18u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// sum (X,Y) = sum_{x (18+1)(18+1) /// /// @param intgrlSqrdImgOut /// Integral image of squared values. /// \n\b NOTE: Memory must be > (18+1)(18+1) /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvIntegratePatch18x18u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int patchX, int patchY, uint32_t* __restrict intgrlImgOut, uint32_t* __restrict intgrlSqrdImgOut ); //--------------------------------------------------------------------------- /// @brief /// Integrates one line of an image or any portion of an image that is /// contiguous in memory. /// /// @param src /// Input image. Size of buffer is srcWidth bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Number of pixels. /// \n NOTE: bit width enforces numPxls < 2^16 /// /// @param intgrl /// Sum of values from specified pixels. /// /// @param intgrlSqrd /// Sum of squared values from specified pixels. /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvIntegrateImageLineu8( const uint8_t* __restrict src, uint16_t srcWidth, uint32_t* intgrl, uint32_t* intgrlSqrd ); //------------------------------------------------------------------------------ /// @brief /// Integrates 64 contiguous pixels of an image. /// /// @param src /// Input image. /// \n\b WARNING: must be 128-bit aligned. /// /// @param intgrl /// Sum of values from specified pixels. /// /// @param intgrlSqrd /// Sum of squared values from specified pixels. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvIntegrateImageLine64u8( const uint8_t* __restrict src, uint16_t* intgrl, uint32_t* intgrlSqrd ); //------------------------------------------------------------------------------ /// @brief /// compute approximate mean and variance for the range of NFT4 float /// descriptors where descriptor elements along dimension are treated /// as random vars /// /// @param src /// contiguous block of descriptors of dimension 36 /// /// @param first /// index of the first descriptor in range array vind for computing mean and var /// /// @param last /// index of the last descriptor in range array vind for computing mean and range /// /// @param vind /// array of randomized indexes of descriptors /// /// @param means /// buffer for approximate means, must be 36 long /// /// @param vars /// buffer for approximate variances, must be 36 long /// /// @param temp /// bufffer, must be 46 long /// /// @return /// 0 - success /// EFAULT - invalid address /// EINVAL - invalid argument /// /// @remark /// If descriptor range is > 100 then only /// 100 samples are drawn from the range to compute /// approximate means and variances. /// /// Variances computed here do not have to be true variances because their /// values do not matter in kdtrees. The only thing that matters is that /// the ordering relation of variances is preserved /// /// /// /// @ingroup object_detection // ----------------------------------------------------------------------------- FASTCV_API int fcvDescriptorSampledMeanAndVar36f32( const float* __restrict src, int first, int last, int32_t* vind, float* __restrict means, float* __restrict vars, float* __restrict temp ); //------------------------------------------------------------------------------ /// @brief /// Searches a 8x8 patch within radius around a center pixel for the max NCC. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvNCCPatchOnCircle8x8u8_v2(). In the 2.0.0 release, /// fcvNCCPatchOnCircle8x8u8_v2 will be renamed to fcvNCCPatchOnCircle8x8u8 /// and the signature of fcvNCCPatchOnCircle8x8u8 as it appears now, /// will be removed. /// \n\n /// /// @param patch /// Pointer to 8-bit patch pixel values linearly laid out in memory. /// /// @param src /// Pointer to 8-bit image pixel values linearly laid out in memory. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Width in pixels of the image. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height in pixels of the image. /// /// @param search_center_x /// X location of search center in pixels of the image. /// /// @param search_center_y /// Y location of search center in pixels of the image. /// /// @param search_radius /// Radius of search in pixels. Must be <=5. /// /// @param best_x /// Center X location on the image of the best NCC match. The center X has /// 4 pixels to the left and 3 to the right. /// /// @param best_y /// Center Y location on the image of the best NCC match. The center Y has /// 4 pixels above and 3 pixels below. /// /// @param bestNCC /// Largest value of the normalized cross-correlation found in the NCC search. /// It's quantized to integer value in Q7 (between -128 and 128). /// /// @param findSubPixel (0 or 1) /// Use parabolic interpolation of NCC values to find sub-pixel estimates. /// /// @param subX /// Sub-pixel estimate for optimal NCC relative to best_x. /// \n e.g., float x = (float)best_x + subX; /// /// @param subY /// Sub-pixel estimate for optimal NCC relative to best_y. /// /// @return /// 0 = OK \n /// 1 = "search_radius" too large\n /// 2 = invalid "search_center_x,y"\n /// 3 = not found\n /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API int fcvNCCPatchOnCircle8x8u8( const uint8_t* __restrict patch, const uint8_t* __restrict src, unsigned short srcWidth, unsigned short srcHeight, unsigned short search_center_x, unsigned short search_center_y, unsigned short search_radius, uint16_t* best_x, uint16_t* best_y, uint32_t* bestNCC, int findSubPixel, float* subX, float* subY ); //------------------------------------------------------------------------------ /// @brief /// Searches a 8x8 patch within radius around a center pixel for the max NCC. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvNCCPatchOnCircle8x8u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvNCCPatchOnCircle8x8u8, /// \a fcvNCCPatchOnCircle8x8u8_v2 will be removed, and the current signature /// for \a fcvNCCPatchOnCircle8x8u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvNCCPatchOnCircle8x8u8 when transitioning to 2.0.0. /// \n\n /// /// @param patch /// Pointer to 8-bit patch pixel values linearly laid out in memory. /// /// @param src /// Pointer to 8-bit image pixel values linearly laid out in memory. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Width in pixels of the image. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height in pixels of the image. /// /// @param search_center_x /// X location of search center in pixels of the image. /// /// @param search_center_y /// Y location of search center in pixels of the image. /// /// @param search_radius /// Radius of search in pixels. Must be <=5. /// /// @param filterLowVariance /// Minimum variance. Used to as threshold to compare against variance of /// 8x8 block of src or patch. /// /// @param best_x /// Center X location on the image of the best NCC match. The center X has /// 4 pixels to the left and 3 to the right. /// /// @param best_y /// Center Y location on the image of the best NCC match. The center Y has /// 4 pixels above and 3 pixels below. /// /// @param bestNCC /// Largest value of the normalized cross-correlation found in the NCC search. /// It's quantized to integer value in Q7 (between -128 and 128). /// /// @param findSubPixel (0 or 1) /// Use parabolic interpolation of NCC values to find sub-pixel estimates. /// /// @param subX /// Sub-pixel estimate for optimal NCC relative to best_x. /// \n e.g., float x = (float)best_x + subX; /// /// @param subY /// Sub-pixel estimate for optimal NCC relative to best_y. /// /// @return /// 0 = OK \n /// 1 = "search_radius" too large\n /// 2 = invalid "search_center_x,y"\n /// 3 = not found\n /// 4 = Patch has too low variance\n /// 5 = Image region has too low variance\n /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API int fcvNCCPatchOnCircle8x8u8_v2( const uint8_t* __restrict patch, const uint8_t* __restrict src, unsigned short srcWidth, unsigned short srcHeight, unsigned short search_center_x, unsigned short search_center_y, unsigned short search_radius, int filterLowVariance, uint16_t* best_x, uint16_t* best_y, uint32_t* bestNCC, int findSubPixel, float* subX, float* subY ); //------------------------------------------------------------------------------ /// @brief /// Searches a 8x8 patch within square region around a center pixel /// for the max NCC. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvNCCPatchOnSquare8x8u8_v2(). In the 2.0.0 release, /// fcvNCCPatchOnSquare8x8u8_v2 will be renamed to fcvNCCPatchOnSquare8x8u8 /// and the signature of fcvNCCPatchOnSquare8x8u8 as it appears now, /// will be removed. /// \n\n /// /// @param patch /// Pointer to 8-bit patch pixel values linearly laid out in memory. /// /// @param src /// Pointer to 8-bit image pixel values linearly laid out in memory. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Width in pixels of the image. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height in pixels of the image. /// /// @param search_center_x /// Center X coordinate of the search window /// /// @param search_center_y /// Center Y coordinate of the search window /// /// @param search_w /// Width of search square in pixels /// \n\b WARNING: must be 11 or less. /// /// @param best_x /// Center X location on the image of the best NCC match. The center X has /// 4 pixels to the left and 3 to the right. /// /// @param best_y /// Center Y location on the image of the best NCC match. The center Y has /// 4 pixels above and 3 pixels below. /// /// @param bestNCC /// NCC value of the best match block. /// It's quantized to integer value in Q7 (between -128 and 128). /// /// @param doSubPixel (0 or 1) /// Use parabolic interpolation of NCC values to find sub-pixel estimates. /// /// @param subX /// Sub-pixel estimate for optimal NCC relative to best_x. /// \n e.g., float x = (float)best_x + subX; /// /// @param subY /// Sub-pixel estimate for optimal NCC relative to best_y. /// /// @return /// 0 = OK \n /// 1 = "search_radius" too large\n /// 2 = invalid "search_center_x,y"\n /// 3 = not found\n /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API int fcvNCCPatchOnSquare8x8u8( const uint8_t* __restrict patch, const uint8_t* __restrict src, unsigned short srcWidth, unsigned short srcHeight, unsigned short search_center_x, unsigned short search_center_y, unsigned short search_w, uint16_t* best_x, uint16_t* best_y, uint32_t* bestNCC, int doSubPixel, float* subX, float* subY ); //------------------------------------------------------------------------------ /// @brief /// Searches a 8x8 patch within square region around a center pixel /// for the max NCC. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvNCCPatchOnSquare8x8u8 with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvNCCPatchOnSquare8x8u8, /// \a fcvNCCPatchOnSquare8x8u8_v2 will be removed, and the current signature /// for \a fcvNCCPatchOnSquare8x8u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvNCCPatchOnSquare8x8u8 when transitioning to 2.0.0. /// \n\n /// /// @param patch /// Pointer to 8-bit patch pixel values linearly laid out in memory. /// /// @param src /// Pointer to 8-bit image pixel values linearly laid out in memory. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Width in pixels of the image. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height in pixels of the image. /// /// @param search_center_x /// Center X coordinate of the search window /// /// @param search_center_y /// Center Y coordinate of the search window /// /// @param search_w /// Width of search square in pixels /// \n\b WARNING: must be 11 or less. /// /// @param filterLowVariance /// Minimum variance. Used to as threshold to compare against variance of /// 8x8 block of src or patch. /// /// @param best_x /// Center X location on the image of the best NCC match. The center X has /// 4 pixels to the left and 3 to the right. /// /// @param best_y /// Center Y location on the image of the best NCC match. The center Y has /// 4 pixels above and 3 pixels below. /// /// @param bestNCC /// NCC value of the best match block. /// It's quantized to integer value in Q7 (between -128 and 128). /// /// @param doSubPixel (0 or 1) /// Use parabolic interpolation of NCC values to find sub-pixel estimates. /// /// @param subX /// Sub-pixel estimate for optimal NCC relative to best_x. /// \n e.g., float x = (float)best_x + subX; /// /// @param subY /// Sub-pixel estimate for optimal NCC relative to best_y. /// /// @return /// 0 = OK \n /// 1 = "search_radius" too large\n /// 2 = invalid "search_center_x,y"\n /// 3 = not found\n /// 4 = Patch has too low variance\n /// 5 = Image region has too low variance\n /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API int fcvNCCPatchOnSquare8x8u8_v2( const uint8_t* __restrict patch, const uint8_t* __restrict src, unsigned short srcWidth, unsigned short srcHeight, unsigned short search_center_x, unsigned short search_center_y, unsigned short search_w, int filterLowVariance, uint16_t* best_x, uint16_t* best_y, uint32_t* bestNCC, int doSubPixel, float* subX, float* subY ); //------------------------------------------------------------------------------ /// @brief /// Sum of absolute differences of an image against an 8x8 template. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvSumOfAbsoluteDiffs8x8u8_v2(). In the 2.0.0 release, /// fcvSumOfAbsoluteDiffs8x8u8_v2 will be renamed to fcvSumOfAbsoluteDiffs8x8u8 /// and the signature of fcvSumOfAbsoluteDiffs8x8u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// 8x8 sum of ||A-B||. The template patch is swept over the entire image and /// the results are put in dst. /// /// @param patch /// 8x8 template /// /// @param src /// Reference Image. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Width of the src image. /// /// @param srcHeight /// Height of the src image. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param dst /// The dst buffer shall be width X height bytes in length. /// Output of SAD(A,B). dst[4][4] correspondes to the 0,0 pixel of the template /// aligned with the 0,0 pixel of src. The dst border values not covered by /// entire 8x8 patch window will remain unmodified by the function. The caller /// should either initialize these to 0 or ignore. /// \n\b NOTE: must be 128-bit aligned. /// /// /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API void fcvSumOfAbsoluteDiffs8x8u8( const uint8_t* __restrict patch, const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint16_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Sum of absolute differences of an image against an 8x8 template. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvSumOfAbsoluteDiffs8x8u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvSumOfAbsoluteDiffs8x8u8, /// \a fcvSumOfAbsoluteDiffs8x8u8_v2 will be removed, and the current signature /// for \a fcvSumOfAbsoluteDiffs8x8u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvSumOfAbsoluteDiffs8x8u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// 8x8 sum of ||A-B||. The template patch is swept over the entire image and /// the results are put in dst. /// /// @param patch /// 8x8 template /// /// @param patchStride /// Stride of the 8x8 template buffer /// /// @param dstStride /// Stride of the patch (in bytes) - i.e., how many bytes between column 0 of row N /// and column 0 of row N+1. /// /// @param src /// Reference Image. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Width of the src image. /// /// @param srcHeight /// Height of the src image. /// /// @param srcStride /// Stride of image (in bytes) - i.e., how many bytes between column 0 of row N /// and column 0 of row N+1. /// /// @param dst /// The dst buffer shall be at least ( width x height ) values in length. /// Output of SAD(A,B). dst[4][4]correspondes to the 0,0 pixel of the template /// aligned with the 0,0 pixel of src. The dst border values not covered by /// entire 8x8 patch window will remain unmodified by the function. The caller /// should either initialize these to 0 or ignore. /// \n\b NOTE: must be 128-bit aligned. /// /// @param dstStride /// Stride of destination (in bytes) - i.e., how many bytes between column 0 of row N /// and column 0 of row N+1. /// /// /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API void fcvSumOfAbsoluteDiffs8x8u8_v2( const uint8_t* __restrict patch, unsigned int patchStride, const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint16_t* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Down-scale the image to half width and height by averaging 2x2 pixels /// into one. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvScaleDownBy2u8_v2(). In the 2.0.0 release, /// fcvScaleDownBy2u8_v2 will be renamed to fcvScaleDownBy2u8 /// and the signature of fcvScaleDownBy2u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// A box filter downsampling the next pixel, the pixel below, and the next /// pixel to the pixel below into one pixel.\n /// | px00 px01 px02 px03 |\n /// | px10 px11 px12 px13 |\n /// to:\n /// | (px00+px01+px10+px11)/4 (px02+px03+px12+px13)/4 |\n /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: data must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// \n\b NOTE:must be a multiple of 2 /// /// @param dst /// Output 8-bit image. Size of buffer is srcWidth*srcHeight/4 bytes. /// \n\b NOTE: data must be 128-bit aligned. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API int fcvScaleDownBy2u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Down-scale the image to half width and height by averaging 2x2 pixels /// into one. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvScaleDownBy2u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvScaleDownBy2u8, /// \a fcvScaleDownBy2u8_v2 will be removed, and the current signature /// for \a fcvScaleDownBy2u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvScaleDownBy2u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// A box filter downsampling the next pixel, the pixel below, and the next /// pixel to the pixel below into one pixel.\n /// | px00 px01 px02 px03 |\n /// | px10 px11 px12 px13 |\n /// to:\n /// | (px00+px01+px10+px11)/4 (px02+px03+px12+px13)/4 |\n /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// \n\b NOTE:must be a multiple of 2 /// /// @param srcStride /// Image stride (in bytes). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit image. Size of buffer is dstStride*srcHeight/2 bytes. /// \n\b NOTE: data must be 128-bit aligned. /// /// @param dstStride /// Output stride (in bytes). /// \n\b NOTE: if 0, dstStride is set as srcWidth/2. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth/2 if not 0. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API int fcvScaleDownBy2u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Downscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvScaleDownBy2Gaussian5x5u8_v2(). In the 2.0.0 release, /// fcvScaleDownBy2Gaussian5x5u8_v2 will be renamed to fcvScaleDownBy2Gaussian5x5u8 /// and the signature of fcvScaleDownBy2Gaussian5x5u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Downsamples the image using a 5x5 Gaussian filter kernel. /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Image height. /// \n\b NOTE:must be a multiple of 2 /// /// @param dst /// Output 8-bit downscale image of size (width / 2) x (height / 2). /// \n\b NOTE: border values have been taken cared w.r.t. the pixel coordinate. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API void fcvScaleDownBy2Gaussian5x5u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Downscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel /// /// \n\b ATTENTION: This function is a duplication of of /// fcvScaleDownBy2Gaussian5x5u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvScaleDownBy2Gaussian5x5u8, /// \a fcvScaleDownBy2Gaussian5x5u8_v2 will be removed, and the current signature /// for \a fcvScaleDownBy2Gaussian5x5u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvScaleDownBy2Gaussian5x5u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Downsamples the image using a 5x5 Gaussian filter kernel. /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride (in bytes). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit downscale image of size (width / 2) x (height / 2). /// \n\b NOTE: border values have been taken cared w.r.t. the pixel coordinate. /// /// @param dstStride /// Output stride (in bytes). /// \n\b NOTE: if 0, dstStride is set as srcWidth/2. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth/2 if not 0. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API void fcvScaleDownBy2Gaussian5x5u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Downscale the image to quarter width and height by averaging 4x4 pixels /// into one.. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvScaleDownBy4u8_v2(). In the 2.0.0 release, /// fcvScaleDownBy4u8_v2 will be renamed to fcvScaleDownBy4u8 /// and the signature of fcvScaleDownBy4u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// A 4x4 downsampling box filter across adjacent pixels is applied. /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Image height. /// \n\b NOTE:must be a multiple of 4 /// /// @param dst /// Output 8-bit image. Size of buffer is srcWidth*srcHeight/16 bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API int fcvScaleDownBy4u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Downscale the image to quarter width and height by averaging 4x4 pixels /// into one.. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvScaleDownBy4u8_v2() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvScaleDownBy4u8_v2, /// \a fcvScaleDownBy4u8_v2 will be removed, and the current signature /// for \a fcvScaleDownBy4u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvScaleDownBy4u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// A 4x4 downsampling box filter across adjacent pixels is applied. /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Image height. /// \n\b NOTE:must be a multiple of 4 /// /// @param srcStride /// Image stride (in bytes). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit image. Size of buffer is dstStride*srcHeight/4 bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Output stride (in bytes). /// \n\b NOTE: if 0, dstStride is set as srcWidth/4. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth/4 if not 0. /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API int fcvScaleDownBy4u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Downscale the image to 2/3 width and height by averaging 3x3 pixels /// into one.. /// /// @details /// A 3x3 downsampling box filter across adjacent pixels is applied. /// /// @param src /// Input 8-bit image. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b NOTE: In case of non multiple of 3, it will crop to the closest multiple of 3 /// /// @param srcHeight /// Image height. /// \n\b NOTE: In case of non multiple of 3, it will crop to the closest multiple of 3 /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). If 0 is passed, srcStride is set to srcWidth. /// /// @param dst /// Output 8-bit image. /// \n\b WARNING: must be 128-bit aligned. /// Memory must be pre-allocated at least srcWidth * srcHeight * 2 / 3 /// dstWidth = srcWidth/3*2 /// dstHeight = srcHeight/3*2 /// /// @param dstStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). If 0 is passed, dstStride is set to dstWidth which is srcWidth *2/3. /// /// @return 0 if successful /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API int fcvScaleDown3To2u8( const uint8_t* __restrict src, unsigned srcWidth, unsigned srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride); //--------------------------------------------------------------------------- /// @brief /// Downsample Horizontaly and/or Vertically by an *integer* scale. /// /// @details /// Uses Nearest Neighbor method /// /// @param src /// Input 8-bit image. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Source Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Source Image height. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). If 0 is passed, srcStride is set to srcWidth. /// /// @param dst /// Output 8-bit image. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstWidth /// Destination Image width. /// /// @param dstHeight /// Destination Image height. /// /// @param dstStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). If 0 is passed, dstStride is set to dstWidth which is srcWidth *2/3. /// /// @return 0 if successful /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API int fcvScaleDownNNu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride ); //--------------------------------------------------------------------------- /// @brief /// Downsample Horizontaly and/or Vertically by an *integer* scale. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvScaleDownu8_v2(). In the 2.0.0 release, /// fcvScaleDownu8_v2 will be renamed to fcvScaleDownu8 /// and the signature of fcvScaleDownu8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Uses an box averaging filter of size MxN where M is the scale factor /// in horizontal dimension and N is the scale factor in the vertical /// dimension. /// \n \b NOTE: input dimensions should be multiple of output dimensions. /// \n NOTE: On different processors, some output pixel values may be off by 1 /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Source Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Source Image height. /// /// @param dst /// Output 8-bit image. Size of buffer is dstWidth*dstHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstWidth /// Destination Image width. /// /// @param dstHeight /// Destination Image height. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API void fcvScaleDownu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst, unsigned int dstWidth, unsigned int dstHeight ); //--------------------------------------------------------------------------- /// @brief /// Downsample Horizontaly and/or Vertically by an *integer* scale. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvScaleDownu8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvScaleDownu8, /// \a fcvScaleDownu8_v2 will be removed, and the current signature /// for \a fcvScaleDownu8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvScaleDownu8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Uses an box averaging filter of size MxN where M is the scale factor /// in horizontal dimension and N is the scale factor in the vertical /// dimension /// \n \b NOTE: input dimensions should be multiple of output dimensions. /// \n NOTE: On different processors, some output pixel values may be off by 1 /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Source Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Source Image height. /// /// @param srcStride /// Image stride (in bytes). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit image. Size of buffer is dstStride*dstHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstWidth /// Destination Image width. /// /// @param dstHeight /// Destination Image height. /// /// @param dstStride /// Output stride (in bytes). /// \n\b NOTE: if 0, dstStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as dstWidth if not 0. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API void fcvScaleDownu8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Upscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvScaleUpBy2Gaussian5x5u8_v2(). In the 2.0.0 release, /// fcvScaleUpBy2Gaussian5x5u8_v2 will be renamed to fcvScaleUpBy2Gaussian5x5u8 /// and the signature of fcvScaleUpBy2Gaussian5x5u8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Upsamples the image using a 5x5 Gaussian filter kernel. /// /n/b NOTE: border values have been taken care with Gaussion coefficients. /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param dst /// Output 8-bit upsampled image of size (2*width) x (2*height). /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API void fcvScaleUpBy2Gaussian5x5u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Upscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel /// /// \n\b ATTENTION: This function is a duplication of of /// fcvScaleUpBy2Gaussian5x5u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvScaleUpBy2Gaussian5x5u8, /// \a fcvScaleUpBy2Gaussian5x5u8_v2 will be removed, and the current signature /// for \a fcvScaleUpBy2Gaussian5x5u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvScaleUpBy2Gaussian5x5u8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Upsamples the image using a 5x5 Gaussian filter kernel. /// /n/b NOTE: border values have been taken care with Gaussion coefficients. /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcStride /// Image stride (in bytes). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. /// /// @param srcHeight /// Image height. /// /// @param dst /// Output 8-bit upsampled image of size (2*dstStride) x (2*srcHeight). /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Output stride (in bytes). /// \n\b NOTE: if 0, dstStride is set as srcWidth*2. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth*2 if not 0. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API void fcvScaleUpBy2Gaussian5x5u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride ); // ----------------------------------------------------------------------------- /// @brief /// Translate to float and normalize 36 8-bit elements /// /// @param src /// Pointer to the first input vector /// /// @param invLen /// Pointer to inverse length of the first input vector /// located right after each 36 element vector /// /// @param numVecs /// Number of vectors to translate /// /// @param reqNorm /// Required norm /// /// @param srcStride /// Step in bytes to data of the next vector /// Each vector has 36 8-bit elements and 1 float invLen /// /// @param dst /// Pointer to contiguous block for output vectors /// \n\b WARNING: must be 128-bit aligned. /// /// @param stopBuild /// Allows other threads to break this function in the middle of processing. /// When set to 1, the function will exit on the next iteration. /// /// @return /// 0 - success /// EFAULT - invalid address /// EINVAL - invalid argument /// /// @ingroup math_vector // ----------------------------------------------------------------------------- FASTCV_API int fcvVecNormalize36s8f32( const int8_t* __restrict src, unsigned int srcStride, const float* __restrict invLen, unsigned int numVecs, float reqNorm, float* __restrict dst, int32_t* stopBuild ); //--------------------------------------------------------------------------- /// @brief /// Sum of squared differences of one 36-byte vector against 4 others. /// /// @details /// SSD of one vector (a) against 4 others (b0,b1,b2,b3) using their given /// inverse lengths for normalization. /// \n\n SSD(a,b0), SSD(a,b1), SSD(a,b2), SSD(a,b3) /// /// @param a /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param invLenA /// Inverse of vector A = 1/|A| /// /// @param b0 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b1 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b2 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param b3 /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param invLenB /// Inverse of vectors b0...b3 = 1/|b0|,... 1/|b3| /// \n\b WARNING: array must be 128-bit aligned /// /// @param distances /// Output of the 4 results { SSD(a,b0), SSD(a,b1), SSD(a,b2), SSD(a,b3) }. /// \n ACCURACY: 1.0e-6 /// \n\b WARNING: array must be 128-bit aligned /// /// /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSumOfSquaredDiffs36x4s8( const int8_t* __restrict a, float invLenA, const int8_t* __restrict b0, const int8_t* __restrict b1, const int8_t* __restrict b2, const int8_t* __restrict b3, const float* __restrict invLenB, float* __restrict distances ); //--------------------------------------------------------------------------- /// @brief /// Sum of squared differences of one 36-byte vector against N others. /// /// @details /// SSD of one vector (a) against N other 36-byte vectors /// ( b[0], b[1], ..., b[n-1] ) /// using their given inverse lengths for normalization. /// \n\n SSD(a,b[0]), SSD(a,b[1]), ..., SSD(a,b[n-1]) /// /// @param a /// Vector. /// \n\b NOTE: array should be 128-bit aligned /// /// @param invLenA /// Inverse of vector A = 1/|A| /// /// @param b /// Vectors b[0]...b[n-1]. /// \n\b WARNING: must be 128-bit aligned. /// /// @param invLenB /// Inverse of vectors b[0]...b[n-1] = 1/|b[0]|,... 1/|b[n-1]| /// \n\b WARNING: must be 128-bit aligned. /// /// @param numB /// Number of B vectors. /// /// @param distances /// Output of the N results { SSD(a,b[0]), SSD(a,b[1]), ..., SSD(a,b[n-1]) }. /// \n ACCURACY: 1.0e-6 /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSumOfSquaredDiffs36xNs8( const int8_t* __restrict a, float invLenA, const int8_t* const * __restrict b, const float* __restrict invLenB, unsigned int numB, float* __restrict distances ); //--------------------------------------------------------------------------- /// @brief /// Sorting of 8 float numbers /// /// @details /// Perform sorting of 8 scores in ascending order (output of SumOfSquaredDiffs) /// /// @param inScores /// Input 8 element float array /// \n\b NOTE: array should be 128-bit aligned /// /// @param outScores /// Output is 8 element sorted float array /// \n\b WARNING: array must be 128-bit aligned /// /// /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSort8Scoresf32( float* __restrict inScores, float* __restrict outScores ); //------------------------------------------------------------------------------ /// @brief /// Binarizes a grayscale image based on a threshold value. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterThresholdu8_v2(). In the 2.0.0 release, /// fcvFilterThresholdu8_v2 will be renamed to fcvFilterThresholdu8 /// and the signature of fcvFilterThresholdu8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Sets the pixel to max(255) if it's value is greater than the threshold; /// else, set the pixel to min(0). /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param dst /// Output 8-bit binarized image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param threshold /// Threshold value for binarization. /// \n\b WARNING: must be larger than 0. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterThresholdu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst, unsigned int threshold ); //------------------------------------------------------------------------------ /// @brief /// Binarizes a grayscale image based on a threshold value. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterThresholdu8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterThresholdu8, /// \a fcvFilterThresholdu8_v2 will be removed, and the current signature /// for \a fcvFilterThresholdu8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterThresholdu8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Sets the pixel to max(255) if it's value is greater than the threshold; /// else, set the pixel to min(0). /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8 /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit binarized image. Size of buffer is dstStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Output stride (in bytes). /// \n\b NOTE: if 0, dstStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. /// /// @param threshold /// Threshold value for binarization. /// \n\b WARNING: must be larger than 0. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterThresholdu8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride, unsigned int threshold ); //------------------------------------------------------------------------------ /// @brief /// Dilate a grayscale image by taking the local maxima of 3x3 neighborhood window. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterDilate3x3u8_v2(). In the 2.0.0 release, /// fcvFilterDilate3x3u8_v2 will be renamed to fcvFilterDilate3x3u8 /// and the signature of fcvFilterDilate3x3u8 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param dst /// Output 8-bit dilated image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterDilate3x3u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Dilate a grayscale image by taking the local maxima of 3x3 neighborhood window. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterDilate3x3u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterDilate3x3u8, /// \a fcvFilterDilate3x3u8_v2 will be removed, and the current signature /// for \a fcvFilterDilate3x3u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterDilate3x3u8 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit dilated image. Size of buffer is dstStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Stride of output image. /// \n\b NOTE: if 0, dstStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterDilate3x3u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride ); //------------------------------------------------------------------------------ /// @brief /// Erode a grayscale image by taking the local minima of 3x3 neighborhood window. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterErode3x3u8_v2(). In the 2.0.0 release, /// fcvFilterErode3x3u8_v2 will be renamed to fcvFilterErode3x3u8 /// and the signature of fcvFilterErode3x3u8 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param dst /// Output 8-bit eroded image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterErode3x3u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst ); //------------------------------------------------------------------------------ /// @brief /// Erode a grayscale image by taking the local minima of 3x3 nbhd window. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterErode3x3u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterErode3x3u8, /// \a fcvFilterErode3x3u8_v2 will be removed, and the current signature /// for \a fcvFilterErode3x3u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterErode3x3u8 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output 8-bit eroded image. Size of buffer is dstStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Stride of output image. /// \n\b NOTE: if 0, dstStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFilterErode3x3u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstStride ); //--------------------------------------------------------------------------- /// @brief /// Warps the patch centered at nPos in the input image using the affine /// transform in nAffine /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvTransformAffine8x8u8_v2(). In the 2.0.0 release, /// fcvTransformAffine8x8u8_v2 will be renamed to fcvTransformAffine8x8u8 /// and the signature of fcvTransformAffine8x8u8 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image. Size of buffer is srcWidth*srcHeight bytes. /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param nPos[ 2 ] /// Position in the image in 32 bit fixed point (Q16) /// \n\b NOTE: if any 1 coordinates of the warped square are inside the image, return 1 and /// \n leave function. Otherwise, return 0. /// \n\b WARNING: must be 64-bit aligned. /// /// @param nAffine[ 2 ][ 2 ] /// Transformation matrix in 32 bit fixed point (Q16). The matrix stored /// in nAffine is using row major ordering: \n /// a11, a12, a21, a22 where the matrix is: \n /// | a11, a12 |\n /// | a21, a22 |\n /// /// \n\b WARNING: must be 128-bit aligned. /// /// @param nPatch /// Transformed patch. /// /// /// @returns 0 if the transformation is valid /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API int fcvTransformAffine8x8u8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, const int32_t* __restrict nPos, const int32_t* __restrict nAffine, uint8_t* __restrict nPatch ); //--------------------------------------------------------------------------- /// @brief /// Warps the patch centered at nPos in the input image using the affine /// transform in nAffine /// /// \n\b ATTENTION: This function is a duplication of of /// fcvTransformAffine8x8u8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvTransformAffine8x8u8, /// \a fcvTransformAffine8x8u8_v2 will be removed, and the current signature /// for \a fcvTransformAffine8x8u8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvTransformAffine8x8u8 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image. Size of buffer is srcStride*srcHeight bytes. /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Stride of image (in bytes) - i.e., how many bytes between column 0 of row N /// and column 0 of row N+1. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be at least as much as srcWidth if not 0. /// /// @param nPos[ 2 ] /// Position in the image in 32 bit fixed point (Q16) /// \n\b NOTE: if any 1 coordinates of the warped square are inside the image, return 1 and /// \n leave function. Otherwise, return 0. /// \n\b WARNING: must be 64-bit aligned. /// /// @param nAffine[ 2 ][ 2 ] /// Transformation matrix in 32 bit fixed point (Q16). The matrix stored /// in nAffine is using row major ordering: \n /// a11, a12, a21, a22 where the matrix is: \n /// | a11, a12 |\n /// | a21, a22 |\n /// /// \n\b WARNING: must be 128-bit aligned. /// /// @param patch /// Transformed patch. /// /// @param patchStride /// Stride of patch (in bytes) - i.e., how many bytes between column 0 of row N /// and column 0 of row N+1. /// \n\b NOTE: if 0, srcStride is set as 8. /// \n\b WARNING: must be at least as much as 8 if not 0. /// /// /// @returns 0 if the transformation is valid /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API int fcvTransformAffine8x8u8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, const int32_t* __restrict nPos, const int32_t* __restrict nAffine, uint8_t* __restrict patch, unsigned int patchStride ); //------------------------------------------------------------------------------ /// @brief /// Warps a grayscale image using the a perspective projection transformation /// matrix (also known as a homography). This type of transformation is an /// invertible transformation which maps straight lines to straight lines. /// Bi-linear interpolation is used where applicable. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvWarpPerspectiveu8_v2(). In the 2.0.0 release, /// fcvWarpPerspectiveu8_v2 will be renamed to fcvWarpPerspectiveu8 /// and the signature of fcvWarpPerspectiveu8 as it appears now, /// will be removed. /// \n\n /// /// @details /// Warps an image taking into consideration the perspective scaling. /// /// @param src /// Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Input image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Input image height. /// \n\b WARNING: must be multiple of 8. /// /// @param dst /// Warped output image. Size of buffer is dstWidth*dstHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstWidth /// Dst image width. /// \n\b NOTE: data must be multiple of 8. /// /// @param dstHeight /// Dst image height. /// \n\b NOTE: must be multiple of 8 /// /// @param projectionMatrix /// 3x3 perspective transformation matrix (generally a homography). The /// matrix stored in homography is row major ordering: \n /// a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is: \n /// | a11, a12, a13 |\n /// | a21, a22, a23 |\n /// | a31, a32, a33 |\n /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API void fcvWarpPerspectiveu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst, unsigned int dstWidth, unsigned int dstHeight, float* __restrict projectionMatrix ); //------------------------------------------------------------------------------ /// @brief /// Warps a grayscale image using the a perspective projection transformation /// matrix (also known as a homography). This type of transformation is an /// invertible transformation which maps straight lines to straight lines. /// Bi-linear interpolation is used where applicable. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvWarpPerspectiveu8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvWarpPerspectiveu8, /// \a fcvWarpPerspectiveu8_v2 will be removed, and the current signature /// for \a fcvWarpPerspectiveu8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvWarpPerspectiveu8 when transitioning to 2.0.0. /// \n\n /// /// @details /// Warps an image taking into consideration the perspective scaling. /// /// @param src /// Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Input image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Input image height. /// \n\b WARNING: must be multiple of 8. /// /// @param srcStride /// Input image stride (in bytes). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. /// /// @param dst /// Warped output image. Size of buffer is dstStride*dstHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstWidth /// Dst image width. /// \n\b NOTE: data must be multiple of 8. /// /// @param dstHeight /// Dst image height. /// \n\b NOTE: must be multiple of 8 /// /// @param dstStride /// Output image stride (in bytes). /// \n\b NOTE: if 0, dstStride is set as dstWidth. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as dstWidth if not 0. /// /// @param projectionMatrix /// 3x3 perspective transformation matrix (generally a homography). The /// matrix stored in homography is row major ordering: \n /// a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is: \n /// | a11, a12, a13 |\n /// | a21, a22, a23 |\n /// | a31, a32, a33 |\n /// \n\b WARNING: must be 128-bit aligned. /// /// /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API void fcvWarpPerspectiveu8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride, float* __restrict projectionMatrix ); //--------------------------------------------------------------------------- /// @brief /// Warps a 3 color channel image based on a 3x3 perspective projection matrix using /// bilinear interpolation. /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcv3ChannelWarpPerspectiveu8_v2(). In the 2.0.0 release, /// fcv3ChannelWarpPerspectiveu8_v2 will be renamed to fcv3ChannelWarpPerspectiveu8 /// and the signature of fcv3ChannelWarpPerspectiveu8 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image. Size of buffer is srcWidth*srcHeight*3 bytes. /// \n\b NOTE: data must be 128-bit aligned. /// /// @param srcWidth /// Input image width. /// \n\b NOTE: must be multiple of 8 /// /// @param srcHeight /// Input image height. /// \n\b NOTE: must be multiple of 8 /// /// @param dst /// Warped output image. Size of buffer is dstWidth*dstHeight*3 bytes. /// \n\b NOTE: data must be 128-bit aligned. /// /// @param dstWidth /// Output image width. /// \n\b NOTE: must be multiple of 8. /// /// @param dstHeight /// Output image height. /// \n\b NOTE: must be multiple of 8. /// /// @param projectionMatrix /// 3x3 perspective transformation matrix (generally a homography). The /// matrix stored in homography is row major ordering: \n /// a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is: \n /// | a11, a12, a13 |\n /// | a21, a22, a23 |\n /// | a31, a32, a33 |\n /// \n\b WARNING: must be 128-bit aligned. /// /// @ingroup image_transform //--------------------------------------------------------------------------- FASTCV_API void fcv3ChannelWarpPerspectiveu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t* __restrict dst, unsigned int dstWidth, unsigned int dstHeight, float* __restrict projectionMatrix ); //--------------------------------------------------------------------------- /// @brief /// Warps a 3 color channel image based on a 3x3 perspective projection /// matrix using bilinear interpolation. /// /// \n\b ATTENTION: This function is a duplication of of /// fcv3ChannelWarpPerspectiveu8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcv3ChannelWarpPerspectiveu8, /// \a fcv3ChannelWarpPerspectiveu8_v2 will be removed, and the current signature /// for \a fcv3ChannelWarpPerspectiveu8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcv3ChannelWarpPerspectiveu8 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image. Size of buffer is srcStride*srcHeight bytes. /// \n\b WARNING: data must be 128-bit aligned. /// /// @param srcWidth /// Input image width. /// \n\b WARNING: must be multiple of 8 /// /// @param srcHeight /// Input image height. /// \n\b WARNING: must be multiple of 8 /// /// @param srcStride /// Input image stride (in bytes). /// \n\b NOTE: if 0, srcStride is set as srcWidth*3. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth*3 if not 0. /// /// @param dst /// Warped output image. Size of buffer is dstStride*dstHeight bytes. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstWidth /// Output image width. /// \n\b WARNING: must be multiple of 8. /// /// @param dstHeight /// Output image height. /// \n\b WARNING: must be multiple of 8. /// /// @param dstStride /// Output image stride (in bytes). /// \n\b NOTE: if 0, dstStride is set as dstWidth*3. /// \n\b WARNING: must be multiple of 8 (8 * 1-byte values), and at least as much as dstWidth*3 if not 0. /// /// @param projectionMatrix /// 3x3 perspective transformation matrix (generally a homography). The /// matrix stored in homography is row major ordering: \n /// a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is: \n /// | a11, a12, a13 |\n /// | a21, a22, a23 |\n /// | a31, a32, a33 |\n /// \n\b WARNING: must be 128-bit aligned. /// /// @ingroup image_transform //--------------------------------------------------------------------------- FASTCV_API void fcv3ChannelWarpPerspectiveu8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t* __restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride, float* __restrict projectionMatrix ); //--------------------------------------------------------------------------- /// @brief /// General function for computing cluster centers and cluster bindings /// for a set of points of dimension dim. /// /// @param points /// Array of all points. Array size must be greater than /// numPoints * dim. /// /// @param numPoints /// Number of points in points array. /// \n\b WARNING: must be > numPoints * dim. /// /// @param dim /// dimension, e.g. 36 /// /// @param pointStride /// Byte distance between adjacent points in array /// /// @param indices /// Array of point indices in points array. Processing will only /// occur on points whose indices are in this array. Each index in array /// must be smaller numPoints. /// /// @param numIndices /// Length of indices array. numIndieces must be <= numPoints. /// /// @param numClusters /// Number of cluster centers /// /// @param clusterCenters /// current cluster centers; /// elements are distant by clusterCenterStride /// /// @param clusterCenterStride /// byte distance between adjacent cluster centers in array /// /// @param newClusterCenters /// array for new cluster centers; should be numClusterCenters long /// /// @param clusterMemberCounts /// Element counts for each cluster; should be numClusterCenters long /// /// @param clusterBindings /// Output indices of the clusters to which each vector belongs to, array must /// be numIndices long. /// /// @param sumOfClusterDistances /// Array for sum of distances of cluster elements to cluster centers; /// Must be numClusters long /// /// @return /// 0 if successfully clustered, otherwise error code /// /// @remark /// This is general clusterer. There are no assumptions on points other /// than they belong to a vector space /// /// /// /// @ingroup clustering_and_search //--------------------------------------------------------------------------- FASTCV_API int fcvClusterEuclideanf32( const float* __restrict points, int numPoints, // actually not used but helpful int dim, int pointStride, const size_t* __restrict indices, int numIndices, int numClusters, float* __restrict clusterCenters, int clusterCenterStride, float* __restrict newClusterCenters, size_t* __restrict clusterMemberCounts, size_t* __restrict clusterBindings, float* sumOfClusterDistances ); //--------------------------------------------------------------------------- /// @brief /// Function for computing cluster centers and cluster bindings /// for a set of normalized points of dimension dim. Cluster centers /// are also normalized (see remark below) /// /// @param points /// Array of all points. Array size must be greater than /// numPoints * dim. /// /// @param numPoints /// Number of points in points array. /// /// @param dim /// dimension, e.g. 36 /// /// @param pointStride /// Byte distance between adjacent points in array /// /// @param indices /// Array of point indices in points array. Processing will only /// occur on points whose indices are in this array. Each index in array /// must be smaller numPoints. /// /// @param numIndices /// Length of indices array. numIndieces must be <= numPoints. /// /// @param numClusters /// Number of cluster centers /// /// @param clusterCenters /// current cluster centers; /// elements are distant by clusterCenterStride /// /// @param clusterCenterStride /// byte distance between adjacent cluster centers in array /// /// @param newClusterCenters /// array for new cluster centers; should be numClusterCenters long /// /// @param clusterMemberCounts /// Element counts for each cluster; should be numClusterCenters long /// /// @param clusterBindings /// Output indices of the clusters to which each vector belongs to, a /// rray must be numIndices long. /// /// @param sumOfClusterDistances /// Array for sum of distances of cluster elements to cluster centers; /// Must be numClusters long /// /// @return /// 0 if successfully clustered, otherwise error code /// /// @remark /// this function assumes that points are normalized (e.g. NFT4 /// descriptors). Cluster centers are also normalized. Normalized points /// are on a surface of unit sphere which is not a vector space but /// curved manifold of dimension (dim-1) embeded in Euclidean vector space /// of dimension dim /// /// @ingroup clustering_and_search //--------------------------------------------------------------------------- FASTCV_API int fcvClusterEuclideanNormedf32( const float* __restrict points, int numPoints, int dim, int pointStride, const size_t* __restrict indices, int numIndices, int numClusters, float* __restrict clusterCenters, int clusterCenterStride, float* __restrict newClusterCenters, size_t* __restrict clusterMemberCounts, size_t* __restrict clusterBindings, float* sumOfClusterDistances ); //--------------------------------------------------------------------------- /// @brief /// Function for computing cluster centers and cluster bindings /// for a set of normalized points of dimension 36. Cluster centers /// are also normalized (see remark below) /// /// @param points /// Array of all points. Array size must be greater than /// numPoints * 36. /// /// @param numPoints /// Number of points in points array. /// /// @param pointStride /// Byte distance between adjacent points in array /// /// @param indices /// Array of point indices in points array. Processing will only /// occur on points whose indices are in this array. Each index in array /// must be smaller numPoints. /// /// @param numIndices /// Length of indices array. numIndieces must be <= numPoints. /// /// @param numClusters /// Number of cluster centers /// /// @param clusterCenters /// current cluster centers; /// elements are distant by clusterCenterStride /// /// @param clusterCenterStride /// byte distance between adjacent cluster centers in array /// /// @param newClusterCenters /// array for new cluster centers; should be numClusterCenters long /// /// @param clusterMemberCounts /// Element counts for each cluster; should be numClusterCenters long /// /// @param clusterBindings /// Output indices of the clusters to which each vector belongs to, a /// rray must be numIndices long. /// /// @param sumOfClusterDistances /// Array for sum of distances of cluster elements to cluster centers; /// Must be numClusters long /// /// @return /// 0 if successfully clustered, otherwise error code /// /// @remark /// this function assumes that points are normalized (e.g. NFT4 /// descriptors). Cluster centers are also normalized. Normalized points /// are on a surphace of unit sphere which is not a vector space but /// curved manifold of dimension (dim-1) embeded in Euclidean vector space /// of dimension dim /// /// @ingroup clustering_and_search //--------------------------------------------------------------------------- FASTCV_API int fcvClusterEuclideanNormed36f32( const float* __restrict points, int numPoints, int pointStride, const size_t* __restrict indices, int numIndices, int numClusters, float* __restrict clusterCenters, int clusterCenterStride, float* __restrict newClusterCenters, size_t* __restrict clusterMemberCounts, size_t* __restrict clusterBindings, float* sumOfClusterDistances ); //--------------------------------------------------------------------------- /// @brief /// Blur with 5x5 Gaussian filter /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterGaussian5x5s16_v2(). In the 2.0.0 release, /// fcvFilterGaussian5x5s16_v2 will be renamed to fcvFilterGaussian5x5s16 /// and the signature of fcvFilterGaussian5x5s16 as it appears now, /// will be removed. /// \n\n /// /// @details /// Convolution with 5x5 Gaussian kernel: /// \n 1 4 6 4 1 /// \n 4 16 24 16 4 /// \n 6 24 36 24 6 /// \n 4 16 24 16 4 /// \n 1 4 6 4 1 /// /// @param src /// Input int data (can be sq. of gradient, etc). /// \n\b NOTE: Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param dst /// Output int data. Size of buffer is srcWidth*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param blurBorder /// If set to 0, border is ignored. /// If set to 1, border is blurred by 0-padding adjacent values. /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvFilterGaussian5x5s16( const int16_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, int16_t* __restrict dst, int blurBorder ); //--------------------------------------------------------------------------- /// @brief /// Blur with 5x5 Gaussian filter /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterGaussian5x5s16() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterGaussian5x5s16, /// \a fcvFilterGaussian5x5s16_v2 will be removed, and the current signature /// for \a fcvFilterGaussian5x5s16 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterGaussian5x5s16 when transitioning to 2.0.0. /// \n\n /// /// @details /// Convolution with 5x5 Gaussian kernel: /// \n 1 4 6 4 1 /// \n 4 16 24 16 4 /// \n 6 24 36 24 6 /// \n 4 16 24 16 4 /// \n 1 4 6 4 1 /// /// @param src /// Input int data (can be sq. of gradient, etc). /// Size of buffer is srcStride*srcHeight*2 bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output int data. Size of buffer is dstStride*srcHeight*2 bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dstStride /// Output stride. /// \n\b NOTE: if 0, edstStrid is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param blurBorder /// If set to 0, border is ignored. /// If set to 1, border is blurred by 0-padding adjacent values. /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvFilterGaussian5x5s16_v2( const int16_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict dst, unsigned int dstStride, int blurBorder ); //--------------------------------------------------------------------------- /// @brief /// Blur with 5x5 Gaussian filter /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterGaussian5x5s32_v2(). In the 2.0.0 release, /// fcvFilterGaussian5x5s32_v2 will be renamed to fcvFilterGaussian5x5s32 /// and the signature of fcvFilterGaussian5x5s32 as it appears now, /// will be removed. /// \n\n /// /// @details /// Convolution with 5x5 Gaussian kernel: /// \n 1 4 6 4 1 /// \n 4 16 24 16 4 /// \n 6 24 36 24 6 /// \n 4 16 24 16 4 /// \n 1 4 6 4 1 /// /// @param src /// Input int data (can be sq. of gradient, etc). /// Size of buffer is srcWidth*srcHeight*4 bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param dst /// Output int data. Size of buffer is srcWidth*srcHeight*4 bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param blurBorder /// If set to 0, border is ignored. /// If set to 1, border is blurred by 0-padding adjacent values. /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvFilterGaussian5x5s32( const int32_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, int32_t* __restrict dst, int blurBorder ); //--------------------------------------------------------------------------- /// @brief /// Blur with 5x5 Gaussian filter /// /// \n\b ATTENTION: This function is a duplication of of /// fcvFilterGaussian5x5s32() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvFilterGaussian5x5s32, /// \a fcvFilterGaussian5x5s32_v2 will be removed, and the current signature /// for \a fcvFilterGaussian5x5s32 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvFilterGaussian5x5s32 when transitioning to 2.0.0. /// \n\n /// /// @details /// Convolution with 5x5 Gaussian kernel: /// \n 1 4 6 4 1 /// \n 4 16 24 16 4 /// \n 6 24 36 24 6 /// \n 4 16 24 16 4 /// \n 1 4 6 4 1 /// /// @param src /// Input int data (can be sq. of gradient, etc). /// Size of buffer is srcStride*srcHeight*4 bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Image stride. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dst /// Output int data. Size of buffer is dstStride*srcHeight*4 bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dstStride /// Output stride. /// \n\b NOTE: if 0, dstStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param blurBorder /// If set to 0, border is ignored. /// If set to 1, border is blurred by 0-padding adjacent values. /// /// @ingroup image_processing //--------------------------------------------------------------------------- FASTCV_API void fcvFilterGaussian5x5s32_v2( const int32_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int32_t* __restrict dst, unsigned int dstStride, int blurBorder ); //--------------------------------------------------------------------------- /// @brief /// Warps the patch centered at nPos in the input image using the affine /// transform in nAffine /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvTransformAffineu8_v2(). In the 2.0.0 release, /// fcvTransformAffineu8_v2 will be renamed to fcvTransformAffineu8 /// and the signature of fcvTransformAffineu8 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image. Size of buffer is srcWidth*srcHeight bytes. /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param position[ 2 ] /// Position in the image /// \n\b WARNING: must be 64-bit aligned. /// /// @param affine[ 2 ][ 2 ] /// Transformation matrix. The matrix stored /// in affine is using row major ordering: \n /// a11, a12, a21, a22 where the matrix is: \n /// | a11, a12 |\n /// | a21, a22 |\n /// /// \n\b WARNING: must be 128-bit aligned. /// /// @param patch /// Transformed patch. /// /// @param patchWidth /// Patch width. /// /// @param patchHeight /// Patch height. /// /// @returns 0 if the transformation is valid /// /// @ingroup image_transform //--------------------------------------------------------------------------- FASTCV_API int fcvTransformAffineu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, const float* __restrict position, const float* __restrict affine, uint8_t* __restrict patch, unsigned int patchWidth, unsigned int patchHeight ); //--------------------------------------------------------------------------- /// @brief /// Warps the patch centered at nPos in the input image using the affine /// transform in nAffine /// /// \n\b ATTENTION: This function is a duplication of of /// fcvTransformAffineu8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvTransformAffineu8, /// \a fcvTransformAffineu8_v2 will be removed, and the current signature /// for \a fcvTransformAffineu8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvTransformAffineu8 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image. Size of buffer is srcStride*srcHeight bytes. /// /// @param srcWidth /// Image width. /// /// @param srcHeight /// Image height. /// /// @param srcStride /// Stride of image (in bytes) - i.e., how many bytes between column 0 of row N /// and column 0 of row N+1. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be at least as much as srcWidth if not 0. /// /// @param position[ 2 ] /// Position in the image /// \n\b WARNING: must be 64-bit aligned. /// /// @param affine[ 2 ][ 2 ] /// Transformation matrix. The matrix stored /// in affine is using row major ordering: \n /// a11, a12, a21, a22 where the matrix is: \n /// | a11, a12 |\n /// | a21, a22 |\n /// /// \n\b WARNING: must be 128-bit aligned. /// /// @param patch /// Transformed patch. /// /// @param patchWidth /// Patch width. /// /// @param patchHeight /// Patch height. /// /// @param patchStride /// Stride of patch (in bytes) - i.e., how many bytes between column 0 of row N /// and column 0 of row N+1. /// \n\b NOTE: if 0, patchStride is set as patchWidth. /// \n\b WARNING: must be at least as much as patchWidth if not 0. /// /// @returns 0 if the transformation is valid /// /// @ingroup image_transform //--------------------------------------------------------------------------- FASTCV_API int fcvTransformAffineu8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, const float* __restrict position, const float* __restrict affine, uint8_t* __restrict patch, unsigned int patchWidth, unsigned int patchHeight, unsigned int patchStride ); //--------------------------------------------------------------------------- /// @brief /// Extracts a 17x17 rotation corrected patch from a 25x25 image. /// /// @param src /// 25x25 input image in continuous memory. /// /// @param dst /// 17x17 output patch. /// /// @param orientation /// Rotation angle of patch relative to src. /// \n 10-bit fixed-point angle around unit circle. /// \n NOTE: 0 = 0 degrees and 1024 = 360 degrees. /// /// @ingroup image_transform //--------------------------------------------------------------------------- FASTCV_API void fcvCopyRotated17x17u8( const uint8_t* __restrict src, uint8_t* __restrict dst, int orientation ); //------------------------------------------------------------------------------ /// @brief /// Counts "1" bits in supplied vector. /// /// @param src /// Pointer to vector to count bits that are 1. /// /// @param srcLength /// Length of the vector to count bits. Assumed that the remainder of bits modulo 8 /// will be set to 0 a priori. /// /// @returns total number of "1" bits in supplied vector /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvBitCountu8( const uint8_t* __restrict src, unsigned int srcLength ); //------------------------------------------------------------------------------ /// @brief /// Counts "1" bits in supplied 32-byte vector. /// /// @param src /// Pointer to 32-byte vector(s) to count bits that are 1. /// /// @returns total number of "1" bits in supplied vector /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvBitCount32x1u8( const uint8_t* __restrict src ); //------------------------------------------------------------------------------ /// @brief /// Counts bits in supplied 4, 32-byte vectors. /// /// @param a /// Pointer to 32-byte vector to count bits. /// /// @param b /// Pointer to 32-byte vector to count bits. /// /// @param c /// Pointer to 32-byte vector to count bits. /// /// @param d /// Pointer to 32-byte vector to count bits. /// /// @param bitCount /// Array to store the four resultant bit counts. /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvBitCount32x4u8( const uint8_t* __restrict a, const uint8_t* __restrict b, const uint8_t* __restrict c, const uint8_t* __restrict d, uint32_t* __restrict bitCount ); //------------------------------------------------------------------------------ /// @brief /// Counts bits in supplied 64-byte vector. /// /// @param src /// Pointer to 64-byte vector(s) to count bits. /// /// @return /// Bit count. /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvBitCount64x1u8( const uint8_t* __restrict src ); //------------------------------------------------------------------------------ /// @brief /// Counts bits in supplied 4, 64-byte vectors. /// /// @param a /// Pointer to 64-byte vector to count bits. /// /// @param b /// Pointer to 64-byte vector to count bits. /// /// @param c /// Pointer to 64-byte vector to count bits. /// /// @param d /// Pointer to 64-byte vector to count bits. /// /// @param bitCount /// Array to store the four resultant bit counts. /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvBitCount64x4u8( const uint8_t* __restrict a, const uint8_t* __restrict b, const uint8_t* __restrict c, const uint8_t* __restrict d, uint32_t* __restrict bitCount ); //------------------------------------------------------------------------------ /// @brief /// Counts bits in supplied vector of unsigned intergers. /// /// @param src /// Pointer to vector(s) to count bits. /// /// @param srcLength /// Number of elements in vector /// /// @return /// Bit count. /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvBitCountu32( const uint32_t* __restrict src, unsigned int srcLength ); //------------------------------------------------------------------------------ /// @brief /// Computes the Hamming distance between the two supplied arbitrary length /// vectors. /// /// @param a /// Pointer to vector to compute distance. /// /// @param b /// Pointer to vector to compute distance. /// /// @param abLength /// Length in bits of each of the vectors. Assumed that the remainder of /// bits modulo 8 will be set to 0 a priori. /// /// @return /// Hamming distance between the two vectors. /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvHammingDistanceu8( const uint8_t* __restrict a, const uint8_t* __restrict b, unsigned int abLength ); //------------------------------------------------------------------------------ /// @brief /// Computes the Hamming distance between the two supplied 32-byte vectors. /// /// @param a /// Pointer to 32-byte vector to compute distance. /// \n\b WARNING: must be 32-bit aligned /// /// @param b /// Pointer to 32-byte vector to compute distance. /// \n\b WARNING: must be 32-bit aligned /// /// @return /// Hamming distance between the two vectors. /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvHammingDistance32x1u8a4( const uint8_t* __restrict a, const uint8_t* __restrict b ); //------------------------------------------------------------------------------ /// @brief /// Computes the Hamming distance between the two supplied 64-byte vectors. /// /// @param a /// Pointer to 64-byte vector to compute distance. /// \n\b WARNING: must be 32-bit aligned /// /// @param b /// Pointer to 64-byte vector to compute distance. /// \n\b WARNING: must be 32-bit aligned /// /// @return /// Hamming distance between the two vectors. /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvHammingDistance64x1u8a4( const uint8_t* __restrict a, const uint8_t* __restrict b ); //------------------------------------------------------------------------------ /// @brief /// Computes the Hamming distance between the two supplied 32-byte vectors. /// /// @param a /// Pointer to 32-byte vector to compute distance. /// /// @param b /// Pointer to 32-byte vector to compute distance. /// /// @return /// Hamming distance between the two vectors. /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvHammingDistance32x1u8( const uint8_t* __restrict a, const uint8_t* __restrict b ); //------------------------------------------------------------------------------ /// @brief /// Computes the Hamming distance between the two supplied 64-byte vectors. /// /// @param a /// Pointer to 64-byte vector to compute distance. /// \n\b WARNING: must be 32-bit aligned /// /// @param b /// Pointer to 64-byte vector to compute distance. /// \n\b WARNING: must be 32-bit aligned /// /// @return /// Hamming distance between the two vectors. /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvHammingDistance64x1u8( const uint8_t* __restrict a, const uint8_t* __restrict b ); //------------------------------------------------------------------------------ /// @brief /// Computes the Hamming distance between A and each of B,C,D,E 32-byte vectors. /// /// @param a /// Pointer to 32-byte vector to compute distance. /// \n\b WARNING: must be 32-bit aligned /// /// @param b /// Pointer to 32-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param c /// Pointer to 32-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param d /// Pointer to 32-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param e /// Pointer to 32-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param hammingDistances /// Array to store each Hamming distance between the vectors. /// \n\b WARNING: must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvHammingDistance32x4u8a4( const uint8_t* __restrict a, const uint8_t* __restrict b, const uint8_t* __restrict c, const uint8_t* __restrict d, const uint8_t* __restrict e, uint32_t* __restrict hammingDistances ); //------------------------------------------------------------------------------ /// @brief /// Computes the Hamming distance between A and each of B,C,D,E 64-byte /// vectors. /// /// @param a /// Pointer to 32-byte vector to compute distance. /// \n\b WARNING: must be 32-bit aligned /// /// @param b /// Pointer to 32-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param c /// Pointer to 32-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param d /// Pointer to 32-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param e /// Pointer to 32-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param hammingDistances /// Array to store each Hamming distance between the vectors. /// \n\b WARNING: must be 128-bit aligned /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvHammingDistance64x4u8a4( const uint8_t* __restrict a, const uint8_t* __restrict b, const uint8_t* __restrict c, const uint8_t* __restrict d, const uint8_t* __restrict e, uint32_t* __restrict hammingDistances ); //------------------------------------------------------------------------------ /// @brief /// Computes the Hamming distance between A and each of B,C,D,E 64-byte vectors. /// /// @param a /// Pointer to 64-byte vector to compute distance. /// \n\b WARNING: must be 32-bit aligned /// /// @param b /// Pointer to 64-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param c /// Pointer to 64-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param d /// Pointer to 64-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param e /// Pointer to 64-byte vector to compute distance from A. /// \n\b WARNING: must be 32-bit aligned /// /// @param hammingDistances /// Array to store each Hamming distance between the vectors. /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvHammingDistance64x4u8( const uint8_t* __restrict a, const uint8_t* __restrict b, const uint8_t* __restrict c, const uint8_t* __restrict d, const uint8_t* __restrict e, uint32_t* __restrict hammingDistances ); //--------------------------------------------------------------------------- /// @brief /// Extracts FAST corners and scores from the image /// /// @param src /// 8-bit image /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width /// \n\b NOTE: must be a multiple of 8. /// \n\b WARNING: must be <= 2048. /// /// @param srcHeight /// image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param barrier /// FAST threshold. The threshold is used to compare difference between intensity value of /// the central pixel and pixels on a circle surrounding this pixel. /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// pointer to the output array cointaining the interleaved x,y position of the /// detected corners. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// \n\b NOTE: must be 128-bit aligned. /// /// @param scores /// Pointer to the output array containing the scores of the detected corners. /// The score is computed as the sum of the absolute difference between the pixels in the /// contiguous arc and the centre pixel. A higher score value indicates a stronger corner feature. /// For example, a corner of score 108 is stronger than a corner of score 50. /// \n\b NOTE: must be 128-bit aligned. /// /// @param nCornersMax /// Maximum number of corners. The function exits when the maximum number of /// corners is exceeded. /// /// @param nCorners /// pointer to an integer storing the number of corners detected /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvCornerFast9Scoreu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int barrier, unsigned int border, uint32_t* __restrict xy, uint32_t* __restrict scores, unsigned int nCornersMax, uint32_t* __restrict nCorners ); //--------------------------------------------------------------------------- /// @brief /// Extracts FAST corners and scores from the image /// /// @param src /// Grayscale image with one byte per pixel /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// image width /// \n\b NOTE: must be a multiple of 8. /// \n\b WARNING: must be <= 2048. /// /// @param srcHeight /// image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param barrier /// FAST threshold. The threshold is used to compare difference between intensity value of /// the central pixel and pixels on a circle surrounding this pixel. /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// Pointer to the output array cointaining the interleaved x,y position of the /// detected corners. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// \n\b NOTE: must be 128-bit aligned. /// /// @param scores /// Pointer to the output array containing the scores of the detected corners. /// The score is computed as the sum of the absolute difference between the pixels in the /// contiguous arc and the centre pixel. A higher score value indicates a stronger corner feature. /// For example, a corner of score 108 is stronger than a corner of score 50. /// \n\b NOTE: must be 128-bit aligned. /// /// @param nCornersMax /// Maximum number of corners. The function exits when the maximum number of /// corners is exceeded. /// /// @param nCorners /// pointer to an integer storing the number of corners detected /// /// @param mask /// Per-pixel mask for each pixel represented in input image. /// If a bit set to 0, pixel will be a candidate for corner detection. /// If a bit set to 1, pixel will be ignored. /// /// @param maskWidth /// Width of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @param maskHeight /// Height of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvCornerFast9InMaskScoreu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int barrier, unsigned int border, uint32_t* __restrict xy, uint32_t* __restrict scores, unsigned int nCornersMax, uint32_t* __restrict nCorners, const uint8_t* __restrict mask, unsigned int maskWidth, unsigned int maskHeight ); //--------------------------------------------------------------------------- /// @brief /// Extracts FAST corners and scores from the image /// /// \n\b ATTENTION: This function is a duplication of of /// fcvCornerFast9Scoreu8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvCornerFast9Scoreu8, /// \a fcvCornerFast9Scoreu8_v2 will be removed, and the current signature /// for \a fcvCornerFast9Scoreu8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvCornerFast9Scoreu8 when transitioning to 2.0.0. /// \n\n /// /// @details /// non-maximum suppression can be enabled to reduce the number of false corners. /// /// @param src /// 8-bit image where keypoints are detected. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width, the number of pixels in a row. /// \n\b NOTE: must be a multiple of 8. /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. /// \n\b NOTE: must be a multiple of 8. /// /// @param barrier /// FAST threshold. The threshold is used to compare difference between intensity value of /// the central pixel and pixels on a circle surrounding this pixel. /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// Pointer to the output array cointaining the interleaved x,y position of the /// detected corners. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// \n\b NOTE: must be 128-bit aligned. /// /// @param scores /// Pointer to the output array containing the scores of the detected corners. /// The score is computed as the sum of the absolute difference between the pixels in the /// contiguous arc and the centre pixel. A higher score value indicates a stronger corner feature. /// For example, a corner of score 108 is stronger than a corner of score 50. /// \n\b NOTE: must be 128-bit aligned. /// \n\b NOTE: size of buffer is @param nCornersMax /// /// @param nCornersMax /// Maximum number of corners. The function exits when the maximum number of /// corners is exceeded. This number should account for the number of key points before non-maximum suppression. /// /// @param nCorners /// Pointer to an integer storing the number of corners detected /// /// @param nmsEnabled /// Enable non-maximum suppresion to prune weak key points (0=disabled, 1=enabled) /// /// @param tempBuf /// Pointer to scratch buffer if nms is enabled, otherwise it can be NULL. /// Size of buffer: (3*nCornersMax+srcHeight+1)*4 bytes /// \n\b NOTE: must be 128-bit aligned. /// /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvCornerFast9Scoreu8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int barrier, unsigned int border, uint32_t* __restrict xy, uint32_t* __restrict scores, unsigned int nCornersMax, uint32_t* __restrict nCorners, uint32_t nmsEnabled, void* __restrict tempBuf); //--------------------------------------------------------------------------- /// @brief /// Extracts FAST corners and scores from the image based on the mask. The mask specifies pixels /// to be ignored by the detector. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvCornerFast9InMaskScoreu8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvCornerFast9InMaskScoreu8, /// \a fcvCornerFast9InMaskScoreu8_v2 will be removed, and the current signature /// for \a fcvCornerFast9InMaskScoreu8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvCornerFast9InMaskScoreu8 when transitioning to 2.0.0. /// \n\n /// /// @details /// non-maximum suppression can be enabled to reduce the number of false corners. /// /// @param src /// 8-bit grayscale image where keypoints are detected. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width, the number of pixels in a row. /// \n\b NOTE: must be a multiple of 8. /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. /// \n\b NOTE: must be a multiple of 8. /// /// @param barrier /// FAST threshold. The threshold is used to compare difference between intensity value of /// the central pixel and pixels on a circle surrounding this pixel. /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// Pointer to the output array cointaining the interleaved x,y position of the /// detected corners. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// \n\b NOTE: must be 128-bit aligned. /// /// @param scores /// Pointer to the output array containing the scores of the detected corners. /// The score is computed as the sum of the absolute difference between the pixels in the /// contiguous arc and the centre pixel. A higher score value indicates a stronger corner feature. /// For example, a corner of score 108 is stronger than a corner of score 50. /// \n\b NOTE: must be 128-bit aligned. /// \n\b NOTE: size of buffer is @param nCornersMax /// /// @param nCornersMax /// Maximum number of corners. The function exits when the maximum number of /// corners is exceeded. This number should account for the number of key points before non-maximum suppression. /// /// @param nCorners /// Pointer to an integer storing the number of corners detected /// /// @param mask /// Mask used to omit regions of the image. For allowed mask sizes refer to /// @param maskWidth and @param maskHeight . The mask is so defined to work with multiple /// scales if necessary. For any pixel set to '1' in the mask, the corresponding pixel in the image /// will be ignored. /// \n\b NOTE: must be 128-bit aligned. /// /// @param maskWidth /// Width of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @param maskHeight /// Height of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @param nmsEnabled /// Enable non-maximum suppresion to prune weak key points (0=disabled, 1=enabled) /// /// @param tempBuf /// Pointer to scratch buffer if nms is enabled, otherwise it can be NULL. /// Size of buffer: (3*nCornersMax+srcHeight+1)*4 bytes /// \n\b NOTE: must be 128-bit aligned. /// /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvCornerFast9InMaskScoreu8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int barrier, unsigned int border, uint32_t* __restrict xy, uint32_t* __restrict scores, unsigned int nCornersMax, uint32_t* __restrict nCorners, const uint8_t* __restrict mask, unsigned int maskWidth, unsigned int maskHeight, uint32_t nmsEnabled, void* __restrict tempBuf); //--------------------------------------------------------------------------- /// @brief /// Extracts FAST corners and scores from the image /// /// @details /// non-maximum suppression can be enabled to reduce the number of false corners. /// /// @param src /// 8-bit image where keypoints are detected. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width, the number of pixels in a row. /// \n\b NOTE: must be a multiple of 8. /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. /// \n\b NOTE: must be a multiple of 8. /// /// @param barrier /// FAST threshold. The threshold is used to compare difference between intensity value of /// the central pixel and pixels on a circle surrounding this pixel. /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// Pointer to the output array cointaining the interleaved x,y position of the /// detected corners. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// \n\b NOTE: must be 128-bit aligned. /// /// @param scores /// Pointer to the output array containing the scores of the detected corners. /// The score is computed as the sum of the absolute difference between the pixels in the /// contiguous arc and the centre pixel. A higher score value indicates a stronger corner feature. /// For example, a corner of score 108 is stronger than a corner of score 50. /// \n\b NOTE: must be 128-bit aligned. /// \n\b NOTE: size of buffer is @param nCornersMax /// /// @param nCornersMax /// Maximum number of corners. The function exits when the maximum number of /// corners is exceeded. This number should account for the number of key points before non-maximum suppression. /// /// @param nCorners /// pointer to an integer storing the number of corners detected /// /// @param nmsEnabled /// Enable non-maximum suppresion to prune weak key points (0=disabled, 1=enabled) /// /// @param tempBuf /// Pointer to scratch buffer if nms is enabled, otherwise it can be NULL. /// Size of buffer: (3*nCornersMax+srcHeight+1)*4 bytes /// \n\b NOTE: must be 128-bit aligned. /// /// @return /// void. /// /// @ingroup feature_detection //--------------------------------------------------------------------------- FASTCV_API void fcvCornerFast10Scoreu8( const uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int32_t barrier, uint32_t border, uint32_t* __restrict xy, uint32_t* __restrict scores, uint32_t nCornersMax, uint32_t* __restrict nCorners, uint32_t nmsEnabled, void* __restrict tempBuf); //--------------------------------------------------------------------------- /// @brief /// Extracts FAST corners and scores from the image based on the mask. The mask specifies pixels /// to be ignored by the detector. /// /// @param src /// 8-bit grayscale image where keypoints are detected /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// image width /// \n\b NOTE: must be a multiple of 8. /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: must be a multiple of 8. /// /// @param barrier /// FAST threshold. The threshold is used to compare difference between intensity value of /// the central pixel and pixels on a circle surrounding this pixel. /// /// @param border /// Number for pixels to ignore from top,bottom,right,left of the image /// /// @param xy /// Pointer to the output array cointaining the interleaved x,y position of the /// detected corners. /// \n\b NOTE: Remember to allocate double the size of @param nCornersMax /// \n\b NOTE: data should be 128-bit aligned. /// /// @param scores /// Pointer to the output array containing the scores of the detected corners. /// The score is computed as the sum of the absolute difference between the pixels in the /// contiguous arc and the centre pixel. A higher score value indicates a stronger corner feature. /// For example, a corner of score 108 is stronger than a corner of score 50. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param nCornersMax /// Maximum number of corners. The function exits when the maximum number of /// corners is exceeded. This number should account for the number of key points before non-maximum suppression. /// /// @param nCorners /// pointer to an integer storing the number of corners detected /// /// @param mask /// Mask used to omit regions of the image. For allowed mask sizes refer to /// @param maskWidth and @param maskHeight . The mask is so defined to work with multiple /// scales if necessary. For any pixel set to '1' in the mask, the corresponding pixel in the image /// will be ignored. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param maskWidth /// Width of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @param maskHeight /// Height of the mask. Both width and height of the mask must be 'k' times image width and height, /// where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8. /// /// @param nmsEnabled /// Enable non-maximum suppresion to prune weak key points (0=disabled, 1=enabled) /// /// @param tempBuf /// Pointer to scratch buffer if nms is enabled, otherwise it can be NULL. /// Size of buffer: (3*nCornersMax+srcHeight+1)*4 bytes /// \n\b NOTE: data should be 128-bit aligned. /// /// @return /// void. /// /// @ingroup feature_detection //--------------------------------------------------------------------------- FASTCV_API void fcvCornerFast10InMaskScoreu8( const uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int32_t barrier, uint32_t border, uint32_t* __restrict xy, uint32_t* __restrict scores, uint32_t nCornersMax, uint32_t* __restrict nCorners, const uint8_t* __restrict mask, uint32_t maskWidth, uint32_t maskHeight, uint32_t nmsEnabled, void* __restrict tempBuf); // ----------------------------------------------------------------------------- /// @brief /// Optical flow. Bitwidth optimized implementation /// /// \n\b ATTENTION: The signature of this function will be changed to remove /// unused parameters when the 2.0.0 release of this library is made. /// Until 2.0.0, the developer should use this implementation with the expectation of /// moving to a different signature when transitioning to 2.0.0. /// \n\n /// /// @param src1 /// Input image from frame #1. /// \n\b WARNING: must be 128-bit aligned. /// /// @param src2 /// Input image from frame #2. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Input image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Input image height. /// /// @param src1Pyr /// Image Pyradmid of src1 /// \n\b WARNING: obtained by calling fcvPyramidCreateu8 /// /// @param src2Pyr /// Image Pyradmid of src2 /// \n\b WARNING: obtained by calling fcvPyramidCreateu8 /// /// @param dx1Pyr /// Horizontal Sobel gradient pyramid for src1 /// \n\b NOTE: To be left NULL. In this case the function will /// build the pyramid internally. /// /// @param dy1Pyr /// Vertical Sobel grading pyraid for src1 /// \n\b NOTE: To be left NULL. In this case the function will /// build the pyramid internally. /// /// @param featureXY /// Pointer to X,Y floating point, sub-pixel coordinates for features to /// track. Stored as X,Y tuples. featureXY array storage must /// be >= featureLen*2. /// /// @param featureXY_out /// Pointer to X,Y floating point, sub-pixel coordinates for tracked features /// Stored as X,Y tuples. featureXY array storage must /// be >= featureLen*2. /// /// @param featureStatus /// Pointer to integer array for status of each feature defined in /// featureXY. featureStatus array storage must /// be >= featureLen. /// /// @param featureLen /// Number of features in featuresXY and featureStatus array. /// /// @param windowWidth /// Width of window for optical flow searching. /// \n\b NOTE: suggested value 5, 7 or 9 /// /// @param windowHeight /// Height of window for optical flow searching. /// \n\b NOTE:: suggested value 5, 7 or 9 /// /// @param maxIterations /// Maximum number of LK iterations to perform per pyramid level. /// \n\b NOTE: suggested value 5 or 7 /// /// @param nPyramidLevels /// Number of pyramid levels. /// \n\b NOTE: suggested value 3 or 4 depending on size of image /// /// @param maxResidue /// Maximum feature residue above which feature is declared lost. /// \n\b NOTE: obsolete parameters, set to 0 /// /// @param minDisplacement /// Minimum displacement solved below which iterations are stopped. /// \n\b NOTE: obsolete parameters, set to 0 /// /// @param minEigenvalue /// Threshold for feature goodness. If it is set it to 0, the check is disabled. /// \n\b NOTE: If good features are passed to the function, then it is suggested /// that you set it to 0 to have faster function time /// \n\b NOTE: obsolete parameters, set to 0 /// /// @param lightingNormalized /// if 1 Enable lightning normalization /// \n if 0 Disable lightning normalization /// \n\b NOTE: obsolete parameters, set to 0 /// /// @ingroup object_detection // ----------------------------------------------------------------------------- FASTCV_API void fcvTrackLKOpticalFlowu8( const uint8_t* __restrict src1, const uint8_t* __restrict src2, int srcWidth, int srcHeight, const fcvPyramidLevel* src1Pyr, const fcvPyramidLevel* src2Pyr, const fcvPyramidLevel* dx1Pyr, const fcvPyramidLevel* dy1Pyr, const float* featureXY, float* featureXY_out, int32_t* featureStatus, int featureLen, int windowWidth, int windowHeight, int maxIterations, int nPyramidLevels, float maxResidue, float minDisplacement, float minEigenvalue, int lightingNormalized ); // ----------------------------------------------------------------------------- /// @brief /// Optical flow. /// /// \n\b ATTENTION: This function will be removed when the 2.0.0 release of this library /// is made. Until 2.0.0, the developer should use this implementation with the expectation of /// using \a fcvTrackLKOpticalFlowu8 when transitioning to 2.0.0. /// \n\n /// /// @param src1 /// Input image from frame #1. /// \n\b WARNING: must be 128-bit aligned. /// /// @param src2 /// Input image from frame #2. /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Input image width. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Input image height. /// /// @param src1Pyr /// Image Pyradmid of src1 /// \n\b WARNING: obtained by calling fcvPyramidCreateu8 /// /// @param src2Pyr /// Image Pyradmid of src2 /// \n\b WARNING: obtained by calling fcvPyramidCreateu8 /// /// @param dx1Pyr /// Horizontal Sobel gradient pyramid for src1 /// \n\b NOTE: To be left NULL. In this case the function will /// build the pyramid internally. /// /// @param dy1Pyr /// Vertical Sobel grading pyraid for src1 /// \n\b NOTE: To be left NULL. In this case the function will /// build the pyramid internally. /// /// @param featureXY /// Pointer to X,Y floating point, sub-pixel coordinates for features to /// track. Stored as X,Y tuples. featureXY array storage must /// be >= featureLen*2. /// /// @param featureXY_out /// Pointer to X,Y floating point, sub-pixel coordinates for tracked features /// Stored as X,Y tuples. featureXY array storage must /// be >= featureLen*2. /// /// @param featureStatus /// Pointer to integer array for status of each feature defined in /// featureXY. featureStatus array storage must /// be >= featureLen. /// \n\b NOTE: Possible status are : /// \n TRACKED 1 /// \n NOT_FOUND -1 /// \n SMALL_DET -2 /// \n MAX_ITERATIONS -3 /// \n OUT_OF_BOUNDS -4 /// \n LARGE_RESIDUE -5 /// \n SMALL_EIGVAL -6 /// \n INVALID -99 /// /// @param featureLen /// Number of features in featuresXY and featureStatus array. /// /// @param windowWidth /// Width of window for optical flow searching. /// \n\b NOTE: suggested value 5, 7 or 9 /// /// @param windowHeight /// Height of window for optical flow searching. /// \n\b NOTE:: suggested value 5, 7 or 9 /// /// @param maxIterations /// Maximum number of LK iterations to perform per pyramid level. /// \n\b NOTE: suggested value 5 or 7 /// /// @param nPyramidLevels /// Number of pyramid levels. /// \n\b NOTE: suggested value 3 or 4 depending on size of image /// /// @param maxResidue /// Maximum feature residue above which feature is declared lost. /// \n\b NOTE: obsolete parameters, set to 0 /// /// @param minDisplacement /// Minimum displacement solved below which iterations are stopped. /// \n\b NOTE : Suggest that be set to between 0.1 and 0.2, say 0.15 /// \n\b NOTE: obsolete parameters, set to 0 /// /// @param minEigenvalue /// Threshold for feature goodness. If it is set it to 0, the check is disabled. /// \n\b NOTE: If good features are passed to the function, then it is suggested /// that you set it to 0 to have faster function time /// \n\b NOTE: obsolete parameters, set to 0 /// /// @param lightingNormalized /// if 1 Enable lightning normalization /// \n if 0 Disable lightning normalization /// \n\b NOTE: obsolete parameters, set to 0 /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API void fcvTrackLKOpticalFlowf32( const uint8_t* __restrict src1, const uint8_t* __restrict src2, unsigned int srcWidth, unsigned int srcHeight, const fcvPyramidLevel* src1Pyr, const fcvPyramidLevel* src2Pyr, const fcvPyramidLevel* dx1Pyr, const fcvPyramidLevel* dy1Pyr, const float* featureXY, float* featureXY_out, int32_t* featureStatus, int featureLen, int windowWidth, int windowHeight, int maxIterations, int nPyramidLevels, float maxResidue, float minDisplacement, float minEigenvalue, int lightingNormalized ); // ----------------------------------------------------------------------------- /// @brief /// Builds an image pyramid of float32 arising from a single /// original image - that are successively downscaled w.r.t. the /// pre-set levels. /// \n\b NOTE: Memory should be deallocated using fcvPyramidDelete /// /// @param src /// Base image. Size of buffer is srcWidth*srcHeight*4 bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of base image /// \n\b WARNING: must be a multiple of 2^numLevels /// /// @param srcHeight /// Height of base image /// \n\b WARNING: must be a multiple of 2^numLevels /// /// @param numLevels /// Number of levels of the pyramid /// /// @param pyramid /// Output pyramid of numLevels+1 images of the same type as src . /// pyramid[0] will be the same as src . pyramid[1] is the next /// pyramid layer, a smoothed and down-sized src , and so on. /// /// @ingroup image_processing //------------------------------------------------------------------------------- FASTCV_API int fcvPyramidCreatef32( const float* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int numLevels, fcvPyramidLevel* pyramid ); // ----------------------------------------------------------------------------- /// @brief /// Builds an image pyramid of uint8_t arising from a single /// original image - that are successively downscaled w.r.t. the /// pre-set levels. /// \n\b NOTE: Memory should be deallocated using fcvPyramidDelete /// /// @param src /// Base image. Size of buffer is srcWidth*srcHeight bytes. /// /// @param srcWidth /// Width of base image /// \n\b WARNING: must be a multiple of 2^(numLevels-1) /// /// @param srcHeight /// height of base image /// \n\b NOTE: must be a multiple of 2^(numLevels-1) /// /// @param numLevels /// Number of levels of the pyramid /// /// @param pyramid /// Output pyramid of numLevels+1 images of the same type as src . /// pyramid[0] will be the same as src . pyramid[1] is the next /// pyramid layer, a smoothed and down-sized src , and so on. /// /// @ingroup image_processing //------------------------------------------------------------------------------- FASTCV_API int fcvPyramidCreateu8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int numLevels, fcvPyramidLevel* pyramid ); // ----------------------------------------------------------------------------- /// @brief /// Creates a gradient pyramid of int16_t from an image pyramid of uint8_t /// /// @param imgPyr /// Input Image Pyramid /// /// @param dxPyr /// Horizontal Sobel gradient pyramid /// /// @param dyPyr /// Verical Sobel gradient pyramid /// /// @param numLevels /// Number of levels in the pyramids /// /// @ingroup image_processing //------------------------------------------------------------------------------- FASTCV_API int fcvPyramidSobelGradientCreatei16( const fcvPyramidLevel* imgPyr, fcvPyramidLevel* dxPyr, fcvPyramidLevel* dyPyr, unsigned int numLevels ); // ----------------------------------------------------------------------------- /// @brief /// Creates a gradient pyramid of float32 from an image pyramid of uint8_t /// /// @param imgPyr /// input Image Pyramid /// /// @param dxPyr /// Horizontal Sobel gradient pyramid /// /// @param dyPyr /// Verical Sobel gradient pyramid /// /// @param numLevels /// Number of levels in the pyramids /// /// @ingroup image_processing //------------------------------------------------------------------------------- FASTCV_API int fcvPyramidSobelGradientCreatef32( const fcvPyramidLevel* imgPyr, fcvPyramidLevel* dxPyr, fcvPyramidLevel* dyPyr, unsigned int numLevels ); // ----------------------------------------------------------------------------- /// @brief /// Creates a gradient pyramid of integer8 from an image pyramid of uint8_t /// /// @param imgPyr /// input Image Pyramid /// /// @param dxPyr /// Horizontal Sobel gradient pyramid /// /// @param dyPyr /// Verical Sobel gradient pyramid /// /// @param numLevels /// Number of levels in the pyramids /// /// @ingroup image_processing // ----------------------------------------------------------------------------- FASTCV_API int fcvPyramidSobelGradientCreatei8( const fcvPyramidLevel* imgPyr, fcvPyramidLevel* dxPyr, fcvPyramidLevel* dyPyr, unsigned int numLevels ); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientSobelPlanars16_v3(). In the 2.0.0 release, /// fcvImageGradientSobelPlanars16_v3 will be renamed to fcvImageGradientSobelPlanars16 /// and the signature of fcvImageGradientSobelPlanars16 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 /// /// @param dx /// Buffer to store horizontal gradient. Must be (width)*(height) in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values /// Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (width)*(height) in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values /// Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelPlanars16( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict dx, int16_t* __restrict dy); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientSobelPlanars16_v3(). In the 2.0.0 release, /// fcvImageGradientSobelPlanars16_v3 will be renamed to fcvImageGradientSobelPlanars16 /// and the signature of fcvImageGradientSobelPlanars16_v2 and /// fcvImageGradientSobelPlanars16_v3 as it appears now, will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dx /// Buffer to store horizontal gradient. Must be (dxyStride)*(height) bytes in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values /// Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (dxyStride)*(height) bytes in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values /// Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dxyStride /// Stride (in bytes) of 'dx' and 'dy' gradient arrays. /// \n\b NOTE: if 0, dxyStride is set as (srcWidth*sizeof(int16_t)). /// \n\b WARNING: must be multiple of 16 (8 * 2-bytes per gradient value), and at least as much as srcWidth if not 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelPlanars16_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict dx, int16_t* __restrict dy, unsigned int dxyStride ); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data without normalization. /// This function computes central differences on 3x3 neighborhood and then convolves /// the result with Sobel kernel /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageGradientSobelPlanars16_v2() with a change in behavior: no normalization /// at the end of the calculation. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageGradientSobelPlanars16, /// \a fcvImageGradientSobelPlanars16_v2 and fcvImageGradientSobelPlanars16_v3 /// will be removed, and the current signature for \a fcvImageGradientSobelPlanars16 /// and fcvImageGradientSobelPlanars16_v3 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageGradientSobelPlanars16 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. The number of pixels in a row. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. /// \n\b NOTE: must be multiple of 8. /// /// @param dx /// Buffer to store horizontal gradient. Must be (dxyStride)*(height) bytes in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values /// \n\b NOTE: must be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (dxyStride)*(height) bytes in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values /// \n\b NOTE: must be 128-bit aligned. /// /// @param dxyStride /// Stride (in bytes) of 'dx' and 'dy' gradient arrays, is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in the gradient arrays dx or dy. If left at 0 gradStride is default to 2 * srcWidth. /// \n\b NOTE: must be multiple of 8. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelPlanars16_v3( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict dx, int16_t* __restrict dy, unsigned int dxyStride ); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel. The output is in interleaved format (i.e.) [dx][dy][dx][dy].... /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientSobelInterleaveds16_v3(). In the 2.0.0 release, /// fcvImageGradientSobelInterleaveds16_v3 will be renamed to fcvImageGradientSobelInterleaveds16 /// and the signature of fcvImageGradientSobelInterleaveds16 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 /// /// @param gradients /// Buffer to store horizontal and vertical gradient. Must be /// (width-2)*(height-2) *2 in size. /// Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelInterleaveds16( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict gradients ); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel. The output is in interleaved format (i.e.) [dx][dy][dx][dy].... /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientSobelInterleaveds16_v3(). In the 2.0.0 release, /// fcvImageGradientSobelInterleaveds16_v3 will be renamed to fcvImageGradientSobelInterleaveds16 /// and the signature of fcvImageGradientSobelInterleaveds16 and /// fcvImageGradientSobelInterleaveds16_v2 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param gradients /// Buffer to store horizontal and vertical gradient. Must be /// gradStride*(height-2) *2 bytes in size. /// Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param gradStride /// Stride (in bytes) of the interleaved gradients array. /// \n\b NOTE: if 0, gradStride is set as (srcWidth-2)*2*sizeof(int16_t). /// \n\b WARNING: must be multiple of 8, and at least as much as 4*srcWidth if not 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelInterleaveds16_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict gradients, unsigned int gradStride ); // ----------------------------------------------------------------------------- /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel. The output is in interleaved format (i.e.) [dx][dy][dx][dy].... /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// \n Compared to the original and v2 functions, this v3 functions does not normalize /// \n the gradients (divide by 8). It just returns the actual dx, dy values. /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageGradientSobelInterleaveds16_v2() with a change in behavior: no /// normalization at the end of the calculation. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageGradientSobelInterleaveds16, /// \a fcvImageGradientSobelInterleaveds16_v2 and fcvImageGradientSobelInterleaveds16_v3 /// will be removed, and the current signature for \a fcvImageGradientSobelInterleaveds16 /// and fcvImageGradientSobelInterleaveds16_v3 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageGradientSobelInterleaveds16 when transitioning to 2.0.0. /// \n\n /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. The number of pixels in a row. /// \n\b NOTE: must be a multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. /// \n\b NOTE: must be a multiple of 8. /// /// @param gradients /// Buffer to store horizontal and vertical gradient. Must be /// gradStride*(height-2) *2 bytes in size. /// \n\b NOTE: must be 128-bit aligned. /// /// @param gradStride /// Stride (in bytes) is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in the interleaved gradients array. If left at 0 gradStride is default to 4 * (srcWidth-2). /// \n\b WARNING: must be multiple of 8. /// /// @ingroup image_processing // ----------------------------------------------------------------------------- FASTCV_API void fcvImageGradientSobelInterleaveds16_v3( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16_t* __restrict gradients, unsigned int gradStride ); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel. The output is in interleaved format (i.e.) [dx][dy][dx][dy].... /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientSobelInterleavedf32_v2(). In the 2.0.0 release, /// fcvImageGradientSobelInterleavedf32_v2 will be renamed to fcvImageGradientSobelInterleavedf32 /// and the signature of fcvImageGradientSobelInterleavedf32 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 /// /// @param gradients /// Buffer to store horizontal and vertical gradient. Must be /// (width-2)*(height-2) *2 floats in size. /// Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelInterleavedf32( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* __restrict gradients); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel. The output is in interleaved format (i.e.) [dx][dy][dx][dy].... /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageGradientSobelInterleavedf32() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageGradientSobelInterleavedf32, /// \a fcvImageGradientSobelInterleavedf32_v2 will be removed, and the current signature /// for \a fcvImageGradientSobelInterleavedf32 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageGradientSobelInterleavedf32 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param gradients /// Buffer to store horizontal and vertical gradient. Must be /// gradStride*(height-2) *2 bytes in size. /// Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param gradStride /// Stride (in bytes) of the interleaved gradients array. /// \n\b NOTE: if 0, gradStride is set as (srcWidth-2)*2*sizeof(float). /// \n\b WARNING: must be multiple of 8, and at least as much as (srcWidth-2)*2*sizeof(float) if not 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelInterleavedf32_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* __restrict gradients, unsigned int gradStride); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function /// computes central differences on 3x3 neighborhood and then convolves the /// result with Sobel kernel /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvFilterGaussian3x3u8_v2(). In the 2.0.0 release, /// fcvImageGradientSobelPlanars8_v2 will be renamed to fcvImageGradientSobelPlanars8 /// and the signature of fcvImageGradientSobelPlanars8 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 /// /// @param dx /// Buffer to store horizontal gradient. Must be (width)*(height) in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (width)*(height) in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelPlanars8( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int8_t* __restrict dx, int8_t* __restrict dy); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function /// computes central differences on 3x3 neighborhood and then convolves the /// result with Sobel kernel /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageGradientSobelPlanars8() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageGradientSobelPlanars8, /// \a fcvImageGradientSobelPlanars8_v2 will be removed, and the current signature /// for \a fcvImageGradientSobelPlanars8 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageGradientSobelPlanars8 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dx /// Buffer to store horizontal gradient. Must be (dxyStride)*(height) in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (dxyStride)*(height) bytes in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dxyStride /// Stride (in bytes) of 'dx' and 'dy' gradient arrays. /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelPlanars8_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int8_t* __restrict dx, int8_t* __restrict dy, unsigned int dxyStride ); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientSobelPlanarf32_v2(). In the 2.0.0 release, /// fcvImageGradientSobelPlanarf32_v2 will be renamed to fcvImageGradientSobelPlanarf32 /// and the signature of fcvImageGradientSobelPlanarf32 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8 /// /// @param dx /// Buffer to store horizontal gradient. Must be (width)*(height) in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (width)*(height) in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelPlanarf32( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* dx, float* dy); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageGradientSobelPlanarf32() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageGradientSobelPlanarf32, /// \a fcvImageGradientSobelPlanarf32_v2 will be removed, and the current signature /// for \a fcvImageGradientSobelPlanarf32 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageGradientSobelPlanarf32 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// \n\b WARNING: must be multiple of 8, and at least as much as srcWidth if not 0. /// /// @param dx /// Buffer to store horizontal gradient. Must be (dxyStride)*(height) bytes in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (dxyStride)*(height) bytes in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dxyStride /// Stride (in bytes) of 'dx' and 'dy' gradient arrays. /// \n\b NOTE: if 0, dxyStride is set as 4*srcWidth. /// \n\b WARNING: must be multiple of 32 (8 * 4-bytes per gradient value),and at least as much as srcWidth*sizeof(float) if not 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelPlanarf32_v2( const uint8_t* __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* dx, float* dy, unsigned int dxyStride ); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function's signature will become \b OBSOLETE in a future /// release of this library (2.0.0). The new interface is specified in the /// function: fcvImageGradientSobelPlanarf32f32_v2(). In the 2.0.0 release, /// fcvImageGradientSobelPlanarf32f32_v2 will be renamed to fcvImageGradientSobelPlanarf32f32 /// and the signature of fcvImageGradientSobelPlanarf32f32 as it appears now, /// will be removed. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight floats. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride of image (i.e., how many pixels (not bytes) between column 0 of row 1 and /// column 0 of row 2). /// \n\b NOTE: if 0, srcStride is set as srcWidth. /// /// @param dx /// Buffer to store horizontal gradient. Must be (width)*(height) floats in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (width)*(height) floats in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelPlanarf32f32( const float * __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* dx, float* dy); //------------------------------------------------------------------------------ /// @brief /// Creates a 2D gradient image from source luminance data. This function computes /// central differences on 3x3 neighborhood and then convolves the result with Sobel /// kernel /// \n /// \n [ -1 0 +1 ] [ -1 -2 -1 ] /// \n dx = [ -2 0 +2 ] * src dy = [ 0 0 0 ] * src /// \n [ -1 0 +1 ] [ +1 +2 +1 ] /// /// \n\b ATTENTION: This function is a duplication of of /// fcvImageGradientSobelPlanarf32f32()() with the addition of extra parameters. /// This function has been added to allow for backward compatibility /// with the original function. When the 2.0.0 release of this library /// is made, this function will be renamed to: \a fcvImageGradientSobelPlanarf32f32(), /// \a fcvImageGradientSobelPlanarf32f32_v2 will be removed, and the current signature /// for \a fcvImageGradientSobelPlanarf32f32 will be removed. Until 2.0.0, the /// developer should use this implementation with the expectation of /// renaming it to \a fcvImageGradientSobelPlanarf32f32 when transitioning to 2.0.0. /// \n\n /// /// @param src /// Input image/patch. Size of buffer is srcStride*srcHeight floats. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param srcWidth /// Width of src data to create gradient. /// \n\b WARNING: must be multiple of 8. /// /// @param srcHeight /// Height of src data to create gradient. /// /// @param srcStride /// Stride (in bytes) of image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// \n\b WARNING: must be multiple of 32 (8 * 4-bytes), and at least as much as srcWidth*sizeof(float) if not 0. /// \n\b NOTE: if 0, srcStride is set as srcWidth*4. /// /// @param dx /// Buffer to store horizontal gradient. Must be (dxyStride)*(height) bytes in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dy /// Buffer to store vertical gradient. Must be (dxyStride)*(height) bytes in size. /// \n\b NOTE: a border of 1 pixel in size on top, bottom, left, and right /// contains undefined values. Gradient output is scaled by 1/8. /// \n\b NOTE: data should be 128-bit aligned. /// /// @param dxyStride /// Stride (in bytes) of 'dx' and 'dy' gradient arrays. /// \n\b WARNING: must be multiple of 32 (8 * 4-bytes per gradient value). /// \n\b WARNING: must be multiple of 32 (8 * 4-bytes), and at least as much as srcWidth*sizeof(float) if not 0. /// \n\b NOTE: if 0, dxyStride is set as srcWidth*4. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvImageGradientSobelPlanarf32f32_v2( const float * __restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float* dx, float* dy, unsigned int dxyStride ); //------------------------------------------------------------------------------ /// @brief /// Block Optical Flow 16x16 - Tracks all 16x16 blocks in the Region of Interest /// (ROI) from Source-1 to Source-2. Generates Motion Vectors for blocks where /// motion is detected. /// /// @details /// /// @param[in] src1 /// Pointer to source image where the original blocks are present. /// \n Dimensions should be same as \a src2, and equal to \a srcWidth, /// \a srcHeight, \a srcStride. /// \n\b WARNING: must be 128-bit aligned. Buffer size is srcStride*srcHeight bytes. /// /// @param[in] src2 /// Pointer to second source image where motion vectors for blocks in \a img1 /// are to be located. /// \n Dimensions should be same as \a src1, and equal to \a srcWidth, /// \a srcHeight, \a srcStride. /// \n\b WARNING: must be 128-bit aligned. /// /// @param[in] srcWidth /// Width of source images pointed by \a src1 and \a src2. /// /// @param[in] srcHeight /// Height of source images pointed by \a src1 and \a src2. /// /// @param[in] srcStride /// Stride of source images pointed by \a src1 and \a src2. /// /// @param[in] roiLeft /// Left co-ordinate (x0) of Region-of-Interest (ROI). /// /// @param[in] roiTop /// Top co-orgdinate (y0) of Region-of-Interest (ROI). /// /// @param[in] roiRight /// Right co-ordinate (x1) of Region-of-Interest (ROI). /// /// @param[in] roiBottom /// Bottom co-ordinate (y1) of Region-of-Interest (ROI). /// /// @param[in] shiftSize /// Distance in number of pixels (both horizontally and vertically) between /// consecutive blocks for which motion vector is searched. /// \n\b NOTE: Larger the value, less number of blocks will be tracked, and /// hence the function will run faster. /// /// @param[in] searchWidth /// Numbers of pixels horizontally on left and right of the source block (src2) where a /// match is searched for. For example, if searchWidth is 8 and searchHeight /// is 8, then the search area for any given block will be 32x32 around /// the location of that block. /// /// @param[in] searchHeight /// Numbers of pixels vertically on top and bottom of the source block (src2) where a /// match is searched for. For example, if searchWidth is 8 and searchHeight /// is 8, then the search area for any given block will be 32x32 around /// the location of that block. /// /// @param[in] searchStep /// Distance in number of pixels between consecutive search targets within /// the above search window. /// \n\b NOTE: Larger the value, more coarse the search will be and thus /// will make the fucntion run faster. Smaller the value, more dense the /// search will be, making the funciton run slower. /// /// @param[in] usePrevious /// Indicates if the function should use the existing motion vectors in /// locX and locY as the starting point for motion vector search. /// \n\b NOTE: This parameter is redundant at the moment. /// /// @param[out] numMv /// Pointer to variable that will store the count of Motion Vectors /// generated by the function. /// \n\b WARNING: This pointer should be Non-NULL. /// /// @param[out] locX /// Pointer to an array which will store the X co-ordinates of the /// original Block for which a Motion Vector is generated. /// \n\b NOTE: The array will contain \a numMv valid entries. /// \n\b WARNING: This pointer should be Non-NULL, and the array size should /// be >= number of 16x16 blocks in ROI. /// /// @param[out] locY /// Pointer to an array which will store the Y co-ordinates of the /// original Block for which a Motion Vector is generated. /// \n\b NOTE: The array will contain \a numMv valid entries. /// \n\b WARNING: This pointer should be Non-NULL, and the array size should /// be >= number of 16x16 blocks in ROI. /// /// @param[out] mvX /// Pointer to an array which will store the X co-ordinates of the block in \a src2 /// corresponding block in \a src1. (\a mvX[i]-\a locX[i]) will give the motion /// vector for the block in \a src1. /// \n\b NOTE: The array will contain \a numMv valid entries. /// \n\b WARNING: This pointer should be Non-NULL, and the array size should /// be >= number of 16x16 blocks in ROI. /// /// @param[out] mvY /// Pointer to an array which will store the Y co-ordinates of the block in \a src2 /// corresponding block in \a src1. (\a mvY[i]-\a locY[i]) will give the motion /// vector for the block in \a src1. /// \n\b NOTE: The array will contain \a numMv valid entries. /// \n\b WARNING: This pointer should be Non-NULL, and the array size should /// be >= number of 16x16 blocks in ROI. /// /// @return /// 0 - Success, Failure otherwise. /// /// @ingroup object_detection //------------------------------------------------------------------------------ FASTCV_API int fcvTrackBMOpticalFlow16x16u8( const uint8_t* __restrict src1, const uint8_t* __restrict src2, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint32_t roiLeft, uint32_t roiTop, uint32_t roiRight, uint32_t roiBottom, uint32_t shiftSize, uint32_t searchWidth, uint32_t searchHeight, uint32_t searchStep, uint32_t usePrevious, uint32_t * numMv, uint32_t * locX, uint32_t * locY, uint32_t * mvX, uint32_t * mvY); //------------------------------------------------------------------------------ /// @brief /// Performs per-element bitwise-OR operation on two 8-bit single channel images. /// Two images should have the same size. dst(I)=src1(I) V src2(I) if mask(I) is not zero. /// /// @param src1 /// Pointer to the 8-bit source image 1. /// /// @param src2 /// Pointer to the 8-bit source image 2. /// /// @param srcWidth /// Width of source images pointed by src1 and src2. /// /// @param srcHeight /// Height of source images pointed by src1 and src2. /// /// @param srcStride /// Stride of source images (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// /// @param dst /// Pointer to the 8-bit destination image. /// /// @param dstStride /// Stride of destination image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// /// @param mask /// Pointer to the 8-bit single channel mask. It specifies elements of the destination array to be changed. /// The mask is optional. If there is no mask, the value is NULL. /// /// @param maskStride /// Stride of the mask (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// If there is no mask, the value is 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvBitwiseOru8(const uint8_t* __restrict src1, const uint8_t* __restrict src2, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t * __restrict dst, uint32_t dstStride, uint8_t * __restrict mask, uint32_t maskStride ); //------------------------------------------------------------------------------ /// @brief /// Performs per-element bitwise-OR operation on two 32-bit single channel images. /// Two images should have the same size. dst(I)=src1(I) V src2(I) if mask(I) is not zero. /// /// @param src1 /// Pointer to the 32-bit source image 1. /// /// @param src2 /// Pointer to the 32-bit source image 2. /// /// @param srcWidth /// Width of source images pointed by src1 and src2. /// /// @param srcHeight /// Height of source images pointed by src1 and src2. /// /// @param srcStride /// Stride of source images (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// /// @param dst /// Pointer to the 8-bit destination image. /// /// @param dstStride /// Stride of destination image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// /// @param mask /// Pointer to the 8-bit single channel mask. It specifies elements of the destination array to be changed. /// The mask is optional. If there is no mask, the value is NULL. /// /// @param maskStride /// Stride of the mask (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// If there is no mask, the value is 0. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvBitwiseOrs32(const int32_t* __restrict src1, const int32_t* __restrict src2, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int32_t * __restrict dst, uint32_t dstStride, uint8_t * __restrict mask, uint32_t maskStride); //------------------------------------------------------------------------------ /// @brief /// Converts an image from RGB space to grayscale /// /// @details /// /// @param src /// Source 8-bit image, BGR888 format (R is lowest byte for the pixel) /// \n\b WARNING: must be 128-bit aligned. /// /// @param srcWidth /// Source image width. /// \n\b NOTE: must be a multiple of 8. /// /// @param srcHeight /// Source image height. /// /// @param srcStride /// Stride of source image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// If set to 0, srcStride=srcWidth as default /// /// @param dst /// Destination 8-bit gray-scale image. /// \n\b WARNING: must be 128-bit aligned. /// /// @param dstStride /// Stride of destination image (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). /// If set to 0, dstStride=srcStride as default /// /// /// /// @ingroup color_conversion //------------------------------------------------------------------------------ FASTCV_API void fcvColorRGB888ToGrayu8( const uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t* __restrict dst, uint32_t dstStride); //------------------------------------------------------------------------------ /// @brief /// Integral of the image tilted by 45 degrees /// /// @details /// Calculates the tilted integral image of an input image /// and adds an zero-filled border on top. Left border not zero. /// dst[i,j]=sum (src[m,n]), where n according to /// descDBTargetId. /// /// @param dbLUT /// A pointer to uint32_t [numDBLUT][2], /// which stores the starting index of descDB and /// the number of descriptors /// \n\b WARNING: must be 64-bit aligned. /// /// @param numDBLUT /// The size of dbLUT /// /// @param descDB /// A pointer to int8_t [numDescDB][36], /// which stores descriptors /// \n\b WARNING: must be 64-bit aligned. /// /// @param descDBInvLenQ38 /// A pointer to uint32_t [numDescDB], /// which stores the inverse length of descDB. /// The value is in Q38 format. /// /// @param descDBTargetId /// A pointer to uint16_t [numDescDB], /// which stores the target id. /// /// @param descDBOldIdx /// A pointer to uint32_t [numDescDB], /// which stores the old index of the desc before sorting /// /// @param numDescDB /// Number of descriptor in the database. /// /// @ingroup feature_detection //--------------------------------------------------------------------------- FASTCV_API int fcvLinearSearchPrepare8x36s8( uint32_t * __restrict dbLUT, uint32_t numDBLUT, int8_t * __restrict descDB, uint32_t * __restrict descDBInvLenQ38, uint16_t * __restrict descDBTargetId, uint32_t * __restrict descDBOldIdx, uint32_t numDescDB ); //--------------------------------------------------------------------------- /// @brief /// Perform linear search of descriptor in a database /// /// @param dbLUT /// A pointer to uint32_t [numDBLUT][2], /// which stores the starting index of descDB and /// the number of descriptors /// \n\b WARNING: must be 64-bit aligned. /// /// @param numDBLUT /// The size of dbLUT /// /// @param descDB /// A pointer to int8_t [numDescDB][36], /// which stores descriptors /// \n\b WARNING: must be 64-bit aligned. /// /// @param descDBInvLenQ38 /// A pointer to uint32_t [numDescDB], /// which stores the inverse length of descDB. /// The value is in Q38 format. /// /// @param descDBTargetId /// A pointer to uint16_t [numDescDB], /// which stores the target id. /// /// @param numDescDB /// Number of descriptor in the database. /// /// @param srcDesc /// A pointer to int8_t [numSrcDesc][36], /// which stores descriptors. /// \n\b WARNING: must be 64-bit aligned. /// /// @param srcDescInvLenQ38 /// A pointer to uint32_t [numSrcDec], /// which stores the inverse length of srcDesc. /// The value is in Q38 format. /// /// @param srcDescIdx /// A pointer to the dbLUT data /// /// @param numSrcDesc /// Number of source descriptor /// /// @param targetsToIgnore /// A list of target IDs to be ignored /// /// @param numTargetsToIgnore /// Number of targets to be ignored /// /// @param maxDistanceQ31 /// Maximum distance for correspondences. /// In Q31 format. /// /// @param correspondenceDBIdx /// A pointer to uint32_t [maxNumCorrespondences], /// which will be used by this function to output indices of featuresDB /// as a part of correspondences. /// /// @param correspondenceSrcDescIdx /// A pointer to uint32_t [maxNumCorrespondences], /// which will be used by this function to output indices of descriptors /// as a part of correspondences. /// /// @param correspondenceDistanceQ31 /// A pointer to uint32_t [maxNumCorrespondences], /// which will be used by this function to output the distances /// as a part of correspondences. /// In Q31 format. /// /// @param maxNumCorrespondences /// Maximum number of correspondences allowed /// /// @param numCorrespondences /// Number of correspondences returned by this function /// /// @ingroup feature_detection //--------------------------------------------------------------------------- FASTCV_API void fcvLinearSearch8x36s8( const uint32_t * __restrict dbLUT, uint32_t numDBLUT, const int8_t * __restrict descDB, const uint32_t * __restrict descDBInvLenQ38, const uint16_t * __restrict descDBTargetId, uint32_t numDescDB, const int8_t * __restrict srcDesc, const uint32_t * __restrict srcDescInvLenQ38, const uint32_t * __restrict srcDescIdx, uint32_t numSrcDesc, const uint16_t * __restrict targetsToIgnore, uint32_t numTargetsToIgnore, uint32_t maxDistanceQ31, uint32_t * __restrict correspondenceDBIdx, uint32_t * __restrict correspondenceSrcDescIdx, uint32_t * __restrict correspondenceDistanceQ31, uint32_t maxNumCorrespondences, uint32_t * __restrict numCorrespondences ); //------------------------------------------------------------------------------ /// @brief /// Finds only extreme outer contours in a binary image. There is no nesting /// relationship between contours. It sets hierarchy[i][2]=hierarchy[i][3]=-1 /// for all the contours. /// /// @param src /// Grayscale image with one byte per pixel. Non-zero pixels are treated as /// 1's. Zero pixels remain 0's, so the image is treated as binary. /// /// @param srcWidth /// Image width /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param maxNumContours /// Maximum number of contours can be found /// /// @param numContours /// Number of actually found contours /// /// @param numContourPoints /// Number of points in each found contour /// /// @param contourStartPoints /// Pointers to the start point of each found contour /// /// @param pointBuffer /// Pointer to point buffer for contour points' coordinates. It should /// be allocated before calling this function. /// /// @param pointBufferSize /// Size of point buffer in terms of uint32_t /// /// @param hierarchy /// Information about the image topology. It has numContours elements. /// For each contour i, the elements hierarchy[i][0], hiearchy[i][1], /// hiearchy[i][2], and hiearchy[i][3] are set to 0-based indices of the /// next and previous contours at the same hierarchical level, the first /// child contour and the parent contour, respectively. If for a contour i /// there are no next, previous, parent, or nested contours, the corresponding /// elements of hierarchy[i] will be negative. /// /// @param contourHandle /// Pointer to assistant and intermediate data. It should be allocated by /// fcvFindContoursAllocate() and deallocated by fcvFindContoursDelete(). /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvFindContoursExternalu8( uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint32_t maxNumContours, uint32_t* __restrict numContours, uint32_t* __restrict numContourPoints, uint32_t** __restrict contourStartPoints, uint32_t* __restrict pointBuffer, uint32_t pointBufferSize, int32_t hierarchy[][4], void* contourHandle ); //------------------------------------------------------------------------------ /// @brief /// Finds contours in a binary image without any hierarchical relationships. /// /// @param src /// Grayscale image with one byte per pixel. Non-zero pixels are treated as /// 1's. Zero pixels remain 0's, so the image is treated as binary. /// /// @param srcWidth /// Image width /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param maxNumContours /// Maximum number of contours can be found /// /// @param numContours /// Number of actually found contours /// /// @param numContourPoints /// Number of points in each found contour /// /// @param contourStartPoints /// Pointers to the start point of each found contour /// /// @param pointBuffer /// Pointer to point buffer for contour points' coordinates. It should /// be allocated before calling this function. /// /// @param pointBufferSize /// Size of point buffer in terms of uint32_t /// /// @param contourHandle /// Pointer to assistant and intermediate data. It should be allocated by /// fcvFindContoursAllocate() and deallocated by fcvFindContoursDelete(). /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvFindContoursListu8( uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint32_t maxNumContours, uint32_t* __restrict numContours, uint32_t* __restrict numContourPoints, uint32_t** __restrict contourStartPoints, uint32_t* __restrict pointBuffer, uint32_t pointBufferSize, void* contourHandle ); //------------------------------------------------------------------------------ /// @brief /// Finds contours in a binary image and organizes them into a two-level /// hierarchy. At the top level, there are external boundaries of the /// components. At the second level, there are boundaries of the holes. /// If there is another contour inside a hole of a connected component, /// it is still put at the top level. /// /// @param src /// Grayscale image with one byte per pixel. Non-zero pixels are treated as /// 1's. Zero pixels remain 0's, so the image is treated as binary. /// /// @param srcWidth /// Image width /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param maxNumContours /// Maximum number of contours can be found (<= 126) /// /// @param numContours /// Number of actually found contours /// /// @param holeFlag /// Hole flag for each found contour to indicate whether it is a hole or not /// /// @param numContourPoints /// Number of points in each found contour /// /// @param contourStartPoints /// Pointers to the start point of each found contour /// /// @param pointBuffer /// Pointer to point buffer for contour points' coordinates. It should /// be allocated before calling this function. /// /// @param pointBufferSize /// Size of point buffer in terms of uint32_t /// /// @param hierarchy /// Information about the image topology. It has numContours elements. /// For each contour i, the elements hierarchy[i][0], hiearchy[i][1], /// hiearchy[i][2], and hiearchy[i][3] are set to 0-based indices of the /// next and previous contours at the same hierarchical level, the first /// child contour and the parent contour, respectively. If for a contour i /// there are no next, previous, parent, or nested contours, the corresponding /// elements of hierarchy[i] will be negative. /// /// @param contourHandle /// Pointer to assistant and intermediate data. It should be allocated by /// fcvFindContoursAllocate() and deallocated by fcvFindContoursDelete(). /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvFindContoursCcompu8( uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint32_t maxNumContours, uint32_t* __restrict numContours, uint32_t* __restrict holeFlag, uint32_t* __restrict numContourPoints, uint32_t** __restrict contourStartPoints, uint32_t* __restrict pointBuffer, uint32_t pointBufferSize, int32_t hierarchy[][4], void* contourHandle ); //------------------------------------------------------------------------------ /// @brief /// Finds contours in a binary image and reconstructs a full hierarchy of /// nested contours /// /// @param src /// Grayscale image with one byte per pixel. Non-zero pixels are treated as /// 1's. Zero pixels remain 0's, so the image is treated as binary. /// /// @param srcWidth /// Image width /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @param numContours /// Number of actually found contours /// /// @param maxNumContours /// Maximum number of contours can be found (<= 126) /// /// @param holeFlag /// Hole flag for each found contour to indicate whether it is a hole or not /// /// @param numContourPoints /// Number of points in each found contour /// /// @param contourStartPoints /// Pointers to the start point of each found contour /// /// @param pointBuffer /// Pointer to point buffer for contour points' coordinates. It should /// be allocated before calling this function. /// /// @param pointBufferSize /// Size of point buffer in terms of uint32_t /// /// @param hierarchy /// Information about the image topology. It has numContours elements. /// For each contour i, the elements hierarchy[i][0], hiearchy[i][1], /// hiearchy[i][2], and hiearchy[i][3] are set to 0-based indices of the /// next and previous contours at the same hierarchical level, the first /// child contour and the parent contour, respectively. If for a contour i /// there are no next, previous, parent, or nested contours, the corresponding /// elements of hierarchy[i] will be negative. /// /// @param contourHandle /// Pointer to assistant and intermediate data. It should be allocated by /// fcvFindContoursAllocate() and deallocated by fcvFindContoursDelete(). /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvFindContoursTreeu8( uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint32_t maxNumContours, uint32_t* __restrict numContours, uint32_t* __restrict holeFlag, uint32_t* __restrict numContourPoints, uint32_t** __restrict contourStartPoints, uint32_t* __restrict pointBuffer, uint32_t pointBufferSize, int32_t hierarchy[][4], void* contourHandle ); //------------------------------------------------------------------------------ /// @brief /// Allocates assistant and intermediate data for contour /// /// @param srcStride /// Stride of image (i.e., how many pixels between column 0 of row 1 and /// column 0 of row 2). /// /// @return /// Pointer to allocated data /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void* fcvFindContoursAllocate( uint32_t srcStride ); //------------------------------------------------------------------------------ /// @brief /// Deallocates assistant and intermediate data for contour /// /// @param contourHandle /// Pointer to assistant and intermediate data /// /// @ingroup feature_detection //------------------------------------------------------------------------------ FASTCV_API void fcvFindContoursDelete( void* contourHandle ); //------------------------------------------------------------------------------ /// @brief /// Solve linear equation system /// Ax = b /// /// @details /// /// /// @param A /// The matrix contains coefficients of the linear equation system /// /// @param numRows /// The number of rows for the matrix A /// /// @param numCols /// The number of columns for the matrix A /// /// @param b /// The right side value /// /// @param x /// The solution vector /// /// /// @return /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSolvef32(const float32_t * __restrict A, int32_t numCols, int32_t numRows, const float32_t * __restrict b, float32_t * __restrict x); //------------------------------------------------------------------------------ /// @brief /// Calculates a perspective transform from four pairs of the corresponding /// points. /// NOTE: in order to guarantee a valid output transform, any three points /// in src1 or src2 cannot be collinear. /// /// @param src1 /// Coordinates of quadrangle vertices in the source image /// /// @param src2 /// Coordinates of the corresponding quadrangle vertices in the destination /// image /// /// @param transformCoefficient /// 3x3 matrix of a perspective transform /// /// @ingroup image_transform //------------------------------------------------------------------------------ FASTCV_API void fcvGetPerspectiveTransformf32( const float32_t src1[8], const float32_t src2[8], float32_t transformCoefficient[9] ); //------------------------------------------------------------------------------ /// @brief /// Sets every element of a uint8_t single channel array to a given value. /// /// @details /// A non-zero element of the mask array indicates the corresponding element /// of the destination array to be changed. The mask itself equals to zero means that /// all elements of the dst array need to be changed. The mask is assumed to /// have the same width and height( in terms of pixels) as the destination array. /// /// @param dst /// The destination matrix /// /// @param dstWidth /// Destination matrix width /// /// @param dstHeight /// Destination matrix height /// /// @param dstStride /// Stride for the destination matrix, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @param value /// the input uint8_t value /// /// @param mask /// Operation mask, 8-bit single channel array; specifies elements of the src /// array to be changed. /// /// @param maskStride /// Stride for the mask, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @return /// No return value /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSetElementsu8( uint8_t * __restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, uint8_t value, const uint8_t * __restrict mask, uint32_t maskStride ); //------------------------------------------------------------------------------ /// @brief /// Sets every element of an int32_t single channel array to a given value. /// /// @details /// A non-zero element of the mask array indicates the corresponding element /// of the destination array to be changed. The mask itself equals to zero means that /// all elements of the dst array need to be changed. The mask is assumed to /// have the same width and height( in terms of pixels) as the destination array. /// /// @param dst /// The destination matrix /// /// @param dstWidth /// Destination matrix width /// /// @param dstHeight /// Destination matrix height /// /// @param dstStride /// Stride for the destination matrix, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @param value /// the input int32_t value /// /// @param mask /// Operation mask, 8-bit single channel array; specifies elements of the src /// array to be changed /// /// @param maskStride /// Stride for input mask, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @return /// No return value /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSetElementss32( int32_t * __restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, int32_t value, const uint8_t * __restrict mask , uint32_t maskStride ); //------------------------------------------------------------------------------ /// @brief /// Sets every element of a float32_t single channel array to a given value. /// /// @details /// A non-zero element of the mask array indicates the corresponding element /// of the destination array to be changed. The mask itself equals to zero means that /// all elements of the dst array need to be changed. The mask is assumed to /// have the same width and height( in terms of pixels) as the destination array. /// /// @param dst /// The destination matrix /// /// @param dstWidth /// Destination matrix width /// /// @param dstHeight /// Destination matrix height /// /// @param dstStride /// Stride for the destination matrix, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @param value /// the input float32_t value /// /// @param mask /// Operation mask, 8-bit single channel array; specifies elements of the src /// array to be changed /// /// @param maskStride /// Stride for input mask, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @return /// No return value /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSetElementsf32( float32_t * __restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, float32_t value, const uint8_t * __restrict mask, uint32_t maskStride ); //------------------------------------------------------------------------------ /// @brief /// Sets every element of a uint8_t 4-channel array to a given 4-element scalar. /// /// @details /// A non-zero element of the mask array indicates the corresponding element /// of the destination array to be changed. The mask itself equals to zero means that /// all elements of the dst array need to be changed. The mask is assumed to /// have the same width and height( in terms of pixels) as the destination array. /// /// @param dst /// The destination matrix /// /// @param dstWidth /// Destination matrix width /// /// @param dstHeight /// Destination matrix height /// /// @param dstStride /// Stride for the destination matrix, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @param value1 /// First uint8_t value of the Scalar /// /// @param value2 /// Second uint8_t value of the Scalar /// /// @param value3 /// Third uint8_t value of the Scalar /// /// @param value4 /// Fourth uint8_t value of the Scalar /// /// @param mask /// Operation mask, 8-bit single channel array; specifies elements of the src /// array to be changed /// /// @param maskStride /// Stride for input mask, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @return /// No return value /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSetElementsc4u8( uint8_t * __restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, uint8_t value1, uint8_t value2, uint8_t value3, uint8_t value4, const uint8_t * __restrict mask, uint32_t maskStride ); //------------------------------------------------------------------------------ /// @brief /// Sets every element of an int32_t 4-channel array to a given 4-element scalar. /// /// @details /// A non-zero element of the mask array indicates the corresponding element /// of the destination array to be changed. The mask itself equals to zero means that /// all elements of the dst array need to be changed. The mask is assumed to /// have the same width and height( in terms of pixels) as the destination array. /// /// @param dst /// The destination matrix /// /// @param dstWidth /// Destination matrix width /// /// @param dstHeight /// Destination matrix height /// /// @param dstStride /// Stride for the destination matrix, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @param value1 /// First int32_t value of the Scalar /// /// @param value2 /// Second int32_t value of the Scalar /// /// @param value3 /// Third int32_t value of the Scalar /// /// @param value4 /// Fourth int32_t value of the Scalar /// /// @param mask /// Operation mask, 8-bit single channel array; specifies elements of the src /// array to be changed. /// /// @param maskStride /// Stride for input mask, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @return /// No return value /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSetElementsc4s32( int32_t * __restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, int32_t value1, int32_t value2, int32_t value3, int32_t value4, const uint8_t * __restrict mask, uint32_t maskStride ); //------------------------------------------------------------------------------ /// @brief /// Sets every element of a float32_t 4-channel array to a given 4-element scalar. /// /// @details /// A non-zero element of the mask array indicates the corresponding element /// of the destination array to be changed. The mask itself equals to zero means that /// all elements of the dst array need to be changed. The mask is assumed to /// have the same width and height( in terms of pixels) as the destination array. /// /// @param dst /// The destination matrix /// /// @param dstWidth /// Destination matrix width /// /// @param dstHeight /// Destination matrix height /// /// @param dstStride /// Stride for the destination matrix, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @param value1 /// First float32_t value of the Scalar /// /// @param value2 /// Second float32_t value of the Scalar /// /// @param value3 /// Third float32_t value of the Scalar /// /// @param value4 /// Fourth float32_t value of the Scalar /// /// @param mask /// Operation mask, 8-bit single channel array; specifies elements of the src /// array to be changed /// /// @param maskStride /// Stride for input mask, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @return /// No return value /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSetElementsc4f32( float32_t * __restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, float32_t value1, float32_t value2, float32_t value3, float32_t value4, const uint8_t * __restrict mask, uint32_t maskStride ); //------------------------------------------------------------------------------ /// @brief /// Sets every element of a uint8_t 3-channel array to a given 3-element scalar. /// /// @details /// A non-zero element of the mask array indicates the corresponding element /// of the destination array to be changed. The mask itself equals to zero means that /// all elements of the dst array need to be changed. The mask is assumed to /// have the same width and height( in terms of pixels) as the destination array. /// /// @param dst /// The destination matrix /// /// @param dstWidth /// Destination matrix width /// /// @param dstHeight /// Destination matrix height /// /// @param dstStride /// Stride for the destination matrix, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @param value1 /// First uint8_t value of the Scalar /// /// @param value2 /// Second uint8_t value of the Scalar /// /// @param value3 /// Third uint8_t value of the Scalar /// /// @param mask /// Operation mask, 8-bit single channel array; specifies elements of the src /// array to be changed /// /// @param maskStride /// Stride for input mask, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @return /// No return value /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSetElementsc3u8( uint8_t * __restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, uint8_t value1, uint8_t value2, uint8_t value3, const uint8_t * __restrict mask, uint32_t maskStride ); //------------------------------------------------------------------------------ /// @brief /// Sets every element of an int32_t 3-channel array to a given 3-element scalar. /// /// @details /// A non-zero element of the mask array indicates the corresponding element /// of the destination array to be changed. The mask itself equals to zero means that /// all elements of the dst array need to be changed. The mask is assumed to /// have the same width and height( in terms of pixels) as the destination array. /// /// @param dst /// The destination matrix /// /// @param dstWidth /// Destination matrix width /// /// @param dstHeight /// Destination matrix height /// /// @param dstStride /// Stride for the destination matrix, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @param value1 /// First int32_t value of the Scalar /// /// @param value2 /// Second int32_t value of the Scalar /// /// @param value3 /// Third int32_t value of the Scalar /// /// @param mask /// Operation mask, 8-bit single channel array; specifies elements of the src /// array to be changed. /// /// @param maskStride /// Stride for input mask, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @return /// No return value /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSetElementsc3s32( int32_t * __restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, int32_t value1, int32_t value2, int32_t value3, const uint8_t * __restrict mask, uint32_t maskStride ); //------------------------------------------------------------------------------ /// @brief /// Sets every element of a float32_t 3-channel array to a given 3-element scalar. /// /// @details /// A non-zero element of the mask array indicates the corresponding element /// of the destination array to be changed. The mask itself equals to zero means that /// all elements of the dst array need to be changed. The mask is assumed to /// have the same width and height( in terms of pixels) as the destination array. /// /// @param dst /// The destination matrix /// /// @param dstWidth /// Destination matrix width /// /// @param dstHeight /// Destination matrix height /// /// @param dstStride /// Stride for the destination matrix, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @param value1 /// First float32_t value of the Scalar /// /// @param value2 /// Second float32_t value of the Scalar /// /// @param value3 /// Third float32_t value of the Scalar /// /// @param mask /// Operation mask, 8-bit single channel array; specifies elements of the src /// array to be changed /// /// @param maskStride /// Stride for input mask, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row /// /// @return /// No return value /// /// @ingroup math_vector //------------------------------------------------------------------------------ FASTCV_API void fcvSetElementsc3f32( float32_t * __restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, float32_t value1, float32_t value2, float32_t value3, const uint8_t * __restrict mask, uint32_t maskStride ); //------------------------------------------------------------------------------ /// @brief /// Defines an enumeration to list threshold types used in fcvAdaptiveThreshold //------------------------------------------------------------------------------ typedef enum { FCV_THRESH_BINARY = 0, // value = value > threshold ? max_value : 0 FCV_THRESH_BINARY_INV // value = value > threshold ? 0 : max_value } fcvThreshType; //--------------------------------------------------------------------------- /// @brief /// Binarizes a grayscale image based on an adaptive threshold value calculated from 3x3 Gaussian kernel. /// /// @details /// For each pixel, the threshold is computed adaptively based on cross-correlation with a /// 3x3 Gaussian kernel minus value (parameter). The standard deviation is used for Gaussian kernel. /// For FCV_THRESH_BINARY threshold type, the pixel is set as maxValue if it's value is greater than the threshold; /// else, it is set as zero. For FCV_THRESH_BINARY_INV threshold type, the pixel is set as zero if it's value is greater than the threshold; /// else, it is set as maxValue. /// /// @param src /// Pointer to the 8-bit input image. /// /// @param srcWidth /// Width of source images pointed by src. /// /// @param srcHeight /// Height of source images pointed by src. /// /// @param srcStride /// Stride of source image (i.e., number of bytes between column 0 /// of row 0 and column 0 of row 1). /// /// @param maxValue /// The maximum integer value to be used. 0>1+8) *sizeof(uint32_t) /// \n\b NOTE: must be a multiple of 8. /// /// @param integralCrStride /// The stride of integralCr. (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). If left at 0 integralCrStride is default to (srcWidth>>1+8) *sizeof(uint32_t) /// \n\b NOTE: must be a multiple of 8. /// /// @return /// No return value. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvIntegrateImageYCbCr420PseudoPlanaru8( const uint8_t* __restrict srcY, const uint8_t* __restrict srcC, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcYStride, uint32_t srcCStride, uint32_t* __restrict integralY, uint32_t* __restrict integralCb, uint32_t* __restrict integralCr, uint32_t integralYStride, uint32_t integralCbStride, uint32_t integralCrStride); //--------------------------------------------------------------------------- /// @brief /// This function finds the foreground. /// /// @details /// This function tries to find a forgound in the current image (represented by: fgIntegralY, /// fgIntegralCb, fgIntegralCr) based on the current background model (represented by: bgIntegralY, /// bgIntegralCb, bgIntegralCr). For example, the tuple (bgIntegralY, bgIntegralCb, bgIntegralCr) may be /// from a picture shooting a wall. Then the tuple (fgIntegralY, fgIntegralCb, fgIntegralCr) may be /// the wall with a paint on it. Note that all the first six parameters are indicating integral images /// that's computed from a YUV420 image, which maybe computed from the function: /// fcvIntegrateImageYCbCr420PseudoPlanaru8. Generally the size of fgIntegralY and bgIntegralY are /// (srcWidth+1)*(srcHeight+1). And the size of fgIntegralU, fgIntegralV, bgIntegralU and bgIntegralV /// are (srcWidth/2+1)*(srcHeight/2+1). The value of the outputWidth and outputHeight are usually indicating /// the desired block size. For example, if the user wants a 20x15 blocks on a 800x480 image. Then /// outputWidth=800/20 and outputHeight=480/15. After return, if the value in the outputMask image is /// 255, then a moving block is indicated, otherwise a non-moving block is indicated. /// /// @param bgIntegralY /// The input image/patch that's indicating the Y channel of the integral image of the background image. /// Size of buffer is srcYStride*srcHeight bytes /// \n\b NOTE: must be 128-bit aligned. /// /// @param bgIntegralCb /// The input image/patch that's indicating the Cb channel of the integral image of the background image. /// Size of buffer is srcCbStride*srcHeight/2 bytes /// \n\b NOTE: must be 128-bit aligned. /// /// @param bgIntegralCr /// The input image/patch that's indicating the Cr channel of the integral image of the background image. /// Size of buffer is srcCrStride*srcHeight/2 bytes /// \n\b NOTE: must be 128-bit aligned. /// /// @param fgIntegralY /// The input image/patch that's indicating the Y channel of the integral image of the image /// on which we want to find the foreground. /// Size of buffer is srcYStride*srcHeight bytes /// \n\b NOTE: must be 128-bit aligned. /// /// @param fgIntegralCb /// The input image/patch that's indicating the Cb channel of the integral image of the image /// on which we want to find the foreground. /// Size of buffer is srcCbStride*srcHeight/2 bytes /// \n\b NOTE: must be 128-bit aligned. /// /// @param fgIntegralCr /// The input image/patch that's indicating the Cr channel of the integral image of the image /// on which we want to find the foreground. /// Size of buffer is srcCrStride*srcHeight/2 bytes /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width, the number of pixels in a row. See the details. /// \n\b NOTE: must be a multiple of 16. /// /// @param srcHeight /// The height of the source image. See the details. /// \n\b NOTE: must be a multiple of 2. /// /// @param srcYStride /// The stride of the input source image's Y channel. (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). If left at 0 srcStride is default to (srcWidth+8)*sizeof(uint32_t). /// \n\b NOTE: must be a multiple of 8. /// /// @param srcCbStride /// The stride of the input source image's Cb channel. (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). If left at 0 srcStride is default to (srcWidth>>1+8)*sizeof(uint32_t). /// \n\b NOTE: must be a multiple of 8. /// /// @param srcCrStride /// The stride of the input source image's Cr channel. (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). If left at 0 srcStride is default to (srcWidth>>1+8)*sizeof(uint32_t). /// \n\b NOTE: must be a multiple of 8. /// /// @param outputMask /// The output mask image. Each pixel represent the motion condition for a block in the original image. /// Size of buffer is outputMaskStride*outputHeight bytes /// \n\b NOTE: must be 128-bit aligned. /// /// @param outputWidth /// The width of the output mask image. /// \n\b NOTE: must be a multiple of 8. /// /// @param outputHeight /// The height of the output mask image. /// /// @param outputMaskStride /// The stride of the output mask image. (i.e., how many bytes between column 0 of row 1 and /// column 0 of row 2). If left at 0 outputMaskStride is default to outputWidth. /// \n\b NOTE: must be a multiple of 8. /// /// @param threshold /// The threshold that's used to decide if a block is moving or not. (recommend the value of 20). /// /// @return /// No return value. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvFindForegroundIntegrateImageYCbCr420u32( const uint32_t * __restrict bgIntegralY, const uint32_t * __restrict bgIntegralCb, const uint32_t * __restrict bgIntegralCr, const uint32_t * __restrict fgIntegralY, const uint32_t * __restrict fgIntegralCb, const uint32_t * __restrict fgIntegralCr, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcYStride, uint32_t srcCbStride, uint32_t srcCrStride, uint8_t * __restrict outputMask, uint32_t outputWidth, uint32_t outputHeight, uint32_t outputMaskStride, float32_t threshold ); //--------------------------------------------------------------------------- /// @brief /// This function calculates the average value of an image. /// /// @details /// This function sums all the pixel value in an image and divide the result by the number of pixels in the image. /// /// @param src /// The input image/patch. Must be 32 bit image. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width, the number of pixels in a row /// \n\b NOTE: must be a multiple of 8. /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. /// \n\b NOTE: must be a multiple of 8. /// /// @param avgValue /// The output average value. /// /// @return /// No return value. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvAverages32( const int32_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, float32_t* __restrict avgValue); //--------------------------------------------------------------------------- /// @brief /// This function calculates the average value of an image. /// /// @details /// This function sums all the pixel value in an image and divide the result by the number of pixels in the image. /// /// @param src /// 8-bit image where keypoints are detected. Size of buffer is srcStride*srcHeight bytes. /// \n\b NOTE: must be 128-bit aligned. /// /// @param srcWidth /// Image width, the number of pixels in a row /// \n\b NOTE: must be a multiple of 8. /// /// @param srcHeight /// Image height /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. /// \n\b NOTE: must be a multiple of 8. /// /// @param avgValue /// The output average value. /// /// @return /// No return value. /// /// @ingroup image_processing //------------------------------------------------------------------------------ FASTCV_API void fcvAverageu8( const uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, float32_t* __restrict avgValue); //------------------------------------------------------------------------------ /// @brief /// Applies the meanshift procedure and obtains the final converged position /// /// @details /// This function applies the meanshift procedure to an original image (usually a probability image) and obtains the final converged position. /// The converged position search will stop either it has reached the required accuracy or the maximum number of iterations. /// /// @param src /// Pointer to the original image which is usually a probability image computed based on object histogram. Must be 8 bit grayscale image. /// Size of buffer is srcStride*srcHeight bytes. /// NOTE: must be 128-bit aligned. /// /// @param srcWidth /// The width of the input source image. /// NOTE: must be a multiple of 8. /// /// @param srcHeight /// The height of the input source image. /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. /// NOTE: must be a multiple of 8. /// /// @param window /// Pointer to the initial search window position which also returns the final converged window position. /// /// @param criteria /// The criteria used to finish the MeanShift which consists of two termination criteria: /// 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations /// /// @return /// The actually number of iterations /// /// @ingroup Motion_and_Object_Tracking //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvMeanShiftu8(const uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt* window, fcvTermCriteria criteria); //------------------------------------------------------------------------------ /// @brief /// Applies the meanshift procedure and obtains the final converged position /// /// @details /// This function applies the meanshift procedure to an original image (usually a probability image) and obtains the final converged position. /// The converged position search will stop either it has reached the required accuracy or the maximum number of iterations. /// /// @param src /// Pointer to the original image which is usually a probability image computed based on object histogram. Must be int 32bit grayscale image. /// Size of buffer is srcStride*srcHeight bytes. /// NOTE: must be 128-bit aligned. /// /// @param srcWidth /// The width of the input source image. /// NOTE: must be a multiple of 8. /// /// @param srcHeight /// The height of the input source image. /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*4. /// NOTE: must be a multiple of 8. /// /// @param window /// Pointer to the initial search window position which also returns the final converged window position. /// /// @param criteria /// The criteria used to finish the MeanShift which consists of two termination criteria: /// 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations /// /// @return /// Number of iterations /// /// @ingroup Motion_and_Object_Tracking //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvMeanShifts32(const int32_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt* window, fcvTermCriteria criteria); //------------------------------------------------------------------------------ /// @brief /// Applies the meanshift procedure and obtains the final converged position /// /// @details /// This function applies the meanshift procedure to an original image (usually a probability image) and obtains the final converged position. /// The converged position search will stop either it has reached the required accuracy or the maximum number of iterations. /// /// @param src /// Pointer to the original image which is usually a probability image computed based on object histogram. Must be float 32bit grayscale image. /// Size of buffer is srcStride*srcHeight bytes. /// NOTE: must be 128-bit aligned. /// /// @param srcWidth /// The width of the input source image. /// NOTE: must be a multiple of 8. /// /// @param srcHeight /// The height of the input source image. /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*4. /// NOTE: must be a multiple of 8. /// /// @param window /// Pointer to the initial search window position which also returns the final converged window position. /// /// @param criteria /// The criteria used to finish the MeanShift which consists of two termination criteria: /// 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations /// /// @return /// Number of iterations /// /// @ingroup Motion_and_Object_Tracking //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvMeanShiftf32(const float32_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt* window, fcvTermCriteria criteria); //------------------------------------------------------------------------------ /// @brief /// Applies the ConAdaTrack procedure and find the object center, size and orientation /// /// @details /// This function applies the ConAdaTrack procedure to an original image (usually a probability image) and obtains the final converged object. /// The optimal object search will stop either it has reached the required accuracy or the maximum number of iterations. /// /// @param src /// Pointer to the original image which is usually a probability image computed based on object histogram. Must be 8bit grayscale image. /// Size of buffer is srcStride*srcHeight bytes. /// NOTE: must be 128-bit aligned. /// /// @param srcWidth /// The width of the input source image. /// NOTE: must be a multiple of 8. /// /// @param srcHeight /// The height of the input source image. /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. /// NOTE: must be a multiple of 8. /// /// @param window /// Pointer to the initial search window position which also returns the final converged window position. /// /// @param criteria /// The criteria used to finish the object search which consists of two termination criteria: /// 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations /// /// @param circuBox /// The circumscribed box around the object /// /// @return /// Number of iterations /// /// @ingroup Motion_and_Object_Tracking //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvConAdaTracku8(const uint8_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt* window, fcvTermCriteria criteria, fcvBox2D* circuBox); //------------------------------------------------------------------------------ /// @brief /// Applies the ConAdaTrack procedure and find the object center, size and orientation /// /// @details /// This function applies the ConAdaTrack procedure to an original image (usually a probability image) and obtains the final converged object. /// The optimal object search will stop either it has reached the required accuracy or the maximum number of iterations. /// /// @param src /// Pointer to the original image which is usually a probability image computed based on object histogram. Must be int 32bit grayscale image. /// Size of buffer is srcStride*srcHeight bytes. /// NOTE: must be 128-bit aligned. /// /// @param srcWidth /// The width of the input source image. /// NOTE: must be a multiple of 8. /// /// @param srcHeight /// The height of the input source image. /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*4. /// NOTE: must be a multiple of 8. /// /// @param window /// Pointer to the initial search window position which also returns the final converged window position. /// /// @param criteria /// The criteria used to finish the object search which consists of two termination criteria: /// 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations /// /// @param circuBox /// The circumscribed box around the object /// /// @return /// Number of iterations /// /// @ingroup Motion_and_Object_Tracking //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvConAdaTracks32(const int32_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt* window, fcvTermCriteria criteria, fcvBox2D* circuBox); //------------------------------------------------------------------------------ /// @brief /// Applies the ConAdaTrack procedure and find the object center, size and orientation /// /// @details /// This function applies the ConAdaTrack procedure to an original image (usually a probability image) and obtains the final converged object. /// The optimal object search will stop either it has reached the required accuracy or the maximum number of iterations. /// /// @param src /// Pointer to the original image which is usually a probability image computed based on object histogram. Must be float 32bit grayscale image. /// Size of buffer is srcStride*srcHeight bytes. /// NOTE: must be 128-bit aligned. /// /// @param srcWidth /// The width of the input source image. /// NOTE: must be a multiple of 8. /// /// @param srcHeight /// The height of the input source image. /// /// @param srcStride /// Stride of image is the number of bytes between column 0 of row 1 and /// column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*4. /// NOTE: must be a multiple of 8. /// /// @param window /// Pointer to the initial search window position which also returns the final converged window position. /// /// @param criteria /// The criteria used to finish the object search which consists of two termination criteria: /// 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations /// /// @param circuBox /// The circumscribed box around the object /// /// @return /// Number of iterations /// /// @ingroup Motion_and_Object_Tracking //------------------------------------------------------------------------------ FASTCV_API uint32_t fcvConAdaTrackf32(const float32_t* __restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt* window, fcvTermCriteria criteria, fcvBox2D* circuBox); //------------------------------------------------------------------------------ /// @brief /// Compute a singular value decomposition of a matrix of a float type /// A = U*diag[w]*Vt; /// It is used for solving problems like least-squares, under-determined linear systems, matrix /// inversion and so forth. The algorithm used here does not compute the full U and V matrices /// however it computes a condensed version of U and V described below which is sufficient to solve /// most problems which use SVD. /// /// @details /// /// /// @param A /// The input matrix of dimensions m x n /// \n\b NOTE: must be 128-bit aligned. /// /// @param m /// The number of rows of matrix A /// /// @param n /// The number of columns of matrix A /// /// @param w /// The pointer to the buffer that holds n singular values. When m>n it /// contains n singular values while when m