2015-10-06 23 views

risposta

38

È possibile utilizzare rows e cols:

cout << "Width : " << src.cols << endl; 
cout << "Height: " << src.rows << endl; 

o size():

cout << "Width : " << src.size().width << endl; 
cout << "Height: " << src.size().height << endl; 
13

Anche per OpenCV in python si può fare:

img = cv2.imread('myImage.jpg') 
height, width, channels = img.shape 
+0

Buono, ma OP chiede C++ – Petruza

+0

Sì, questo è vero ma la ricerca su google per Python porta tu qui. – imoutidi

Problemi correlati