Fix intensity script
This commit is contained in:
parent
263d9b2f49
commit
3ecbe0b53f
1 changed files with 2 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
capture = cv2.VideoCapture(0)
|
capture = cv2.VideoCapture(2)
|
||||||
cv2.namedWindow("Camera", cv2.WINDOW_AUTOSIZE)
|
cv2.namedWindow("Camera", cv2.WINDOW_AUTOSIZE)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
@ -11,7 +11,7 @@ def main():
|
||||||
frame_mono = np.mean(frame, axis=2)
|
frame_mono = np.mean(frame, axis=2)
|
||||||
intensity = np.mean(frame_mono)
|
intensity = np.mean(frame_mono)
|
||||||
|
|
||||||
print(f"\033[H\033[2J{intensity:5.1f}")
|
print(f"\033[H\033[2J{intensity:6.3f}")
|
||||||
|
|
||||||
cv2.imshow('Camera', frame)
|
cv2.imshow('Camera', frame)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue