일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 턱걸이
- C언어
- error
- 공부
- 백준알고리즘
- shell
- OpenCV
- c
- 백준
- 딥러닝
- 쉘
- 리눅스
- Windows10
- 학습
- 운영체제
- 코딩
- 알고리즘
- Computer Vision
- python
- 텐서플로우
- TensorFlow
- CV
- 회귀
- 시스템프로그래밍
- 영상처리
- 프로세스
- Windows 10
- C++
- linux
- 프로그래밍
- Today
- Total
목록python (11)
줘이리의 인생적기

딥러닝 데이터 그래프를 그리기 전에 matplotlib.pyplot와 친해져보도록 하겠습니다. import matplotlib.pyplot as plt import tensorflow as tf x = range(20) y = tf.random.normal([20], 0, 1) #1 plt.plot(x, y) plt.show() #2 plt.plot(x, y, 'ko') plt.show() #3 plt.plot(x, y, 'k-') plt.show() #4 plt.plot(x, y, 'k--') plt.show() #5 plt.plot(x, y, 'ro') plt.show() #6 plt.plot(x, y, 'y-') plt.show() #7 plt.plot(x, y, 'b--') plt.show() 빨..

python으로 하는 opencv를 다시 시작해보도록 하겠습니다. 아주 대표적인 사진이죠. lenna사진을 불러오는 imread 함수를 알아보고 flag도 알아보겠습니다. import cv2 def function1(): image = cv2.imread('lenna.bmp', cv2.IMREAD_COLOR) #default 값(1) #image = cv2.imread('lenna.bmp', cv2.IMREAD_GRAYSCALE) #흑백(0) #image = cv2.imread('lenna.bmp', cv2.IMREAD_UNCHANGED) #alpha channel까지 포함(-1) if image is None: print('Image load failed!') return print('image의 ty..

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: res..

Geometric Transform에 대해 알아보겠습니다. Spatial Transform -Scaling -Rotation -Translation -Skew Affine Transform -Linear tranform -이동, 회전, 스케일 및 이들의 조합에 의한 변환 (설명 필요) Warping -Nonlinear transform (설명 필요) 1번 이미지 잘라서 붙여넣기 2번 이미지 이동 3번 이미지 회전, 확대, 축소 4번 Affine transform 코드 원형 설명 def imageResize(image, dsize=None, fx=0.0, fy=0.0, interpolation=cv2.INTER_LINEAR): if dsize is None and fx == 0.0 and fy == 0.0..
Blur, GaussianBlur, MedianBlur에 대해 알아보겠습니다. 그전에, 영상 평활화(Image Smoothing, Image Blurring)를 알아보겠습니다. 영상 평활화는 영상을 부드럽게 표현하거나 잡음을 제거하기 위해 사용되며, 평균값 필터링(mean filtering) 및 중간값 필터링(median filtering) 연산을 통해 수행되어집니다. 평균값 필터링(mean filtering) -모든 계수가 양수, 전체 합이 1인 마스크 -weight의 형태에 따라 Gaussian filtering이라고도 불림. 중간값 필터링(median filtering) -Nonlinear filtering -중앙의 픽셀 값이 필터 영역 내 모든 픽셀 값의 중앙값으로 대체됨. 1번 imageBlur..

addImage, addWeightedImage, imageThreshold에 대해 알아보도록 하겠습니다. 1번 addImage - 이미지합치기 2번 addWeightedImage - 각 이미지에 가중치 조절하기 3번 imageThreshold -THRESH_BINARY : 픽셀 값이 설정 값보다 크면 설정 값, 작으면 0으로 할당. -THRESH_BINARY_INV : 픽셀 값이 설정 값보다 크면 0, 작으면 설정 값으로 할당. -THRESH_TRUNC : 픽셀 값이 설정 값보다 크면 설정 값, 작으면 픽셀 값으로 할당. -THRESH_TOZERO : 픽셀 값이 설정 값보다 크면 픽셀 값, 작으면 0으로 할당. -THRESH_TOZERO_INV : 픽셀 값이 설정 값보다 크면 0, 작으면 픽셀 값 할당..

흰색 차선과 노란 차선을 검출해보도록 하겠습니다. 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) whi..

먼저, ROI(Region of Interest) 관심영역 설정하는 방법을 알아보고 RGB 컬러 이미지의 경우 3개의 채널을 각각 Red Channel, Green Channel, Blue Channel 이라고 하는데 각 채널들을 분리해서 값을 원하는 값으로 변경해보도록 하겠습니다. 1번 grayscale로 이미지를 불러온 후 채널 분리, (100,100) ~(200,200) 픽셀의 lightness 값을 255로 변경 2번 이미지를 불러 온 후 채널 분리, (100,100) ~(200,200) 픽셀의 lightness 값을 255로 변경 채널 분리 및 병합 코드 원형 설명 #채널 분리 def splitImage(image): return cv2.split(image) #채널 병합 def mergeIma..