Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- import numpy
- image_colour = cv2.imread('/Users/dariabusi/Desktop/6_2.png',cv2.IMREAD_COLOR)
- cv2.imshow ('Original', image_colour)
- image_grey = cv2.imread('/Users/dariabusi/Desktop/6_2.png',cv2.IMREAD_GRAYSCALE)
- new_threshold, image_thresh = cv2.threshold(image_grey, 125, 255 , cv2.THRESH_BINARY_INV)
- cv2.imshow ('Originalcanny', image_thresh)
- linesP = cv2.HoughLinesP( image = image_thresh, rho = 1, theta = numpy.pi/100 , threshold = 255, maxLineGap = 15)
- for i in range(0, len(linesP)):
- l = linesP[i][0]
- cv2.line(image_colour, (l[0], l[1]), (l[2], l[3]), (255,255,255), 5, cv2.LINE_AA)
- cv2.imshow ('Experiment3', image_colour)
- cv2.waitKey(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement