How to determine NoneTpye in python
Recently used python-opencv to parse multiple video files, and parsed to the last frame of the first video, and an error occurredNoneTpye
In order To continue the loop, you need to determine whether the parsed image is NoneType.
Tried several methods
# 第一种方法
img == None
The expression is True when img is empty. But when img parses the image, an array is returned with the same size as img.
correct way to write
img is None
Just use is None to determine NoneType. When img is not empty, returns False. When img is empty, returns True.