Skip to content

Commit 41a2515

Browse files
Initial commit
0 parents  commit 41a2515

File tree

8 files changed

+54
-0
lines changed

8 files changed

+54
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Project exclude paths
2+
/venv/

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/lane_detection.iml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

detector_opencv.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import matplotlib.pylab as plt
2+
import cv2 as cv
3+
import numpy as np
4+
image=cv.imread('lane.jpeg')
5+
image=cv.cvtColor(image,cv.COLOR_BGR2RGB)
6+
7+
print(image.shape)
8+
height=image.shape[0]
9+
width=image.shape[1]
10+
region_of_interst_vertices=[(0,height),(width/2,height/2),(width,height)]
11+
def region_of_interst(img,vertices):
12+
mask=np.zeros_like(img)
13+
channel_count=img.shape[2]
14+
match_mask_color=(255,)*channel_count
15+
cv.fillPoly(mask,vertices,match_mask_color)
16+
mask_image=cv.bitwise_and(img,mask)
17+
return mask_image
18+
cropped=region_of_interst(image,np.array([region_of_interst_vertices],np.int32))
19+
plt.imshow(cropped)
20+
plt.show()
21+

lane.jpeg

6.58 KB
Loading

0 commit comments

Comments
 (0)