



Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!




1.- Busque una imagen con mucha o con muy poca luz, e intente corregirla con la función adjust_gamma, deberá presentar por lo menos tres imágenes con la corrección e indicar cuál es la imagen conla mejor corrección.
from skimage import exposure from skimage import io from pylab import * import numpy as np import matplotlib.pyplot as pp def CorrectionGama(): imagen = io.imread("/content/Felipe de Jesus Medina Rodriguez/naranj a.jpg") gama_corrected1 = exposure.adjust_gamma(imagen, 5 ) gama_corrected2 = exposure.adjust_gamma(imagen, 10 ) pp.figure( 0 ) io.imshow(imagen) pp.figure( 1 ) io.imshow(gama_corrected1) pp.figure( 2 ) io.imshow(gama_corrected2) CorrectionGama()
from skimage import io from pylab import * from skimage.transform import resize
#Punto from pylab import * import matplotlib.pyplot as pp from skimage import exposure from skimage import io import cv imagen = io.imread("/content/Felipe de Jesus Medina Rodriguez/naranja. jpg") letra = int(input('\n¿Que tipo de letra quiere utilizar? \n1) COMPLEX SMALL \n2) COMPLEX \n3) SCRIPT SIMPLEX \n4) ITALIC \nTIPO DE LETRA ELE GIDA: ')) color = int(input('\n¿Que color quiere utilizar? \n1) NEGRO \n2) BLAN CO 5 \n3) AZUL REY \n4) ROJO \nTIPO DE COLOR ELEGIDO: '))
texto1= input('\nIntroduce tu texto: ') if color == 1 : r = int( 0 ) g = int( 0 ) b = int( 0 ) elif color == 2 : r = int( 255 ) g = int( 255 ) b = int( 255 ) elif color == 3 : r = int( 0 ) g = int( 0 ) b = int( 255 ) elif color == 4 : r = int( 255 ) g = int( 0 ) b = int( 26 ) print('\nCoordenadas: ', imagen.shape) x = int(input('\nGenerador de Coordenadas: \nIngresa valor de X: ')) y = int(input('Ingresa valor de y: ')) ancho = imagen.shape[ 0 ] alto = imagen.shape[ 1 ] if x > ancho or y > alto: print('\nTe saliste del rango') else: if letra == 1 : cv2.FONT_HERSHEY_COMPLEX_SMALL elif letra == 2 : cv2.FONT_HERSHEY_COMPLEX elif letra == 3 : cv2.FONT_HERSHEY_SCRIPT_COMPLEX elif letra == 4 : cv2.FONT_ITALIC cv2.putText(imagen, texto1, (x,y), letra, 4.8,(r,g,b), 5 ,cv2.LINE_AA) io.imshow(imagen)