//create a new image, not just the headers.. Mat transposedFrame(Size(image_width, image_height), image.type()); Mat rotatedFrame(Size(image_width, image_height), image.type());