HLS第二十六课(xfopencv杂项类函数)

Canny Edge Detection

template<int FILTER_TYPE,int NORM_TYPE,int SRC_T,int DST_T, int ROWS, int COLS,int NPC,int NPC1,bool USE_URAM=false>
void Canny(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _src_mat,
	xf::Mat<DST_T, ROWS, COLS, NPC1> & _dst_mat,
	unsigned char _lowthreshold,
	unsigned char _highthreshold)

The filter window dimensions. The options are 3 and 5.
The type of norm used. The options for norm type are L1NORM and L2NORM.
Input pixel type. Only 8-bit, unsigned, 1 channel is supported (XF_8UC1).
Output pixel type. Only XF_2UC1 is supported.
The output in case of NPC=XF_NPPC1 is 8-bit and packing four 2-bit pixel values into 8-bit. The output in case of NPC=XF_NPPC8 is 16-bit, 8-bit, 2-bit pixel values are packing into 16- bit.
Number of pixels to be processed per cycle; possible options are XF_NPPC1 and XF_NPPC8 for 1 pixel and 8 pixel operations respectively.
In XF_NPPC1, the output image pixels are packed and precision is XF_NPPC4. In XF_NPPC8, output pixels precision is XF_NPPC8.

EdgeTracing

template<int SRC_T, int DST_T, int ROWS, int COLS,int NPC_SRC,int NPC_DST,bool USE_URAM=false>
voidEdgeTracing(
	xf::Mat<SRC_T, ROWS, COLS, NPC_SRC> & _src,
	xf::Mat<DST_T, ROWS, COLS, NPC_DST> & _dst)

NPC_SRC----Number of pixels to be processed per cycle. Fixed to XF_NPPC32.
NPC_DST----Number of pixels to be written to destination. Fixed to XF_NPPC8.

++++++++++++++++++++++++++++++++++++++
FAST Corner Detection

template<int NMS,int SRC_T,int ROWS, int COLS,int NPC=1>
void fast(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _src_mat,
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _dst_mat,
	unsigned char _threshold)

支持的SRC_T包括XF_8UC1 。
支持的DST_T包括XF_8UC1 。
支持的NPPC包括XF_NPPC1 and XF_NPPC8。

+++++++++++++++++++++++++
Harris Corner Detection

template<int FILTERSIZE,int BLOCKWIDTH, int NMSRADIUS,int SRC_T,int ROWS, int COLS,int NPC=1,bool USE_URAM=false>
void cornerHarris(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & src,
	xf::Mat<SRC_T, ROWS, COLS, NPC> & dst,
	uint16_t threshold, 
	uint16_t k)

Size of the Sobel filter. 3, 5, and 7 supported。
Size of the box filter. 3, 5, and 7 supported.
支持的SRC_T包括XF_8UC1 。
支持的DST_T包括XF_8UC1 。
支持的NPPC包括XF_NPPC1 and XF_NPPC8。

++++++++++++++++++++++++++++++++++
Histogram Computation

template<int SRC_T,int ROWS, int COLS,int NPC=1>
void calcHist(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _src, 
	uint32_t *histogram)

Output array of 256 elements
支持的SRC_T包括XF_8UC1 and XF_8UC3。
支持的DST_T包括XF_8UC1 and XF_8UC3。
支持的NPPC包括XF_NPPC1 and XF_NPPC2 and XF_NPPC4 and XF_NPPC8。

++++++++++++++++++++++++++++
MinMaxLoc

template<int SRC_T,int ROWS,int COLS,int NPC>
void minMaxLoc(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _src,
	int32_t *max_value,
	int32_t *min_value,
	uint16_t * _minlocx, 
	uint16_t * _minlocy, 
	uint16_t * _maxlocx, 
	uint16_t * _maxlocy )

支持的SRC_T包括XF_8UC1 and XF_16UC1。
支持的DST_T包括XF_8UC4 。
支持的NPPC包括XF_NPPC1 and XF_NPPC8。

+++++++++++++++++++++++++++++++++
Thresholding

template<int THRESHOLD_TYPE, int SRC_T, int ROWS, int COLS,int NPC=1>
void Threshold(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _src_mat,
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _dst_mat,
	short int thresh,
	short int maxval )

支持的SRC_T包括XF_8UC1 。
支持的DST_T包括XF_8UC1 。
支持的NPPC包括XF_NPPC1 and XF_NPPC8 。

+++++++++++++++++++++++++++++++++
Otsu Threshold

template<int SRC_T, int ROWS, int COLS,int NPC=1> void
OtsuThreshold(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _src_mat, 
	uint8_t &_thresh)

Input pixel type. Only 8-bit, unsigned, 1 channel is supported (XF_8UC1).
Number of pixels to be processed per cycle; possible options are XF_NPPC1 and XF_NPPC8 for 1 pixel and 8 pixel operations respectively.
Output threshold value after the computation.

