VLIB中边缘检测算法学习

来源:互联网 发布:网络电影 罪 编辑:程序博客网 时间:2024/04/29 12:27

今天以这个为例子Canny Edge Detection,来学习一下VLIB中函数在DVRRDK中的使用例子。 

Canny检测简介:相对于许多其它的边缘检测方法,比如sobel和Robert十字,Canny边缘检测器一般被认为是的首选de ,因为即使在含有噪声的图像中也能有较好的效果。

canny方法:

高斯图像平滑
2D梯度过滤
非最大抑制
滞后阈值
双阈值
边松弛

提供的API:

VLIB_Canny_Edge_Detection - 一个包装函数可以可以调用下面的所有函数。
VLIB_conv_7x7_i8_c8s - 高斯图像平滑
VLIB_xyGradientsAndMagnitude - 二维梯度过滤
VLIB_non最大抑制康力 - 非最大抑制
VLIB_doublethresholding - 双阈值
VLIB_edgeRelaxation - 边松弛

VLIB_Canny_Edge_Detection

Detailed Description

 

Functions

void VLIB_Canny_Edge_Detection (const uint8_t *pInput, int16_t *pBufGradX, int16_t *pBufGradY, int16_t *pBufMag, uint8_t *pBufOut, uint8_t *pScratch, int32_t *numItems, uint16_t width, uint16_t height)void VLIB_conv_7x7_i8_c8s (const uint8_t *restrict imgin_ptr, uint8_t *restrict imgout_ptr, uint32_t width, int16_t pitch, const int8_t *restrict mask_ptr, int16_t shift)int32_t VLIB_nonMaximumSuppressionCanny (const int16_t *restrict pInMag, const int16_t *restrict pInGradX, const int16_t *restrict pInGradY, uint8_t *restrict pOut, uint16_t width, uint16_t pitch, uint16_t height)int32_t VLIB_doublethresholding (const int16_t *restrict pInMag, uint8_t *edgeMap, uint32_t *restrict strongEdgeListPtr, int32_t *numStrongEdges, uint16_t width, uint16_t pitch, uint16_t height, uint8_t loThresh, uint8_t hiThresh, uint32_t pos_frm)int32_t VLIB_edgeRelaxation (uint8_t *edgeMap, uint32_t *restrict strongEdgeListPtr, const int32_t *numStrongEdges, uint16_t width)

Function Documentation

void VLIB_Canny_Edge_Detection(const uint8_t * pInput,  int16_t * pBufGradX,  int16_t * pBufGradY,  int16_t * pBufMag,  uint8_t * pBufOut,  uint8_t * pScratch,  int32_t * numItems,  uint16_t width,  uint16_t height  ) 



Description:
This function is a wrapper function around the full Canny Edge Detection algorithms. It internally calls, in sequence on the image:VLIB_conv_7x7_i8_c8s (image smoothing),VLIB_xyGradientsAndMagnitude, VLIB_nonMaximumSuppressionCanny, VLIB_doublethresholding andVLIB_edgeRelaxation. It requires externally allocated intermediate buffers to be provided and takes care of border conditions in between internal function calls. The above mentioned APIs are independently callable in case a different sequence is required, intermeidate processing is required, or differ buffer management is required.
Parameters:
[in] *pInput Pointer to input image array[out] *pBufGradX Pointer to array containing X gradient[out] *pBufGradY Pointer to array containing Y gradient[out] *pBufMag Pointer to array containing magnitude[out] *pBufOut Pointer to output buffer[out] *pScratch Pointer to scratch buffer[out] *numItems Pointer to scalar number of items[in] width Input width[in] height Input height
Assumptions:
  • The input array and output arrays should not overlap
  • The output array must be 32-bit aligned
  • The width parameter must be a multiple of 2 and >= 18
  • The height parameter must be > 10
  • pBufGradX should be a buffer of (width * height * 2) bytes
  • pBufGradY should be a buffer of (width * height * 2) bytes
  • pBufMag should be a buffer of (width * height * 2) bytes
  • pBufOut should be a buffer of (width * height) bytes
  • pScratch should be a buffer of (width * height) bytes  



0 0
原创粉丝点击