Commit 5a94445a authored by klorydryk's avatar klorydryk

Update logo to technopolice - move gradient to half the height

parent a4000a8b
logo.png

12.9 KB | W: | H:

logo.png

2.04 KB | W: | H:

logo.png
logo.png
logo.png
logo.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -34,9 +34,9 @@ GREEN = (0, 255, 0)
suspiciousColors = {0:(0,0,0), 1:GREEN, 2:ORANGE, 3:RED}
avSusRectWidth = 50
avSusRectWidth = 60
cursorSize = (50, 20)
cursorSize = (30, 30)
cursor = cv2.imread('logo.png') # Read the file
cursor = cv2.resize(cursor, cursorSize)
......@@ -63,21 +63,26 @@ def displayGradientOn(resultImage, value):
colors = list(red.range_to(orange,10))
colors += list(orange.range_to(Color("green"),10))
pixelColorSize = 5
height = resultImage.shape[0]
width = resultImage.shape[1]
cursor_height = cursor.shape[0]
cursor_width = cursor.shape[1]
gradient_height = len(colors)*pixelColorSize
start_position = height/2-gradient_height/2
pixelColorSize = 5
i = 0
for color in colors:
h = color.hex.lstrip('#')
if(len(h) == 6):
cv2.rectangle(resultImage, (int(width-avSusRectWidth), i*pixelColorSize), (int(width), (i+1)*pixelColorSize), tuple(int(h[j:j+2], 16) for j in (4, 2, 0)), -1)
cv2.rectangle(resultImage, (int(width-avSusRectWidth), int(start_position + i*pixelColorSize)), (int(width), int(start_position + (i+1)*pixelColorSize)), tuple(int(h[j:j+2], 16) for j in (4, 2, 0)), -1)
else:
cv2.rectangle(resultImage, (int(width-avSusRectWidth), i*pixelColorSize), (int(width), (i+1)*pixelColorSize), tuple(int(h[j:j+2], 16) for j in (2, 1, 0)), -1)
cv2.rectangle(resultImage, (int(width-avSusRectWidth), int(start_position + i*pixelColorSize)), (int(width), int(start_position + (i+1)*pixelColorSize)), tuple(int(h[j:j+2], 16) for j in (2, 1, 0)), -1)
i += 1
x_offset = width-avSusRectWidth
y_offset = int((i)*pixelColorSize * (2-(value-1))/2)
resultImage[y_offset:y_offset+cursor.shape[0], x_offset:x_offset+cursor.shape[1]] = cursor
x_offset = width-avSusRectWidth-30
y_offset = int((start_position - cursor_height/2) + gradient_height * (2-(value-1))/2)
resultImage[y_offset:y_offset+cursor_height, x_offset:x_offset+cursor_width] = cursor
def calculateAverageSuspicious(faceSuspicion):
global averageSuspicious
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment