The image of corrosion

Image morphology is a branch of computer vision, which plays an important role in robot recognition. Corrosion: Deletes some pixels from object boundaries. That’s where the highlight in the original was corroded. Role of corrosion 1, edge detection. 2. Noise filtering. 3. Morphological skeleton extraction.

def erode_demo(image): # Image corrupts gray= cv.cvtColor(image,cv.COLOR_BGR2GRAY)
    ret,binary=cv.threshold(gray,0.255,cv.THRESH_BINARY_INV|cv.THRESH_OTSU)
    kernel = cv.getStructuringElement(cv.MORPH_RECT, (3.3) # erode(binary,kernel) cv.imshow("tetx",dst)
Copy the code