【发布时间】:2021-01-03 02:36:03
【问题描述】:
Error which I am getting 这是我的代码。我无法理解这个错误。我已经尝试了很多但没有得到正确的解决方案。请帮助我知道错误是什么。
import numpy as np
import cv2
from skimage.feature import local_binary_pattern
import statistics
from os import read
from google.colab.patches import cv2_imshow
cap = cv2.VideoCapture('/content/4.forged4.avi')
countF = cap.get(cv2.CAP_PROP_FPS) # calculate no of frames per sec
while True:
ret, frame = cap.read()
if ret:
gray_img = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
gray = np.array(gray_img).astype(int)
frames.append(gray)
#cv2_imshow(gray_img)
radius = 3
p = 8 * radius
lbp = local_binary_pattern(gray_img,p, radius, method = 'uniform')
print(lbp)
val = statistics.stdev(lbp) # caluculated standard deviation
print(val)
if val == 0:
print("Authenticated")
else:
print("Forgery Detected!")
【问题讨论】:
-
请不要发布代码、数据或 Tracebacks 的图像。将其复制并粘贴为文本,然后将其格式化为代码(选择它并输入
ctrl-k)...Discourage screenshots of code and/or errors -
请修正代码中的缩进:Formatting help ... more Formatting ... Formatting sandbox