以下生成一个红色图像的是:
A. img = np.zeros((300,300,3), dtype = "uint8") img[:,:,2] = 255
B. img = np.zeros((300,300,3), dtype = "uint8") img[:,:,1] = 255
C. img = np.zeros((300,300,3), dtype = "uint8") img[:,:,0] = 255
D. img = np.zeros((300,300,3), dtype = "uint8") img[:,:,2] = 1
以下代码,哪个是画一个白色正方形
A. cv2.rectangle(img,(50,50),(100,200),(255,255,255),2)
B. cv2.rectangle(img,(50,50),(100,200),(0,0,0),2)
C. cv2.rectangle(img,(50,50),(100,100),(255,255,255),2)
D. cv2.rectangle(img,(50,50),(100,100),(0,0,0),2)
对于一个高300,宽400的图像,右上角的坐标是:
A. (0,400)
B. (0,399)
C. (400,0)
D. (399,0)
对于一个400行,600列的图像img,以下代码截取右上角1/4窗口的是:
A. img[0:200,-300:-1,:]
B. img[0:200,-300:-1,3]
C. img[0:200,0:300,:]
D. img[0:200,0:300,3]