zoukankan      html  css  js  c++  java
  • I.MX6 Python3 OpenCV

    /*************************************************************************
     *                     I.MX6 Python3 OpenCV
     * 说明:
     *     移植一下OpenCV,看一下图像处理效果,目前感觉还行了,应该是不错的了。
     *
     *                                   2017-2-14 深圳 南山平山村 曾剑锋
     ************************************************************************/
    
    一、 参考文档:
        1. OpenCV Python教程(1、图像的载入、显示和保存)  
            http://blog.csdn.net/sunny2038/article/details/9057415
    
    二、图片获取、处理:
        [zengjf@root ~] # python 
        Python 3.5.2 (default, Jan 11 2017, 02:27:29) 
        [GCC 4.8.3 20140320 (prerelease)] on linux
        Type "help", "copyright", "credits" or "license" for more information.
        >>> import cv2 as cv
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ImportError: No module named 'cv2'
        [zengjf@root ~] # find / -iname cv2*
        /usr/lib/python3.5/site-packages/cv2.cpython-35m-x86_64-linux-gnu.so
        [zengjf@root ~] # mv /usr/lib/python3.5/site-packages/cv2.cpython-35m-x86_64-linux-gnu.so /usr/lib/python3.5/site-packages/cv2.so
        [zengjf@root ~] # fswebcam -d /dev/video1 --no-banner -r 640x480 zengjf.jpg
        --- Opening /dev/video1...
        Trying source module v4l2...
        /dev/video1 opened.
        No input was specified, using the first.
        --- Capturing frame...
        Captured frame in 0.00 seconds.
        --- Processing captured image...
        Disabling banner.
        Writing JPEG image to 'zengjf.jpg'.
        [zengjf@root ~] # python 
        Python 3.5.2 (default, Jan 11 2017, 02:27:29) 
        [GCC 4.8.3 20140320 (prerelease)] on linux
        Type "help", "copyright", "credits" or "license" for more information.
        >>> import cv2  
        >>> cv2.__version__
        '3.1.0'
        >>> img = cv2.imread("./zengjf.jpg")
        >>> cv2.imwrite("./zengjf1.jpg", img, [int(cv2.IMWRITE_JPEG_QUALITY), 5]) 
        True
        >>> quit()
  • 相关阅读:
    浅析ES6中的iterator
    nodejs中的异步回调机制
    用好js与nodejs中的try...catch
    vscode设置html默认浏览器
    nodejs中相互引用(循环引用)的模块分析
    ES6—带默认值的函数参数及其作用域
    函数声明与函数表达式的区别
    let块级引起的闭包思考
    进程与线程
    angular(^4)-监控表格按键行为的问题
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/6394014.html
Copyright © 2011-2022 走看看