You can use cv2.resize. Documentation here: http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html#resize
In your case, if the input image im is a numpy array:
maxsize = (1024,1024)
imRes = cv2.resize(im,maxsize,interpolation=cv2.CV_INTER_AREA)
(INTER_CUBIC, INTER_NEAREST, INTER_AREA,...), , , CV_INTER_AREA.