.. meta:: :keywords: Vision, Library, Vitis Vision Library, migrate, HLS, Mat, cv, LineBuffer :description: Migrating HLS Video Library to Vitis vision. :xlnxdocumentclass: Document :xlnxdocumenttype: Tutorials Migrating HLS Video Library to Vitis vision ============================================ The HLS video library has been deprecated. All the functions and most of the infrastructure available in HLS video library are now available in Vitis vision with their names changed and some modifications. These HLS video library functions ported to Vitis vision supports build flow also. This section provides the details on using the C++ video processing functions and the infrastructure present in HLS video library. Infrastructure Functions and Classes ------------------------------------- All the functions imported from HLS video library now take xf::cv::Mat (in sync with Vitis vision library) to represent image data instead of hls::Mat. The main difference between these two is that the hls::Mat uses hls::stream to store the data whereas xf::cv::Mat uses a pointer. Therefore, hls:: Mat cannot be exactly replaced with xf::cv::Mat for migrating. Below table summarizes the differences between member functions of hls::Mat to xf::cv::Mat. .. table:: Table : Infrastructure Functions and Classes +----------------------+----------------------+--------------------------+ | Member Function | hls::Mat (HLS Video | xf::cv::Mat (Vitis vision| | | lib) | lib) | +======================+======================+==========================+ | channels() | Returns the number | Returns the number | | | of channels | of channels | +----------------------+----------------------+--------------------------+ | type() | Returns the enum | Returns the enum | | | value of pixel type | value of pixel type | +----------------------+----------------------+--------------------------+ | depth() | Returns the enum | Returns the depth of | | | value of pixel type | pixel including | | | | channels | +----------------------+----------------------+--------------------------+ | read() | Readout a value and | Readout a value from | | | return it as a | a given location and | | | scalar from stream | return it as a | | | | packed (for | | | | multi-pixel/clock) | | | | value. | +----------------------+----------------------+--------------------------+ | operator >> | Similar to read() | Not available in | | | | Vitis vision | +----------------------+----------------------+--------------------------+ | operator << | Similar to write() | Not available in | | | | Vitis vision | +----------------------+----------------------+--------------------------+ | Write() | Write a scalar value | Writes a packed (for | | | into the stream | multi-pixel/clock) | | | | value into the given | | | | location. | +----------------------+----------------------+--------------------------+ Infrastructure files available in HLS Video Library hls_video_core.hpp, hls_video_mem.hpp, hls_video_types.hpp are moved to xf_video_core.hpp, xf_video_mem.hpp, xf_video_types.hpp in Vitis vision Library and hls_video_imgbase.hpp is deprecated. Code inside these files unchanged except that these are now under xf::cv::namespace. Classes -------- Memory Window Buffer hls::window is now xf::cv::window. No change in the implementation, except the namespace change. This is located in “xf_video_mem.h” file. Memory Line Buffer hls::LineBuffer is now xf::cv::LineBuffer. No difference between the two, except xf::cv::LineBuffer has extra template arguments for inferring different types of RAM structures, for the storage structure used. Default storage type is “RAM_S2P_BRAM” with RESHAPE_FACTOR=1. Complete description can be found here `xf::cv::LineBuffer `__. This is located in xf_video_mem.hpp file. Funtions --------- OpenCV interface functions These functions covert image data of OpenCV Mat format to/from HLS AXI types. HLS Video Library had 14 interface functions, out of which, two functions are available in Vitis vision Library: cvMat2AXIvideo and AXIvideo2cvMat located in “xf_axi.h” file. The rest are all deprecated. AXI4-Stream I/O Functions The I/O functions which convert hls::Mat to/from AXI4-Stream compatible data type (hls::stream) are hls::AXIvideo2Mat, hls::Mat2AXIvideo. These functions are now deprecated and added 2 new functions xf::cv::AXIvideo2xfMat and xf::cv:: xfMat2AXIvideo to facilitate the xf::cv::Mat to/from conversion. To use these functions, the header file "xf_infra.hpp" must be included. xf::cv::window --------------- A template class to represent the 2D window buffer. It has three parameters to specify the number of rows, columns in window buffer and the pixel data type. Class definition ~~~~~~~~~~~~~~~~~ .. code:: c template class Window { public: Window() /* Window main APIs */ void shift_pixels_left(); void shift_pixels_right(); void shift_pixels_up(); void shift_pixels_down(); void insert_pixel(T value, int row, int col); void insert_row(T value[COLS], int row); void insert_top_row(T value[COLS]); void insert_bottom_row(T value[COLS]); void insert_col(T value[ROWS], int col); void insert_left_col(T value[ROWS]); void insert_right_col(T value[ROWS]); T& getval(int row, int col); T& operator ()(int row, int col); T val[ROWS][COLS]; #ifdef __DEBUG__ void restore_val(); void window_print(); T val_t[ROWS][COLS]; #endif }; Parameter Descriptions ~~~~~~~~~~~~~~~~~~~~~~~ The following table lists the xf::cv::Window class members and their descriptions. .. table:: Table : Window Function Parameter Descriptions +-----------------+----------------------------------------------------+ | Parameter | Description | +=================+====================================================+ | Val | 2-D array to hold the contents of buffer. | +-----------------+----------------------------------------------------+ Member Function Description ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. table:: Table : Member Function Description +-----------------------------------+-----------------------------------+ | Function | Description | +===================================+===================================+ | shift_pixels_left() | Shift the window left, that moves | | | all stored data within the window | | | right, leave the leftmost column | | | (col = COLS-1) for inserting new | | | data. | +-----------------------------------+-----------------------------------+ | shift_pixels_right() | Shift the window right, that | | | moves all stored data within the | | | window left, leave the rightmost | | | column (col = 0) for inserting | | | new data. | +-----------------------------------+-----------------------------------+ | shift_pixels_up() | Shift the window up, that moves | | | all stored data within the window | | | down, leave the top row (row = | | | ROWS-1) for inserting new data. | +-----------------------------------+-----------------------------------+ | shift_pixels_down() | Shift the window down, that moves | | | all stored data within the window | | | up, leave the bottom row (row = | | | 0) for inserting new data. | +-----------------------------------+-----------------------------------+ | insert_pixel(T value, int row, | Insert a new element value at | | int col) | location (row, column) of the | | | window. | +-----------------------------------+-----------------------------------+ | insert_row(T value[COLS], int | Inserts a set of values in any | | row) | row of the window. | +-----------------------------------+-----------------------------------+ | insert_top_row(T value[COLS]) | Inserts a set of values in the | | | top row = 0 of the window. | +-----------------------------------+-----------------------------------+ | insert_bottom_row(T value[COLS]) | Inserts a set of values in the | | | bottom row = ROWS-1 of the | | | window. | +-----------------------------------+-----------------------------------+ | insert_col(T value[ROWS], int | Inserts a set of values in any | | col) | column of the window. | +-----------------------------------+-----------------------------------+ | insert_left_col(T value[ROWS]) | Inserts a set of values in left | | | column = 0 of the window. | +-----------------------------------+-----------------------------------+ | insert_right_col(T value[ROWS]) | Inserts a set of values in right | | | column = COLS-1 of the window. | +-----------------------------------+-----------------------------------+ | T& getval(int row, int col) | Returns the data value in the | | | window at position (row,column). | +-----------------------------------+-----------------------------------+ | T& operator ()(int row, int col) | Returns the data value in the | | | window at position (row,column). | +-----------------------------------+-----------------------------------+ | restore_val() | Restore the contents of window | | | buffer to another array. | +-----------------------------------+-----------------------------------+ | window_print() | Print all the data present in | | | window buffer onto console. | +-----------------------------------+-----------------------------------+ Template Parameter Description ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. table:: Table : Template Parameter Description +-----------+------------------------------------------+ | Parameter | Description | +===========+==========================================+ | ROWS | Number of rows in the window buffer. | +-----------+------------------------------------------+ | COLS | Number of columns in the window buffer. | +-----------+------------------------------------------+ | T | Data type of pixel in the window buffer. | +-----------+------------------------------------------+ Sample code for window buffer declaration .. code:: c Window kernel; .. _ariaid-title5: xf::cv::LineBuffer ------------------ A template class to represent 2D line buffer. It has three parameters to specify the number of rows, columns in window buffer and the pixel data type. .. _class-definition-1: Class definition ~~~~~~~~~~~~~~~~~ .. code:: c template class LineBuffer { public: LineBuffer() /* LineBuffer main APIs */ /* LineBuffer main APIs */ void shift_pixels_up(int col); void shift_pixels_down(int col); void insert_bottom_row(T value, int col); void insert_top_row(T value, int col); void get_col(T value[ROWS], int col); T& getval(int row, int col); T& operator ()(int row, int col); /* Back compatible APIs */ void shift_up(int col); void shift_down(int col); void insert_bottom(T value, int col); void insert_top(T value, int col); T val[ROWS][COLS]; #ifdef __DEBUG__ void restore_val(); void linebuffer_print(int col); T val_t[ROWS][COLS]; #endif }; .. _parameter-descriptions-1: Parameter Descriptions ~~~~~~~~~~~~~~~~~~~~~~ The following table lists the xf::cv::LineBuffer class members and their descriptions. .. table:: Table : Line Buffer Function Parameter Descriptions +-----------------+----------------------------------------------------+ | Parameter | Description | +=================+====================================================+ | Val | 2-D array to hold the contents of line buffer. | +-----------------+----------------------------------------------------+ Member Functions Description ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. table:: Table : Member Functions Description +-----------------------------------+-----------------------------------+ | Function | Description | +===================================+===================================+ | shift_pixels_up(int col) | Line buffer contents Shift up, | | | new values will be placed in the | | | bottom row=ROWS-1. | +-----------------------------------+-----------------------------------+ | shift_pixels_down(int col) | Line buffer contents Shift down, | | | new values will be placed in the | | | top row=0. | +-----------------------------------+-----------------------------------+ | insert_bottom_row(T value, int | Inserts a new value in bottom | | col) | row= ROWS-1 of the line buffer. | +-----------------------------------+-----------------------------------+ | insert_top_row(T value, int col) | Inserts a new value in top row=0 | | | of the line buffer. | +-----------------------------------+-----------------------------------+ | get_col(T value[ROWS], int col) | Get a column value of the line | | | buffer. | +-----------------------------------+-----------------------------------+ | T& getval(int row, int col) | Returns the data value in the | | | line buffer at position (row, | | | column). | +-----------------------------------+-----------------------------------+ | T& operator ()(int row, int col); | Returns the data value in the | | | line buffer at position (row, | | | column). | +-----------------------------------+-----------------------------------+ .. _template-parameter-description-1: Template Parameter Description ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. table:: Table : Template Parameter Description +-----------------------------------+-----------------------------------+ | Parameter | Description | +===================================+===================================+ | ROWS | Number of rows in line buffer. | +-----------------------------------+-----------------------------------+ | COLS | Number of columns in line buffer. | +-----------------------------------+-----------------------------------+ | T | Data type of pixel in line | | | buffer. | +-----------------------------------+-----------------------------------+ | MEM_TYPE | Type of storage element. It takes | | | one of the following enumerated | | | values: RAM_1P_BRAM, RAM_1P_URAM, | | | RAM_2P_BRAM, RAM_2P_URAM, | | | RAM_S2P_BRAM, RAM_S2P_URAM, | | | RAM_T2P_BRAM, RAM_T2P_URAM. | +-----------------------------------+-----------------------------------+ | RESHAPE_FACTOR | Specifies the amount to divide an | | | array. | +-----------------------------------+-----------------------------------+ Sample code for line buffer declaration: .. code:: c LineBuffer<3, 1920, XF_8UC3, RAM_S2P_URAM,1> buff; .. _ariaid-title6: Video Processing Functions -------------------------- The following table summarizes the video processing functions ported from HLS Video Library into Vitis vision Library along with the API modifications. .. table:: Table : Video Processing Functions +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Functions | HLS Video Library -API | xfOpenCV Library-API | +================================+============================================================================================================================================================+===================================================================================================================================================================================================================+ | addS | template | template | | | | | | | void AddS(Mat&src,Scalar scl, Mat& dst) | void addS(xf::Mat & \_src1, unsigned char \_scl[XF_CHANNELS(SRC_T,NPC)],xf::Mat & \_dst) | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | AddWeighted | template | template< int SRC_T,int DST_T, int ROWS, int COLS, int NPC = 1> | | | | | | | void AddWeighted(Mat& src1,P_T alpha,Mat& src2,P_T beta, P_T gamma,Mat& dst) | void addWeighted(xf::Mat & src1,float alpha, xf::Mat & src2,float beta, float gama, xf::Mat & dst) | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Cmp | template | template | | | | | | | void Cmp(Mat& src1,Mat& src2, | void compare(xf::Mat & \_src1, xf::Mat & \_src2,xf::Mat & \_dst) | | | | | | | Mat& dst,int cmp_op) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | CmpS | template | template | | | | | | | void CmpS(Mat& src, P_T value, Mat& dst, int cmp_op) | void compare(xf::Mat & \_src1, unsigned char \_scl[XF_CHANNELS(SRC_T,NPC)],xf::Mat & \_dst) | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Max | template | template | | | | | | | void Max(Mat& src1, | void Max(xf::Mat & \_src1, xf::Mat & \_src2,xf::Mat & \_dst) | | | | | | | Mat& src2, | | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | MaxS | template | template< int SRC_T, int ROWS, int COLS, int NPC =1> | | | | | | | void MaxS(Mat& src, | void max(xf::Mat & \_src1, unsigned char \_scl[XF_CHANNELS(SRC_T,NPC)],xf::Mat & \_dst) | | | | | | | \_T value, Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Min | template | template< int SRC_T, int ROWS, int COLS, int NPC =1> | | | | | | | void Min(Mat& src1, | void Min(xf::Mat & \_src1, xf::Mat & \_src2,xf::Mat & \_dst) | | | | | | | Mat& src2, | | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | MinS | template | template< int SRC_T, int ROWS, int COLS, int NPC =1> | | | | | | | void MinS(Mat& src, | void min(xf::Mat & \_src1, unsigned char \_scl[XF_CHANNELS(SRC_T,NPC)],xf::Mat & \_dst) | | | | | | | \_T value,Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PaintMask | template | template< int SRC_T,int MASK_T, int ROWS, int COLS,int NPC=1> | | | | | | | void PaintMask( | void paintmask(xf::Mat & \_src_mat, xf::Mat & in_mask, xf::Mat & \_dst_mat, unsigned char \_color[XF_CHANNELS(SRC_T,NPC)]) | | | | | | | Mat &_src, | | | | | | | | Mat&_mask, | | | | | | | | Mat&_dst,Scalar \_color) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Reduce | template | template< int REDUCE_OP, int SRC_T,int DST_T, int ROWS, int COLS,int ONE_D_HEIGHT, int ONE_D_WIDTH, int NPC=1> | | | | | | | void Reduce( | void reduce(xf::Mat & \_src_mat, xf::Mat & \_dst_mat, unsigned char dim) | | | | | | | Mat &src, | | | | | | | | Mat &dst, | | | | | | | | int dim, | | | | | | | | int op=HLS_REDUCE_SUM) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Zero | template | template< int SRC_T, int ROWS, int COLS, int NPC =1> | | | | | | | void Zero(Mat& src, | void zero(xf::Mat & \_src1,xf::Mat & \_dst) | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Sum | template | template< int SRC_T, int ROWS, int COLS, int NPC = 1> | | | | | | | Scalar Sum( | void sum(xf::Mat & src1, double sum[XF_CHANNELS(SRC_T,NPC)] ) | | | | | | | Mat& src) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | SubS | template | template | | | | | | | void SubS(Mat& src, | void SubS(xf::Mat & \_src1, unsigned char \_scl[XF_CHANNELS(SRC_T,NPC)],xf::Mat & \_dst) | | | | | | | Scalar scl, | | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | SubRS | template | template | | | | | | | void SubRS(Mat& src, | void SubRS(xf::Mat & \_src1, unsigned char \_scl[XF_CHANNELS(SRC_T,NPC)],xf::Mat & \_dst) | | | | | | | Scalar scl, | | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Set | template | template< int SRC_T, int ROWS, int COLS, int NPC =1> | | | | | | | void Set(Mat& src, | void set(xf::Mat & \_src1, unsigned char \_scl[XF_CHANNELS(SRC_T,NPC)],xf::Mat & \_dst) | | | | | | | Scalar scl, | | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Absdiff | template | template | | | | | | | void AbsDiff( | void absdiff(xf::Mat & \_src1,xf::Mat & \_src2,xf::Mat & \_dst) | | | | | | | Mat& src1, | | | | | | | | Mat& src2, | | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | And | template | template | | | | | | | void And( | void bitwise_and(xf::Mat & \_src1, xf::Mat & \_src2, xf::Mat &_dst) | | | | | | | Mat& src1, | | | | | | | | Mat& src2, | | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Dilate | template | template | | | | | | | void Dilate(Mat&_src,Mat&_kernel) | void dilate (xf::Mat & \_src, xf::Mat & \_dst,unsigned char \_kernel[K_ROWS*K_COLS]) | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Duplicate | template | template | | | | | | | void Duplicate(Mat& src,Mat& dst1,Mat& dst2) | void duplicateMat(xf::Mat & \_src, xf::Mat & \_dst1,xf::Mat & \_dst2) | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | EqualizeHist | template | template | | | | | | | void EqualizeHist(Mat&_src,Mat&_dst) | void equalizeHist(xf::Mat & \_src,xf::Mat & \_src1,xf::Mat & \_dst) | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | erode | template | template | | | | | | | void Erode(Mat&_src,Mat&_dst,Window&_kernel) | void erode (xf::Mat & \_src, xf::Mat & \_dst,unsigned char \_kernel[K_ROWS*K_COLS]) | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | FASTX | template | template | | | | | | | void FASTX(Mat &_src, | void fast(xf::Mat & \_src_mat,xf::Mat & \_dst_mat,unsigned char \_threshold) | | | | | | | Mat&_mask,HLS_TNAME(SRC_T)_threshold,bool \_nomax_supression) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Filter2D | template | | | | | | | int IMG_HEIGHT,int IMG_WIDTH,int K_HEIGHT,int K_WIDTH> | void filter2D(xf::Mat & \_src_mat,xf::Mat & \_dst_mat,short int filter[FILTER_HEIGHT*FILTER_WIDTH],unsigned char \_shift) | | | | | | | void Filter2D(Mat &_src,Mat &_dst,Window&_kernel,Point_anchor) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | GaussianBlur | template | template | | | | | | | void GaussianBlur(Mat | void GaussianBlur(xf::Mat & \_src, xf::Mat & \_dst, float sigma) | | | | | | | &_src, Mat | | | | | | | | &_dst,double sigmaX=0,double sigmaY=0) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Harris | template | template | | | | | | | void Harris(Mat | void cornerHarris(xf::Mat & src,xf::Mat & dst,uint16_t threshold, uint16_t k) | | | | | | | &_src,Mat&_dst,KT k,int threshold | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | CornerHarris | template | template | | | | | | | void CornerHarris( | void cornerHarris(xf::Mat & src,xf::Mat & dst,uint16_t threshold, uint16_t k | | | | | | | Mat&_src,Mat&_dst,KT k) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | HoughLines2 | template | template | | | | | | | void HoughLines2(Mat &_src, | void HoughLines(xf::Mat & \_src_mat,float outputrho[MAXLINES],float outputtheta[MAXLINES],short threshold,short linesmax) | | | | | | | Polar_ (&_lines)[linesMax],unsigned int threshold) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Integral | template | | | | | | | int ROWS,int COLS> | void integral(xf::Mat & \_src_mat, xf::Mat & \_dst_mat) | | | | | | | void Integral(Mat&_src, | | | | | | | | Mat&_sum ) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Merge | template | template | | | | | | | void Merge( | void merge(xf::Mat &_src1, xf::Mat &_src2, xf::Mat &_src3, xf::Mat &_src4, xf::Mat &_dst) | | | | | | | Mat& src0, | | | | | | | | Mat& src1, | | | | | | | | Mat& src2, | | | | | | | | Mat& src3, | | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | MinMaxLoc | template | template | | | | | | | void MinMaxLoc(Mat& src, | void minMaxLoc(xf::Mat & \_src,int32_t \*min_value, int32_t \*max_value,uint16_t \*_minlocx, uint16_t \*_minlocy, uint16_t \*_maxlocx, uint16_t \*_maxlocy ) | | | | | | | P_T\* min_val,P_T\* max_val,Point& min_loc, | | | | | | | | Point& max_loc) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Mul | template | template | | | | | | | void Mul(Mat& src1, | void multiply(xf::Mat & src1, xf::Mat & src2, xf::Mat & dst,float scale) | | | | | | | Mat& src2, | | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Not | template | template | | | | | | | void Not(Mat& src, | void bitwise_not(xf::Mat & src, xf::Mat & dst) | | | | | | | Mat& dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Range | template | template | | | | | | | void Range(Mat& src, | void inRange(xf::Mat & src,unsigned char lower_thresh,unsigned char upper_thresh,xf::Mat & dst) | | | | | | | Mat& dst, | | | | | | | | P_T start,P_T end) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Resize | template | template | | | | | | | void Resize ( | void resize (xf::Mat & \_src, xf::Mat & \_dst) | | | | | | | Mat &_src, | | | | | | | | Mat &_dst, | | | | | | | | int interpolation=HLS_INTER_LINEAR ) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | sobel | template | template | | | | | | | void Sobel (Mat | void Sobel(xf::Mat & \_src_mat,xf::Mat & \_dst_matx,xf::Mat & \_dst_maty) | | | | | | | &_src,Mat &_dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | split | template | template | | | | | | | void Split( | void extractChannel(xf::Mat & \_src_mat, xf::Mat & \_dst_mat, uint16_t \_channel) | | | | | | | Mat& src, | | | | | | | | Mat& dst0, | | | | | | | | Mat& dst1, | | | | | | | | Mat& dst2, | | | | | | | | Mat& dst3) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Threshold | template | template | | | | | | | void Threshold( | void Threshold(xf::Mat & \_src_mat,xf::Mat & \_dst_mat,short int thresh,short int maxval ) | | | | | | | Mat& src, | | | | | | | | Mat& dst, | | | | | | | | HLS_TNAME(SRC_T) thresh, | | | | | | | | HLS_TNAME(DST_T) maxval, | | | | | | | | int thresh_type) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Scale | template | template< int SRC_T,int DST_T, int ROWS, int COLS, int NPC = 1> | | | | | | | void Scale(Mat& src,Mat& dst, P_T scale=1.0,P_T shift=0.0) | void scale(xf::Mat & src1, xf::Mat & dst,float scale, float shift) | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | InitUndistortRectifyMapInverse | template | template< int CM_SIZE, int DC_SIZE, int MAP_T, int ROWS, int COLS, int NPC > | | | | | | | void InitUndistortRectifyMapInverse ( | void InitUndistortRectifyMapInverse ( | | | | | | | Window<3,3, CMT> cameraMatrix,DT(&distCoeffs)[N],Window<3,3, ICMT> ir, Mat &map1,Mat &map2,int noRotation=false) | ap_fixed<32,12> \*cameraMatrix, | | | | | | | | ap_fixed<32,12> \*distCoeffs, | | | | | | | | ap_fixed<32,12> \*ir, | | | | | | | | xf::Mat &_mapx_mat,xf::Mat &_mapy_mat,int \_cm_size, int \_dc_size) | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Avg, mean, AvgStddev | template | templatevoid meanStdDev(xf::Mat & \_src,unsigned short\* \_mean,unsigned short\* \_stddev) | | | | | | | DST_T Mean(Mat& src) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | CvtColor | template | Color Conversion | | | | | | | void CvtColor(Mat &_src, | | | | | | | | Mat &_dst) | | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Note: All the functions except Reduce can process N-pixels per clock where N is power of 2. .. |image0| image:: ./images/wuz1554997295362.png :class: image .. |image1| image:: ./images/wuz1554997295362.png :class: image .. |image2| image:: ./images/wuz1554997295362.png :class: image