OVH Cloud OVH Cloud

macOS Sierra, visualiser la direction d'une photo sur une carte ?

54 réponses
Avatar
Une Bévue
avec l'iPhone 6, les données GPS incluent la direction de prise de vue
(compas), existe t'il un logiciel permettant de montrer cette direction
(et donc pas seulement le point d'où a été prsie la photo) ?

exemple :
$ exiftool '/Users/yt/Downloads/IMG_3130.JPG'
ExifTool Version Number : 10.20

[...]

Make : Apple
Camera Model Name : iPhone 6

[...]

GPS Latitude Ref : North
GPS Longitude Ref : West
GPS Altitude Ref : Above Sea Level
GPS Time Stamp : 07:11:21
GPS Speed Ref : km/h
GPS Speed : 0
GPS Img Direction Ref : True North
GPS Img Direction : 312.9102564
GPS Dest Bearing Ref : True North
GPS Dest Bearing : 312.9102564
GPS Date Stamp : 2016:12:06
GPS Horizontal Positioning Error: 65 m

[...]

GPS Altitude : 26.6 m Above Sea Level
GPS Date/Time : 2016:12:06 07:11:21Z
GPS Latitude : 55 deg 55' 15.39" N
GPS Longitude : 4 deg 28' 44.01" W
GPS Position : 55 deg 55' 15.39" N, 4 deg 28' 44.01" W

[...]

10 réponses

2 3 4 5 6
Avatar
g4fleurot
Une Bévue nous a gratifié de cette remarque bienvenue :
(c'est marrant "plus un" est l'appelation d'un analyste disons chevronné
en cartel lacanien...)

Remarque intéressante. Je ne connaissais pas cette notion et j'ai fait
une recherche lacan plus un
Mais dans le contexte de ce fil, je me verrai plutôt en candide.
J'ai essayé MacPort et Homebrew et je n'arrive pas à faire marcher quoi
que ce soit.
J'ai même téléchargé le v0.14.3, mais je ne sais pas quoi en faire...
<https://github.com/SciTools/cartopy/tags>
--
Gérard FLEUROT plus un
Avatar
Une Bévue
Le 01/01/2017 à 15:02, Julien Salort a écrit :
Dans le code, il faut remplacer le "import EXIF" par:
import exifread as EXIF

OK, j'avais déja installé exifread.
il m'a fallu aussi installer :
Pillow pour PIL
puis
spicy
mais ça se passe mal :
.-[:~]-[17-01-01 17:51:20]
'->$ bin/python/map_direction.py
/usr/local/lib/python2.7/site-packages/matplotlib/font_manager.py:273:
UserWarning: Matplotlib is building the font cache using fc-list. This
may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list.
This may take a moment.')
Opening file /Users/yt/Downloads/IMG_3130.JPG
GPS GPSDate : 2016:12:06
GPS GPSDestBearingRef : T
GPS GPSLatitudeRef : N
GPS GPSAltitudeRef : 0
GPS GPSSpeed : 0
GPS GPSLongitude : [4, 28, 4401/100]
GPS GPSSpeedRef : K
GPS GPSDestBearing : 24407/78
Image GPSInfo : 1610
GPS GPSImgDirectionRef : T
GPS GPSLatitude : [55, 55, 1539/100]
GPS GPSTimeStamp : [7, 11, 21]
GPS GPSImgDirection : 24407/78
GPS GPSLongitudeRef : W
GPS Tag 0x001F : 65
GPS GPSAltitude : 2587/97
extent = [-4.503891666666667, -4.453891666666666, 55.90844166666666,
55.93344166666667]
fish: 'bin/python/map_direction.py' terminated by signal SIGSEGV
(Address boundary error)
^^^^^^^^^^^^^^^^^^^^^^^^_____ ???
les données lues me semblent bonnes.
(quand on prend la pein d'effectuer les divisions)
Avatar
Une Bévue
Le 01/01/2017 à 16:17, Fleuger a écrit :
J'ai essayé MacPort et Homebrew et je n'arrive pas à faire marcher quoi
que ce soit.
J'ai même téléchargé le v0.14.3, mais je ne sais pas quoi en faire...
<https://github.com/SciTools/cartopy/tags>

ben moi, j'y suis parvenu à partir de brew.
pour EXIF il faut installer ExifRead
et comme indiqué par Julien Salort changer :
#import EXIF
en :
import exifread as EXIF
pour cartopy, j'ai utilisé :
Installing Cartopy on Mac OSX (10.11)
<http://louistiao.me/posts/installing-cartopy-on-mac-osx-1011/>
la ligne :
pip install --global-option=build_ext --global-option=$(pkg-config
--cflags proj) cartopy
après avoir installé, par brew :
brew install geos
brew install proj
par pip :
pip install cython
pip install numpy
ensuite, il manquait quand même des choses :
PIL, qui s'installe par :
pip install Pillow
et enfin spicy :
pip install scipy
Mais, malheureusement, si mon image est bien lue, correctement semble
t'il, à la fin, ça PLANTE :
$ bin/python/map_direction.py

/usr/local/lib/python2.7/site-packages/matplotlib/font_manager.py:273:
UserWarning: Matplotlib is building the font cache using fc-list. This
may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list.
This may take a moment.')
Opening file /Users/yt/Downloads/IMG_3130.JPG
GPS GPSDate : 2016:12:06
GPS GPSDestBearingRef : T
GPS GPSLatitudeRef : N
GPS GPSAltitudeRef : 0
GPS GPSSpeed : 0
GPS GPSLongitude : [4, 28, 4401/100]
GPS GPSSpeedRef : K
GPS GPSDestBearing : 24407/78
Image GPSInfo : 1610
GPS GPSImgDirectionRef : T
GPS GPSLatitude : [55, 55, 1539/100]
GPS GPSTimeStamp : [7, 11, 21]
GPS GPSImgDirection : 24407/78
GPS GPSLongitudeRef : W
GPS Tag 0x001F : 65
GPS GPSAltitude : 2587/97
extent = [-4.503891666666667, -4.453891666666666, 55.90844166666666,
55.93344166666667]
fish: 'bin/python/map_direction.py' terminated by signal SIGSEGV
(Address boundary error)
vouli voulou...
Avatar
lists
Une Bévue wrote:
il m'a fallu aussi installer :
Pillow pour PIL

OK.
puis
spicy

Tu veux dire scipy ?
mais ça se passe mal :

[...]
extent = [-4.503891666666667, -4.453891666666666, 55.90844166666666,
55.93344166666667]
fish: 'bin/python/map_direction.py' terminated by signal SIGSEGV
(Address boundary error)
^^^^^^^^^^^^^^^^^^^^^^^^_____ ???
les données lues me semblent bonnes.
(quand on prend la pein d'effectuer les divisions)

Effectivement, je ne sais pas trop d'où peut venir cette erreur. Mais
j'ai envie de suspecter un soucis dans l'installation des bibliothèques.
C'est pas une erreur Python mais carrément une erreur de segmentation
que tu as.
Est-ce que les autres bibliothèques, notamment matplotlib fonctionnent
correctement, i.e. que se passe-t-il si tu fais:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0.0, 2*np.pi, 100)
y = np.cos(x)
plt.plot(x,y)
plt.show()
--
Julien Salort
Entia non sunt multiplicanda praeter necessitatem
http://www.juliensalort.org
Avatar
Une Bévue
Le 01/01/2017 à 18:17, Julien Salort a écrit :
Effectivement, je ne sais pas trop d'où peut venir cette erreur. Mais
j'ai envie de suspecter un soucis dans l'installation des bibliothèques.
C'est pas une erreur Python mais carrément une erreur de segmentation
que tu as.
Est-ce que les autres bibliothèques, notamment matplotlib fonctionnent
correctement, i.e. que se passe-t-il si tu fais:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0.0, 2*np.pi, 100)
y = np.cos(x)
plt.plot(x,y)
plt.show()

C'est zoli ;-)
<http://www.cjoint.com/doc/17_01/GAbsliXXDyV_17-01-01-19-09-29-map-direction-test.py-SUCCESS-on-mbp.png>
Avatar
Une Bévue
Le 01/01/2017 à 18:17, Julien Salort a écrit :
Tu veux dire scipy ?

oui, oui, je me gourate ))
Avatar
lists
Une Bévue wrote:
C'est zoli ;-)
<http://www.cjoint.com/doc/17_01/GAbsliXXDyV_17-01-01-19-09-29-map-directi
on-test.py-SUCCESS-on-mbp.png>

