Skip to content

Commit dfb4e96

Browse files
authored
Add files via upload
1 parent 1885463 commit dfb4e96

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Hough_Transform/Hough_Transform.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import cv2
2+
import numpy as np
3+
img = cv2.imread("E:\msc AI\SEM -II\AP\Prac2\co_c.jpg")
4+
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
5+
edges = cv2.Canny(gray, 75, 150)
6+
lines = cv2.HoughLinesP(edges, 1, np.pi/180, 30, maxLineGap=250)
7+
8+
for line in lines:
9+
x1, y1, x2, y2 = line[0]
10+
cv2.line(img, (x1, y1), (x2, y2), (200, 20, 180), 1,)
11+
cv2.imshow("linesEdges", edges)
12+
cv2.imshow("linesDetected", img)
13+
cv2.waitKey(0)
14+
cv2.destroyAllWindows()

Hough_Transform/co_c.jpg

165 KB
Loading

0 commit comments

Comments
 (0)