python - What filter is used to remove corner effect on result -
below output
here marked in red circle. there lots of such line image, have marked 3 circle. how remove these lines? there filter remove line? think, due presence of corner.
you can use median filter remove thing.
try code , see difference while changing value of trackbar (mask size).
import cv2 import numpy np def nothing(x): pass #image window cv2.namedwindow('image') cv2.namedwindow('image2') # create trackbars color change cv2.createtrackbar('mask','image',1,10,nothing) cv2.createtrackbar('mask2','image2',1,10,nothing) #loading images img = cv2.imread('vfgsn.png') # load image path gray_im = cv2.cvtcolor(img, cv2.color_bgr2gray) while true: # current positions of trackbars m = cv2.gettrackbarpos('mask','image') m2 = cv2.gettrackbarpos('mask2','image2') median = cv2.medianblur(gray_im,(2*m+1)) median2 = cv2.medianblur(img,(2*m2+1)) cv2.imshow('image',median) cv2.imshow('image2',median2) #press esc stop k = cv2.waitkey(1) & 0xff if k == 27: break cv2.destroyallwindows()
resultant image mask : 5
in grayscale (with same mask)
but affects other parts of image. if don't want happen other part. can apply filter in region of interest only.
hope helps.
Comments
Post a Comment