[DIP] Function plot and Image display
·
Programming/DIP
Image는 수학적으로 independent variable이 2개인 multi-variable function $f(x,y)$로 표시할 수 있음. gray-scale image일 때는 multi-variable scalar-valued function (또는 multi-variate function이라도 부른다) color image라면 multi-variable vector-valued function color image 의 경우, 함숫값이 RGB와 같이 3개의 component를 가진 vector임 용어관련 참고 : https://dsaint31.tistory.com/389 [Math] Multi-variable vs. Multi-variate and Multiple Regression 1. Mu..
[DIP] Radial distortion : barrel and pincushion distortions
·
Programming/DIP
0. Remappingmatrix equation으로 표현할 수 없는 형태(non-linear)의 이미지 모양 변환을 위한 기능.OpenCV에서 cv2.remap() 함수를 통해 제공되며,lens distortion 및radial distortion등을모델링하거나 제거하는데 사용가능함.dst = cv2.remap(src, mapx, mapy, interpolation, dst, borderMode, borderValue)src: 입력 이미지mapx, mapy: x축과 y축으로 이동할 좌표, src와 동일한 크기, dtype=float32 임.dst : 결과 이미지, optional그 외 : cv2.warpAffine()과 동일mapx[0][0] = 9.0, mapy[0][0] = 3.0 인 경우,입력 i..
[ML] Underfit
·
Programming/ML
Underfit이란ML 모델이 주어진 훈련데이터를 제대로 학습하지 못하여 Training dataset에서도 나쁜 performance를 보이는 경우를 가르킴. Underfit의 경우 훈련데이터에서도 performance measure의 결과가 매우 나쁘게 나오기 때문에 훈련데이터에서 bias가 매우 크고, 대신 모델의 variance는 작은 특징을 보임.bais 높다 = performance 가 나쁘다variance가 낮은 이유는, 워낙 performance가 나쁘기 때문에 어떤 dataset에서도 일관되게 낮은 performance를 보이기때문임.발생원인Data의 features가 task를 해결하기 위한 정보가 부족한 경우 (non-representative data),Model의 가설공간이 tas..
[colab] google drive와 colab연동하기 (기초)
·
Programming
1. 구글드라이브 mount Google Drive 를 mount 하기. colab의 왼쪽 메뉴에서 파일(폴더모양 아이콘)을 클릭하고 (구글)드라이브 마운트 (돋보기를 기준으로 오른쪽에 있는 어두운 색의 폴더 모양 아이콘: 구글드라이브 마크있는 폴더 아이콘)를 클릭하여 본인의 구글 드라이브를 마운트! 참고로 위와 같은 클릭과정 없이 코드로만 마운트하려면 다음을 codecell에 입력하고 수행(shift+enter). (사실 위의 아이콘 클릭은 해당 code cell을 만드는 역할임.) from google.colab import drive drive.mount('/content/drive') 참고로 구글 드라이브의 unmount는 다음 코드 수행을 통해 이루어진다. drive.flush_and_unmou..
[ML] Ward’s linkage method
·
Programming
정의 Ward's method는 cluster 간의 거리를 측정하는 방법 중 하나이며, centroid 와 매우 유사한 방식이지만, 각 cluster의 샘플 수에 대한 고려가 이루어진 방법이다. 간단하게 애기하면 Ward's method에서 두 클러스터의 거리는 cluster의 data points에서 centroid와의 차이를 제곱하여 더한 error sum of square가 두 cluster를 merge할 경우 얼마나 증가하는지로 나타낸다. incremental of ESS 를 이용하기 때문에 centroid linkage와 기반 논리는 비슷하지만 outlier나 noise에 보다 robust 하고 포함하고 있는 data samples 수가 비슷한 cluster들을 merge하는 경향을 보임. 수식..
[matplotlib] bar chart 그리기 : error bar 포함
·
Programming
bar chart 그리기 : error bar 포함Axes object의 ax의 bar method를 이용하여 bar chart를 그릴 수 있음.기본 사용법bar method의 기본적인 사용법은 다음과 같음.ax.bar( x_pos, # 각 bar가 그려질 x축 위치를 item으로 가지는 ndarray. data, # x_pos 의 item 에 대한 bar의 높이에 해당하는 데이터들. width = 0.8, # bar width. bottom = None, align='center', alpha=0.5, # bar 스타일 관련. yerr=error, # error bar를 기재할 때 사용됨. ecolor='black', capsize=10, # erro..