Professional Documents
Culture Documents
IA Project Image
IA Project Image
import cv2
import numpy as np
r = cv2.selectROI(frameHSV)
print(r)
H=[]
S=[]
V=[]
for i in range(altura):
for j in range(ancho):
# print(imagenNueva[i,j])
pixel = imagenNueva[i,j]
H.append(pixel[0])
S.append(pixel[1])
V.append(pixel[2])
hMin = min(H)
hMax = max(H)
sMin = min(S)
sMax = max(S)
vMin = min(V)
vMax = max(V)
total = 0
for i in range(altura):
for j in range(ancho):
pixel = mask[i,j]
if pixel == 255:
total = total +1
frame[i,j]= (0,255,0)
porcentaje = multi / 18588 ## los 18000 son el valor base con el que se guardó la primer muestra
if porcentaje > 100:
porcentaje = 100
print("error", porcentaje)
else:
print("pass", porcentaje)
cv2.imshow('maskAzul', mask)
cv2.imshow('frame', frame)
cv2.waitKey()
cv2.destroyAllWindows()
// the project detects changes in the image and processes them this is a part of the created code