这种问题一般cv2下有红色波浪线,解决方法:

  1. On VScode: CTRL + Shift + P
  2. Choose "Preferences: Open Settings (JSON)"
  3. Add this line into JSON file:
    ​"python.linting.pylintArgs": ["--generate-members"]​
  4. Done, it works for me