-
-
Save parzibyte/30669779cffa3d0cc1d591023717f3af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Vamos a recorrer una mini matriz en la caja | |
inicio_y = y-1 | |
inicio_x = x-1 | |
fin_y = y+1 | |
fin_x = x+1 | |
if inicio_y < 0: | |
inicio_y = 0 | |
if inicio_x < 0: | |
inicio_x = 0 | |
if fin_x >= ancho: | |
fin_x = ancho - 1 | |
if fin_y >= alto: | |
fin_y = alto - 1 | |
suma_red = 0 | |
suma_green = 0 | |
suma_blue = 0 | |
conteo = 0 | |
while inicio_y <= fin_y: | |
indice_x = inicio_x | |
while indice_x <= fin_x: | |
# Aquí calculamos el promedio | |
indice_x += 1 | |
conteo += 1 | |
inicio_y += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment