Edge Detection
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
def img_callback(self, msg):
# Canny Edge Detection
# Blurs image and find intensity gradients
img = self.bridge.imgmsg_to_cv2(msg, 'bgr8')
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
kernelSize = 31grayBlur = cv2.GaussianBlur(gray, (kernelSize, kernelSize), 0)lowEnd = 30
highEnd = 100
edges = cv2.Canny(grayBlur, lowEnd, highEnd)
# Publish for use in finding centroid
self.img_pub.publish(self.bridge.cv2_to_imgmsg(edges))