
Recherche avancée
Médias (2)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (105)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Problèmes fréquents
10 mars 2010, parPHP et safe_mode activé
Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site -
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
Vous pouvez personnaliser le formulaire de création d’un éditorial.
Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)
Sur d’autres sites (10891)
-
Evolution #2269 : Prise en compte des variantes d’une langue
8 septembre 2015, par Valéry -Notons au passage que ceci implique que #LANG donne un tag de langue complet incluant le subtag région
Celui-ci est au passage exigé par le protocole OpenGraph :
og:locale - The locale these tags are marked up in. Of the format language_TERRITORY. Default is en_US.
-
Video from images in Python
26 février 2018, par R. PattersonI can draw a series of images using plt.draw() and plt.pause() so it produces something similar to an animation in the python window. I have modified each of the images with various labels, drawings etc.
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import math
def display(Intensity):
l = plt.Line2D(Intensity[0],Intensity[1],color='yellow') #draw ROI/IAL
ax = plt.gca()
ax.add_line(l)
plt.axis('off')
plt.pause(0.05)
plt.draw()
plt.clf()
#rotate region of interest
def rotate(origin,Intensity,increment):
ox, oy = origin #coordinates of centre or rotation
x_points=[]
y_points=[]
angle=math.radians(increment)#change in angle between each image
for i in range(0,len(Intensity[0])):
px, py = Intensity[0][i], Intensity[1][i]
qx = ox+math.cos(angle)*(px-ox)-math.sin(angle)*(py-oy)
x_points.append(qx)
qy = oy+math.sin(angle)*(px-ox)+math.cos(angle)*(py-oy)
y_points.append(qy)
rotatecoordinates=[]
rotatecoordinates.append(x_points)
rotatecoordinates.append(y_points)
return rotatecoordinates
def animation(list, Intensity):
inc=0
for value in list:
item = np.array(value)
rotated=rotate([128,128],Intensity,inc)
im=plt.imshow(item, interpolation='nearest')
display(rotated)
inc+=1
Image_list=[]
for i in range(0,50):
array=np.linspace(0,1,256*256)
mat=np.reshape(array,(256,256))
img=Image.fromarray(np.uint8(mat*255),'L') #create images
Image_list.append(img)
myROI=([100,150,150,100,100],[100,100,150,150,100]) #region of interest on image
animation(Image_list,myROI)I would like to produce a video file using the images produced. I can’t use the module imageio, imagemagick, opencv, cv2 etc. I think ffmpeg would work, I have the following code.
def save():
os.system("ffmpeg -r 1 -i img%01d.png -vcodec mpeg4 -y movie.mp4")I don’t understand how to use it in relation to the code I already have. It doesn’t take any arguments, how would I relate it to the images I have ? I know how to use imagej/fiji to produce videos from images but I would like to do this in python and also it runs out of memory (I have a lot of images, over 2000). Any help would be appreciated, thank you.
-
Revision 31957 : légère amélioration ... Un peu de documentation dans le code également
7 octobre 2009, par kent1@… — Loglégère amélioration ...
Un peu de documentation dans le code également