对象没有属性 'NamedWindow'

object has no attribute 'NamedWindow'

import cv2 as cv
cv.NamedWindow("window_a", cv.CV_WINDOW_AUTOSIZE)

AttributeError: 'module' object has no attribute 'NamedWindow'

这个函数在 OpenCV 3 中的模拟是什么?

阅读 doc and check the tutorials:

cv2.namedWindow('name')

By default, the flag is cv2.WINDOW_AUTOSIZE. But if you specify flag to be cv2.WINDOW_NORMAL, you can resize window.