Skip to content

Instantly share code, notes, and snippets.

View ArmenianButcher's full-sized avatar

Vigen Oganesyan ArmenianButcher

View GitHub Profile
@ArmenianButcher
ArmenianButcher / CompVision.py
Last active May 26, 2018 09:48
This code cuts an area with the largest symbol from image, that you offer.
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
from PIL import Image
def take_index(a,b,c,d):
areas = [(a[i] * b[i], i) for i in range(len(a))]
return sorted(areas)[-1][1]
img = cv.imread('color.png')
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
def take_max(A):
A = [X]
max = A[0]
for i in range (len(A)):
if A[i]>max:
max = A[i]
@ArmenianButcher
ArmenianButcher / .py
Last active April 14, 2018 18:15
That's my OpenCV code
import cv2
import numpy as np
red = np.uint8([[[0, 0, 255]]])
hsv_red = cv2.cvtColor(red, cv2.COLOR_BGR2HSV)
print(hsv_red)
image = cv2.imread("Coke.jpg",1)