+++++++++++++++++++++++++++++++++++++
Color Thresholding
The colorthresholding function compares the color space values of the source image with low and high threshold values, and returns either 255 or 0 as the output.

template<int SRC_T,int DST_T,int MAXCOLORS, int ROWS, int COLS,int NPC>
void colorthresholding(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _src_mat,
	xf::Mat<DST_T, ROWS, COLS, NPC> & _dst_mat,
	unsigned char low_thresh[MAXCOLORS*3], 
	unsigned char high_thresh[MAXCOLORS*3])

Input pixel type. Only 8-bit, unsigned, 3 channel is supported (XF_8UC3).
Output pixel type. Only 8-bit, unsigned, 1 channel is supported (XF_8UC1).
Only XF_NPPC1 supported.
MAXCOLORS----Maximum number of color values

++++++++++++++++++++++++++++++++++++
InRange
The InRange function checks if pixels in the image src lie between the given boundaries. dst(x,y)
is set to 255, if src(x,y) is within the specified thresholds and otherwise 0.
Dst(I)= lowerb ≤ src(I) ≤ upperb

template<int SRC_T, int ROWS, int COLS,int NPC=1>
void inRange(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & src,
	unsigned char lower_thresh,
	unsigned char upper_thresh,
	xf::Mat<SRC_T, ROWS, COLS, NPC> & dst)

Input Pixel Type. 8-bit, unsigned, 1 and 3 channels are supported (XF_8UC1 and XF_8UC3).
possible options are XF_NPPC1 and XF_NPPC8 for 1 pixel and 8 pixel operations respectively.

++++++++++++++++++++++++++++++++++
HOG
The histogram of oriented gradients (HOG) is a feature descriptor used in computer vision for the
purpose of object detection.

+++++++++++++++++++++++++++++++++
WarpTransform
The warpTransform function is designed to perform the perspective and affine geometric
transformations on an image.

+++++++++++++++++++++++++++++++++++
Pyramid Up
The pyrUp function is an image up-sampling algorithm.
The output image size is always (2rows × 2columns)

template<int TYPE, int ROWS, int COLS, int NPC>
void pyrUp (
	xf::Mat<TYPE, ROWS, COLS, NPC> & _src, 
	xf::Mat<TYPE, ROWS, COLS, NPC> & _dst)

Input and Output pixel type. Only 8-bit, unsigned, 1 and 3 channels are supported (XF_8UC1 and
XF_8UC3).
Currently, the kernel supports only 1 pixel per cycle processing (XF_NPPC1).

+++++++++++++++++++++++++++++++++++++++
Pyramid Down
The pyrDown function is an image down-sampling algorithm which smoothens the image before
down-scaling it.
Down-scaling is performed by dropping pixels in the even rows and the even columns.

template<int TYPE, int ROWS, int COLS, int NPC,bool USE_URAM=false>
void pyrDown (
	xf::Mat<TYPE, ROWS, COLS, NPC> & _src, 
	xf::Mat<TYPE, ROWS, COLS, NPC> & _dst)

Input and Output pixel type. Only 8-bit, unsigned, 1 and 3 channels are supported (XF_8UC1 and
XF_8UC3).
Currently, the kernel supports only 1 pixel per cycle processing (XF_NPPC1).

+++++++++++++++++++++++++++++++++++++++++++
Delay

this function to delay the input packet that arrives early, by a finite number of clock cycles.

template<int MAXDELAY, int SRC_T, int ROWS, int COLS,int NPC=1 >
void delayMat(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _src,
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _dst)

Number of pixels to be processed per cycle; possible options are XF_NPPC1 and XF_NPPC8 for 1
pixel and 8 pixel operations respectively.

+++++++++++++++++++++++++++++++++++++
Duplicate
When the output from one function is consumed by two functions in a pipeline, the FIFOs need to be duplicated. This function facilitates the duplication process of the FIFOs.

template<int SRC_T, int ROWS, int COLS,int NPC=1>
void duplicateMat(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _src,
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _dst1,
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _dst2)

++++++++++++++++++++++++++
PaintMask

template< int SRC_T,int MASK_T, int ROWS, int COLS,int NPC=1>
void paintmask(
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _src_mat, 
	xf::Mat<MASK_T, ROWS, COLS, NPC> & in_mask, 
	xf::Mat<SRC_T, ROWS, COLS, NPC> & _dst_mat,
	unsigned char _color[XF_CHANNELS(SRC_T,NPC)])

逐像素叠加掩码图像mask。
支持的SRC_T包括XF_8UC1。
支持的DST_T包括XF_8UC1。
支持的NPPC包括XF_NPPC1 and XF_NPPC8。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值