Generation

generate functionSun, 21 May 2023

Ecrire un programme pour faire une rotation d'une image de 180° d'une image appelée pomme.jpg

import cv2 import numpy as np image = cv2.imread('pomme.jpg') height, width = image.shape[:2] rotation_matrix = cv2.getRotationMatrix2D((width/2, height/2), 180, 1) rotated_image = cv2.warpAffine(image, rotation_matrix, (width, height)) cv2.imshow('Rotated Image', rotated_image) cv2.waitKey() cv2.destroyAllWindows()

Questions about programming?Chat with your personal AI assistant