Search code examples
pythonopencvsize

Image size (Python, OpenCV)


I would like to get the Image size in python,as I do it with c++.

int w = src->width;
printf("%d", 'w');

Solution

  • Use the function GetSize from the module cv with your image as parameter. It returns width, height as a tuple with 2 elements:

    width, height = cv.GetSize(src)