Skip to content

Instantly share code, notes, and snippets.

View PeaceAndHiLight's full-sized avatar

PeaceAndHiLight

View GitHub Profile
@PeaceAndHiLight
PeaceAndHiLight / flip.py
Created January 7, 2016 15:03
Flip Image
#coding: utf-8
import cv2
img = cv2.imread('beatles_forsale.jpg', cv2.IMREAD_COLOR)
xAxis = cv2.flip(img, 0)
yAxis = cv2.flip(img, 1)
xyAxis = cv2.flip(img, -1)
@PeaceAndHiLight
PeaceAndHiLight / CopyJohn.py
Created January 6, 2016 14:39
Python Copy ROI
#coding: utf-8
import cv2
import numpy as np
# Read Image
img = cv2.imread('beatles_forsale.jpg')
# Copy John's Face
john = img[20:80, 40:100]
@PeaceAndHiLight
PeaceAndHiLight / ROI.py
Last active January 6, 2016 14:16
Python About ROI
#coding: utf-8
import cv2
import numpy as np
rows = 256
cols = 256
img = np.zeros((rows,cols,3), dtype=np.uint8)
@PeaceAndHiLight
PeaceAndHiLight / Lenna.bmp
Last active August 12, 2017 01:31
Test Numpy Method
@PeaceAndHiLight
PeaceAndHiLight / PixelInfo.py
Last active January 5, 2016 12:32
OpenCV and Numpy ImageRead
#coding: utf-8
import cv2
import numpy as np
# readImage
img = cv2.imread('beatles_forsale.jpg')
print type(img)
pixelValue = img[10, 20]