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 | 29 |
30 | 31 |
Tags
- c
- C언어
- 시스템프로그래밍
- 코딩
- Windows10
- linux
- CV
- 운영체제
- 알고리즘
- 텐서플로우
- 학습
- python
- 백준알고리즘
- C++
- 프로그래밍
- 영상처리
- Windows 10
- 쉘
- error
- 프로세스
- 딥러닝
- 리눅스
- 회귀
- shell
- Computer Vision
- 턱걸이
- OpenCV
- 백준
- TensorFlow
- 공부
Archives
- Today
- Total
줘이리의 인생적기
CV - opencv(Python) Hough Transform(설명필요) 본문
728x90
Hough Transform에 대해 알아보겠습니다.
hough transform은 영상에서 직선을 검출하는 방법 중 하나입니다.
(설명필요)
Hough Transform
코드 원형 설명
def houghLinesP(image, rho=1.0, theta=np.pi/180, threshold=100, minLineLength=10, maxLineGap=100):
return cv2.HoughLinesP(image, rho, theta, threshold, minLineLength=minLineLength, maxLineGap=maxLineGap)
def drawHoughLinesP(image, lines):
result = imageCopy(image)
if len(image.shape) == 2:
result = convertColor(image, cv2.COLOR_GRAY2BGR)
for i in range(len(lines)):
for x1, y1, x2, y2 in lines[i]:
cv2.line(result, (x1, y1), (x2, y2), (0, 0, 255), 3)
코드 설명
더보기
from OpenCV_Functions import *
#이미지 설정
imagePath = "<이미지 경로>"
image = imageRead(imagePath)
imageShow("image", image)
#hough 변환
image_edge = cannyEdge(image, 100, 200)
lines = houghLinesP(image_edge, 1, np.pi/180, 100, 10, 50)
image_lines = drawHoughLinesP(image, lines)
imageShow("image_edge", image_edge)
imageShow("image_lines", image_lines)
cv2.destroyAllWindows()
'공부 > Computer Vision(py)' 카테고리의 다른 글
CV - opencv(python) imread, copy (0) | 2020.11.28 |
---|---|
CV - opencv(Python) Geometric Transform(설명필요) (0) | 2020.07.23 |
CV - opencv(Python) Morphology (0) | 2020.07.22 |
CV - opencv(Python) Canny Edge (0) | 2020.07.21 |
CV - opencv(Python) 경계선 검출(edge detection) (0) | 2020.07.20 |