Q: How can I find edges on my image?
A: The first step of finding edges is noise removing, enhancing edges and finally thresholding the image. The goal of removing noise from the image is to eliminate the false edges due to the noise. It’s important to note that noise removing can smooth the edges, so select a filter, that does not smooth the edges too much in demand. To enhance the edges use one of the gradient filters. In case of grayscale images GrayScaleTopHat filter is also available. Finally threshold the image using HistDIBThreshold function. All of these functions are implemented in BIFILTER.Dll. If the preview dialog is shown, the input parameters of the filtering can be changed onscreen, so the optimal properties of the filtering can be tuned.
Code example:
Dim hSourceDib As Long
Dim hResDib As Long
Dim BIFilterObj As Object
‘ Load the input image
…
Set BIFilterObj = CreateObject("BIFILTER.BIFilterCtrl.1")
hResDib = BIFilterObj. BIFilterObj. FilterMedian(hSourceDib, 2, DispBoth, hWnd);
hResDib = BIFilterObj. BIFilterObj. FilterGradient FilterGradient(hResDib,
GRADIENT_NORTH_ISOTROPIC, DispBoth, hWnd)
hResDib = BIFilterObj. BIFilterObj. HistDIBThreshold(hResDib, 10, DispBoth, hWnd);
Set BIFilterObj = Nothing
‘ Further processing