
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (91)
-
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (3547)
-
My webcam works fine, while using cv2.Videocapture() but while trying to read from hard drive it shows error cap.isOpened() returns false, why ?
27 septembre 2017, par Hu Yangimport cv2
video_capture = cv2.VideoCapture("rtsp ://admin:Trust1986_@10.58.94.47:554/h264/ch1/main/av_stream")
video_capture.isOpened()False
Other information below here, and ffmpeg I had installed.
Video I/O:
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: NO
avcodec: NO
avformat: NO
avutil: NO
swscale: NO
avresample: NO
GStreamer: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
OpenNI2: NO
PvAPI: NO
GigEVisionSDK: NO
Aravis SDK: NO
UniCap: NO
UniCap ucil: NO
V4L/V4L2: NO/NO
XIMEA: NO
Xine: NO
Intel Media SDK: NO
gPhoto2: NO
root@ubuntu:/home/face_recognition/opencv/ffmpeg/ffmpeg-3.3.4# ffmpeg -version
ffmpeg version 3.3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration:
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
root@ubuntu:/home/face_recognition/opencv/ffmpeg/ffmpeg-3.3.4#
root@ubuntu:/home/face_recognition/opencv/ffmpeg/ffmpeg-3.3.4# python3.6m -V
Python 3.6.2
root@ubuntu:/home/face_recognition/opencv/ffmpeg/ffmpeg-3.3.4# pkg-config --modversion opencv
3.3.0what shall I do next step ? Thanks.
-
OpenCV (3.3.0) returns fail on VideoCapture with Video but works with Webcam [OS X]
1er novembre 2017, par njoyeThanks for reading already, I’ve been trying to get this to work for a day and I didn’t get closer to the solution.
I’m trying to get this object tracker to work. When I use a video from my webcam (with :
python object-tracker-single.py -d 0
, everything works as expected.But as soon as I’m trying to use a video file (i’ve tried different formats :
.mp4
,.mkv
&.avi
. I also tried to use the file given in the repository, that didn’t work as well. To see if there is aFile not found
-Error, I passed an invalid path to the function and an error got printed, that has not been printed when I used the other videos. So the file(s) i’m using is(/are) valid and not corrupted.I installed
dlib
throughhomebrew
following this article and compiledOpenCV
from the official source. This is the CMakeCache.txt thatCMake
spit out. After the first time I compiled it, I added opencv_contrib to the mix, thinking that it could help (I also think that I actually needed it), but that didn’t fix the problem.This is the code I’m having problems with :
# Create the VideoCapture object
cam = cv2.VideoCapture(source)
# If Camera Device is not opened, exit the program
if not cam.isOpened():
print "Video device or file couldn't be opened"
exit()
print "Press key `p` to pause the video to start tracking"
while True:
# Retrieve an image and Display it.
retval, img = cam.read() #<-- this returns false when trying to read a video
if not retval:
print "Cannot capture frame device"
exit()At the marked line,
retval
equalsFalse
andimage
equalsNone
.
It would already help me if I could somehow debug this behavior, but I didn’t find any way of doing so.I found that many Windows Users had problems with missing
ffmpeg
support, but that is not the case for me, since I usedffmpeg
in previous (not OpenCV-related) projects andCMakeCache.txt
reports thatffmpeg
has been found and the compilation succeeded.I also tried using a fully qualified file-name for the video file, which either resulted in
Video device or file couldn't be opened
or the given problem.If you have any idea how this problem can be completely resolved, have an Idea on how to solve it or can provide me with a way of properly debugging this behavior, I’d be super glad to here it !
Thanks already !
-
System : MacBook Pro (macOS Sierra
10.12.6
)OpenCV Version :
3.3.0
Dlib Version (not necessary imo, but hey) :
19.4.0
Edit 2
Output ofcmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-master/modules ../ >> result.txt
: pastebin -
Matplotlib : Live animation works fine but displays a blank plot when being saved
18 juillet 2017, par Loïc PoncinI made a little forest fire animation. My code is at the end of the question.
Here is some information before I ask my question :
- No tree :
forest[i,j] = 0
- A tree :
forest[i,j] = 1
- A tree on fire :
forest[i,j] = 2
Basically what happens is that
constructforest
creates a 2 dimensional array calledforest
of size n by m with a probability of tree occupancy called p. After thatsetonfire
sets on fire theforest
and while theforest
can burnspreadfire
spread the fire.When I run
forestfire
with thePython prompt
or theIPython prompt
I get a nice animation but when I go check the video file that I saved I only see a blank plot.I did some research, I found many questions about this issue but none of the advice I read was helpful :
- matplotlib animation produces a blank
- Matplotlib animation not working in IPython Notebook (blank plot)
- Animation from matplotlib not working in spyder
- Spyder Python Animation not working
Can someone tell me what is going on please ?
forestfire.py
from random import random
import numpy as np
import matplotlib.pylab as plt
import matplotlib.colors as mcolors
import matplotlib.animation as animation
def hazard(p):
r=random()
assert p>=0 and p<=1
return r <= p
def constructforest(n,m,p):
forest = np.zeros((n,n))
for i in xrange(n):
for j in xrange(m):
if hazard(p):
forest[i,j] = 1
return forest
def setfire(forest,i,j):
forest[i,j] = 2
return forest
def spreadfire(forest):
n,m=forest.shape
c = np.copy(forest)
for i in xrange(n):
for j in xrange(m):
if c[i,j] == 1:
Y, X = xrange(max(0,i-1),min(n,i+2)), xrange(max(0,j-1),min(m,j+2))
for y in Y:
for x in X:
if c[y,x] == 2:
forest[i,j] = 2
return forest
def canburn(forest):
n,m=forest.shape
c = np.copy(forest)
for i in xrange(n):
for j in xrange(m):
if c[i,j] == 1:
Y, X = xrange(max(0,i-1),min(n,i+2)), xrange(max(0,j-1),min(m,j+2))
for y in Y:
for x in X:
if c[y,x] == 2:
return True
return False
def forestfire(forest):
fig, ax = plt.subplots()
movie = []
# Colormap
red, green, blue = [(1,0,0,1)], [(0,1,0,1)], [(0,0,1,1)]
colors = np.vstack((blue, green, red))
mycmap = mcolors.LinearSegmentedColormap.from_list('my_colormap', colors)
# Initialization
k = 0
forest = spreadfire(forest)
im = plt.imshow(forest, animated=True, cmap = mycmap, interpolation="none", origin='lower')
movie.append([im])
# Fire propagation
while canburn(forest):
k += 1
print k
forest = spreadfire(forest)
im = plt.imshow(forest, animated=True, cmap = mycmap, interpolation="none", origin='lower')
movie.append([im])
return animation.ArtistAnimation(fig, movie, blit=True, repeat_delay=100)
ani = forestfire(setfire(constructforest(101,101,0.4),50,50))
ani.save("forestfire_test.mp4", writer = 'ffmpeg', fps=5, dpi=500)EDIT
As requested by @Y.Luo by @ImportanceOfBeingErnest in the comments I downgraded matplotlib to 2.0.0 and I changed the framerate of the animation but
forestfire_test.mp4
still displays a blank plot. - No tree :