Filters off small noise blobs (speckles) in the disparity map
//用于过滤不同块的小斑点,可以在深度图中应用
C++: void filterSpeckles(InputOutputArray img, double newVal, int maxSpeckleSize, double maxDiff, InputOutputArray buf=noArray() )
Python: cv2.filterSpeckles(img, newVal, maxSpeckleSize, maxDiff[, buf]) → None
Parameters:
**img** – The input 16-bit signed disparity image
//输入的16位的视差图或者深度图
**maxSpeckleSize** – The maximum speckle size to consider it a speckle. Larger blobs are not affected by the algorithm
//斑点块的大小
**maxDiff** – Maximum difference between neighbor disparity pixels to put them into the same blob. Note that since StereoBM, StereoSGBM and may be other algorithms return a fixed-point disparity map, where disparity values are multiplied by 16, this scale factor should be taken into account when specifying this parameter value.
//
**buf** – The optional temporary buffer to avoid memory allocation within the function.
//
应用:见大疆guidance 视觉追踪demo