擅长:python、mysql、java
<p>OpenCV有很好的python文档<a href="http://opencv.willowgarage.com/documentation/python/index.html" rel="nofollow">here</a>。基本上,您应该始终尝试使用这些内置的opencv函数或numpy对视频帧进行操作。对于帧处理,请看一看<a href="http://opencv.willowgarage.com/documentation/python/core_operations_on_arrays.html" rel="nofollow">operations on arrays</a>,使用它,您可以用像素替换整个像素处理循环,其速度非常慢:</p>
<pre><code>frameMat=cv.GetMat(frameImg)
print "mat ", mat[3,1]
for x in xrange(frameMat.cols):
for y in xrange(frameMat.rows):
# just an example, multiply all 3 components by 0.5
frameMat[y, x] = tuple(c*0.5 for c in frameMat[y, x])
cv.ShowImage( "My Video Window", frameMat )
</code></pre>
<p>有:</p>
^{pr2}$
<p>而且很容易实时播放,有很多很酷的功能可以让你合并视频等</p>