« first day (3889 days earlier)      last day (1062 days later) » 

12:55 AM
 
 
14 hours later…
2:36 PM
import cv2
import numpy as np


data = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]], [
[0, 0, 0], [128, 128, 128], [255, 255, 255], ]], dtype=np.uint8)


coefficients = np.array([0.114, 0.587, 0.299])

grayed = (data @ coefficients).astype(np.uint8)

comparator = cv2.cvtColor(data, cv2.COLOR_BGR2GRAY)

checked = grayed == comparator


print(grayed)
print("-----------")
print(comparator)
print("-----------")
print(checked)
How about a text with code that follows?

import cv2
import numpy as np


data = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]], [
[0, 0, 0], [128, 128, 128], [255, 255, 255], ]], dtype=np.uint8)


coefficients = np.array([0.114, 0.587, 0.299])

grayed = (data @ coefficients).astype(np.uint8)

comparator = cv2.cvtColor(data, cv2.COLOR_BGR2GRAY)

checked = grayed == comparator


print(grayed)
print("-----------")
print(comparator)
print("-----------")
print(checked)
import cv2
import numpy as np


data = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]], [
    [0, 0, 0], [128, 128, 128], [255, 255, 255], ]], dtype=np.uint8)


coefficients = np.array([0.114, 0.587, 0.299])

grayed = (data @ coefficients).astype(np.uint8)

comparator = cv2.cvtColor(data, cv2.COLOR_BGR2GRAY)

checked = abs(grayed - comparator)


print(grayed)
print("-----------")
print(comparator)
print("-----------")
print(checked)
Code that follows a text does not seem to work.
One more test, ok? This is a text. The incoming stuff is python code.



import cv2
import numpy as np


data = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]], [
[0, 0, 0], [128, 128, 128], [255, 255, 255], ]], dtype=np.uint8)


coefficients = np.array([0.114, 0.587, 0.299])

grayed = (data @ coefficients).astype(np.uint8)

comparator = cv2.cvtColor(data, cv2.COLOR_BGR2GRAY)

checked = abs(grayed - comparator)


print(grayed)
print("-----------")
print(comparator)
print("-----------")
print(checked)
I see, the code must not follow a text in one post. Great!
 
3:25 PM
Am the master of Universe! He-Man !!
 
 
2 hours later…
5:34 PM
OakBot Online.
 

« first day (3889 days earlier)      last day (1062 days later) »