2016年1月4日 星期一

SimpleCV tutorial basics


1.   loading and saving Images


    load image :  logo = Image("simplecv")

   show image : logo.show()

    save image :  logo.save("out.jpg")

    you also would specify the path : logo.save("/path/out.jpg")

    you could get image from camera module

    cam = camera()

    grab an image from camera

    img = cam.getImage()

 2. Image Manipulation 

   image scale   :  thumbnail = img.scale(90,90)
 
   image erode  :  eroded =  img.erode()
                            eroded.show()
   image crop   :  img.crop(100,100,50,50)

                           start coord : (100,100), (width, height) : (50,50)
 

3.  Feature

   


Reference http://tutorial.simplecv.org/en/latest/examples/basics.html

how to install SimpleCV on Raspberry


Step 1: 檢查更新套件

            sudo apt-get update 
            sudo apt-get upgrade

Step 2:

         安裝必要的套件

         sudo apt-get install ipython python-opencv python-scipy python-numpy python-setuptools python-pip

Step 3 :
        use  git 去 安裝

       sudo pip install https://github.com/sightmachine/SimpleCV/zipball/master

 Step 4 :  筆者安裝到這邊後...測試SimpleCV 會有 error message...把 error message 丟到 google查                 到原來是少安裝了 svgwrite.....in <module>
 
        import svgwrite
       ImportError: No module named svgwrite

        補安裝  svgwrite 就好了
sudo pip install svgwrite
       
Reference /HOWTO-Install simpleCV on RaspberryPi