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 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') |
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 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] |
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 | |
red = np.uint8([[[0, 0, 255]]]) | |
hsv_red = cv2.cvtColor(red, cv2.COLOR_BGR2HSV) | |
print(hsv_red) | |
image = cv2.imread("Coke.jpg",1) |