Commit eb6bf2d6 authored by Grégoire PETIT's avatar Grégoire PETIT
Browse files

clean up

parent 3e6e953d
......@@ -41,53 +41,6 @@ def getAltXY(pixel):
return(getAltitude(rgbValues))
"""# -*- coding: utf-8 -*-
from PIL import Image
import numpy as np
import mpl_toolkits.mplot3d
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from math import atan, pi
from matplotlib import pyplot
#input_filename_altitude="D:/documents/IMT/datascience/challenge3/moodle/elevation1x1_new-mer-bleue_deforme.bmp"
input_filename_altitude="../moodle/elevation1x1_new-mer-bleue_deforme.bmp"
im_alt = Image.open(input_filename_altitude)
#input_filename_poputation="D:/documents/IMT/datascience/challenge3/moodle/population-density-map.bmp"
input_filename_poputation="../moodle/population-density-map.bmp"
im_pop = Image.open(input_filename_poputation)
# This modules gives useful informations
width=im_alt.size[0]
heigth=im_alt.size[1]
print("width = ",width)
print("heigth = ", heigth)
# To plot an histogram
pix_mont_blanc=im_alt.getpixel((1573,1593))
pix_sea_level=im_alt.getpixel((929,1666))
pix_sea=im_alt.getpixel((1,1))
print(pix_sea,pix_sea_level,pix_mont_blanc) #rgb
def getAltitude(rgbValues):
if rgbValues==(255,255,255):
res=0 #il y aura un effet sur les bord de la carte car sur la jonction les pixels ne sont pas parfaitement blanc
else:
R,G,B=rgbValues
res=4810/7921*(G-186)**2
return(res)
def getAltXY(pixel):
'''Permet d'avoir l'altitude réelle pour un pixel'''
rgbValues=im_alt.getpixel(pixel)
# print("rgbValues = ", rgbValues)
return(getAltitude(rgbValues))"""
def getPopXY(pixel):
'''Permet d'avoir la population réelle pour un pixel'''
pop_max=3000
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment