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()
  • 相关阅读:
    Hibernate使用固定值关联表
    使用spring-data-JPA调用存储过程
    angularjs动态添加节点时,绑定到$scope中
    JPA子查询
    表格表头固定的一种实现方式
    Unicode、UTF8与UTF16
    primefaces4.0基本教程以及增删改查
    tomcat发布webservice
    KonBoot – 只要5K映象文件轻易绕过您的WindowsXP/VISTA/7系统的密码
    Setting .xap MIME Type for Silverlight
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/6394014.html
Copyright © 2011-2022 走看看