Ah donc matplotlib et numpy fonctionnent correctement.
Que donne cet exemple simplifié :
---8<------8<------8<------8<------8<------8<------8<------8<------8<------8<---
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER,
LATITUDE_FORMATTER
import cartopy.io.img_tiles as cimgt
extent = [6.007255555555555, 6.057255555555556, 47.24708611111111,
47.272086111111115]
projectionÌrs.Mercator()
fig, ax = plt.subplots(figsize=(9, 8),
subplot_kw=dict(projection=projection))
gl = ax.gridlines(draw_labels=True)
gl.xlabels_top = gl.ylabels_right = False
gl.xformatter = LONGITUDE_FORMATTER
gl.yformatter = LATITUDE_FORMATTER
request = cimgt.GoogleTiles()
#request = cimgt.OSM()
ax.set_extent(extent)
ax.add_image(request, 14)
plt.show()
---8<------8<------8<------8<------8<------8<------8<------8<------8<------8<---
--
Julien Salort
Entia non sunt multiplicanda praeter necessitatem
http://www.juliensalort.org
Avatar
Une Bévue
Le 01/01/2017 à 20:03, Julien Salort a écrit :
Ah donc matplotlib et numpy fonctionnent correctement.
Que donne cet exemple simplifié :

Une fenêtre apparaît et disparaît aussitôt, au term, j'ai :
$ ./map_direction_exemple_simplifie.py
/usr/local/lib/python2.7/site-packages/matplotlib/font_manager.py:273:
UserWarning: Matplotlib is building the font cache using fc-list. This
may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list.
This may take a moment.')
fish: './map_direction_exemple_simplif…' terminated by signal SIGSEGV
(Address boundary error)
donc idem ?
Avatar
Une Bévue
Le 28/12/2016 à 06:50, Une Bévue a écrit :
avec l'iPhone 6, les données GPS incluent la direction de prise de vue
(compas), existe t'il un logiciel permettant de montrer cette direction
(et donc pas seulement le point d'où a été prsie la photo) ?

ça roule avec OpenLayers3, fastoche à implémenter, résutat :
<http://www.cjoint.com/doc/17_01/GAcoVFoizkg_17-01-02-15-46-14-OpenLayers3-direction-on-mbp.png>
--------------------------------------------------------------------------------
iconStyle = new ol.style.Style({
image: new ol.style.Icon(({
rotateWithView: true,
rotation: deg2rad(center.direction),
anchor: [0.5, 22],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
size: [27, 27],
opacity: 0.75,
src: '/OpenLayers3/icons/direction_27x27.png'
}))
});
--------------------------------------------------------------------------------
center.direction est en degrés (ici environ 312 / Nord) qu'il faut
convertir en radians...
Avatar
lists
Une Bévue wrote:
Une fenêtre apparaît et disparaît aussitôt, au term, j'ai :
$ ./map_direction_exemple_simplifie.py
/usr/local/lib/python2.7/site-packages/matplotlib/font_manager.py:273:
UserWarning: Matplotlib is building the font cache using fc-list. This
may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list.
This may take a moment.')
fish: './map_direction_exemple_simplif…' terminated by signal SIGSEGV
(Address boundary error)
donc idem ?

Oui je le crains.
--
Julien Salort
Entia non sunt multiplicanda praeter necessitatem
http://www.juliensalort.org
2 3 4 5 6