Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 딥러닝
- 회귀
- 리눅스
- OpenCV
- 알고리즘
- shell
- 공부
- linux
- C언어
- CV
- Windows10
- 학습
- TensorFlow
- error
- 코딩
- 시스템프로그래밍
- python
- 텐서플로우
- 영상처리
- 쉘
- c
- 프로세스
- 프로그래밍
- 운영체제
- Computer Vision
- C++
- 백준
- 턱걸이
- 백준알고리즘
- Windows 10
Archives
- Today
- Total
줘이리의 인생적기
CV - opencv(Python) White, Yellow 차선 검출 본문
728x90
흰색 차선과 노란 차선을 검출해보도록 하겠습니다.
1번 흰색 차선 검출
2번 흰색 노란색 차선 검출
전체 코드
더보기
# -*- coding: utf-8 -*-
from OpenCV_Functions import *
def imageProcessing(image):
result = imageCopy(image)
lower_white_hls = np.array([0, 200, 0])
upper_white_hls = np.array([179, 255, 255])
lower_yellow_hls = np.array([15, 30, 115])
upper_yellow_hls = np.array([35, 204, 255])
result = convertColor(result, cv2.COLOR_BGR2HLS)
white_hls_overlay = splitColor(result, lower_white_hls, upper_white_hls)
yellow_hls_overlay = splitColor(result, lower_yellow_hls, upper_yellow_hls)
result = white_hls_overlay + yellow_hls_overlay
result = convertColor(result, cv2.COLOR_HLS2BGR)
return result
road_image_01 = "<이미지 경로>"
image_color1 = imageRead(road_image_01, cv2.IMREAD_COLOR)
result1 = imageProcessing(image_color1)
imageShow("ex03 White Lane", result1, cv2.WINDOW_NORMAL)
road_image_02 = "<이미지 경로>"
image_color2 = imageRead(road_image_02, cv2.IMREAD_COLOR)
result2 = imageProcessing(image_color2)
imageShow("ex03 Yellow and White Lane", result2, cv2.WINDOW_NORMAL)
'공부 > Computer Vision(py)' 카테고리의 다른 글
CV - opencv(Python) addImage, addWeightedImage, imageThreshold (0) | 2020.07.16 |
---|---|
CV - opencv(Python) 비디오에 라인, 원, 사각형 그리기 (0) | 2020.07.13 |
CV - opencv(Python) ROI, Channels (0) | 2020.07.09 |
CV - opencv(Python) 이미지 열기, 창 띄우기, 픽셀 접근 (0) | 2020.07.08 |
CV - 영상처리 개념 (0) | 2020.07.07 |