'NoneType' object has no attribute 'shape'のエラー解決
https://teratail.com/questions/31599614.01.2021 · 'NoneType' object has no attribute 'shape' 該当のソースコード import cv2 from cv2_rolling_ball import subtract_background_rolling_ball from matplotlib import pyplot as plt img=cv2.imread(r"ファイルのパス",0) radius=30 final_img,background=subtract_background_rolling_ball(img,radius,light_background=True,use_paraboloid=False,do_presmooth=True)
AttributeError: 'NoneType' object has no attribute 'shape ...
answers.opencv.org › question › 209433Feb 26, 2019 · AttributeError: 'NoneType' object has no attribute 'shape'. Hi all! I need your help regarding the following code. My goal is to read and show the video with a resolution modification. cap = cv2.VideoCapture("C:/Users/user/Desktop/Foot_Detection/ball_tracking_example.mp4") def rescale_frame(frame, percent=30): width = int(frame.shape[1] * percent/ 100) height = int(frame.shape[0] * percent/ 100) dim = (width, height) return cv2.resize(frame, dim, interpolation =cv2.INTER_AREA)