Skip to content

Instantly share code, notes, and snippets.

@yuyay
yuyay / splitFile.py
Created July 17, 2012 11:09
split an image into 6 small images
# -*- coding:utf-8 -*-
import os
import cv2
row = 1882 #縦
col = 1913 #横
point = [(195, 133), (2073, 133), (3948, 133),
(200, 2035), (2072, 2035), (3938, 2035)] #
@yuyay
yuyay / remove.py
Created August 21, 2012 19:46
<>切り取る
# -*- coding:utf-8 -*-
import os
import cv2
folderName = ''
outputFolder = ''
for files in os.listdir(folderName):
@yuyay
yuyay / gist:0d037d3543405fb4c30120eb5b0f648f
Created May 6, 2017 11:53 — forked from jdiscar/gist:9144764
RGB Value to Nearest Color Name (Python)
"""
Original Author Ernesto P. Adorio, Ph.D
Original Source: http://my-other-life-as-programmer.blogspot.com/2012/02/python-finding-nearest-matching-color.html
Modifed By: JDiscar
This class maps an RGB value to the nearest color name it can find. Code is modified to include
ImageMagick names and WebColor names.
1. Modify the minimization criterion to use least sum of squares of the differences.
2. Provide error checking for input R, G, B values to be within the interval [0, 255].