This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# 0から6まで0.1刻みで配列に格納する | |
x = np.arange(0, 6, 0.1) | |
# xの値を入力に、sinとcosの配列を作る | |
y1 = np.sin(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
x = np.arange(0, 6, 0.1) | |
#print(x) | |
y1 = np.sin(x) | |
y2 = np.cos(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding:utf-8 | |
import cv2 | |
import numpy as np | |
width = 16 | |
height = 24 | |
# uint8で0埋めの配列を作る。 | |
# 幅16、高さ24のサイズ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
import cv2 | |
import numpy as np | |
import sys | |
import os.path | |
# 引数をとります | |
def GetArguments(args): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
import cv2 | |
import numpy as np | |
faceCascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') | |
img = cv2.imread('image.jpg', cv2.IMREAD_COLOR) | |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
face = faceCascade.detectMultiScale(gray, 1.1, 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
gamma = 1.8 | |
lookUpTable = np.zeros((256, 1), dtype = 'uint8') | |
for i in range(256): | |
lookUpTable[i][0] = 255 * pow(float(i) / 255, 1.0 / gamma) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
import cv2 | |
import numpy as np | |
img = cv2.imread('B.jpg', cv2.IMREAD_COLOR) | |
logo = cv2.imread('logo2.png', cv2.IMREAD_UNCHANGED) | |
#Get Height And Width of Logo | |
logoHeight, logoWidth = logo.shape[:2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
import cv2 | |
import numpy as np | |
#サイズの同じ画像を2枚読み込んでおく | |
imgA = cv2.imread('A.jpg', 1) | |
imgB = cv2.imread('B.jpg', 1) | |
#画像の大きさと次元が同じあることを確認しておく | |
print imgA.shape |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
import cv2 | |
import numpy as np | |
img = cv2.imread('input.jpg', cv2.IMREAD_COLOR) | |
orgHeight, orgWidth = img.shape[:2] | |
size = (orgHeight/2, orgWidth/2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
import cv2 | |
import numpy as np | |
img = cv2.imread('sgt_512.jpg', cv2.IMREAD_COLOR) | |
orgHeight, orgWidth = img.shape[:2] | |
size = (orgHeight/2, orgWidth/2) |
NewerOlder