[vc_row][vc_column width=”1/1″][vc_column_text]We can achieved many features easily by using “SimpleCV” library-related functions. How to install SimpleCV please refer to http://learn.linksprite.com/pcduino/linux-applications/run-simplecv-on-pcduino/
Now, The below picture will be used as source image and we will use it to achieve some examples.
[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”Flip Picture 270°” tab_id=”1394412403-1-80″][vc_column_text]
rom SimpleCV import * myDisplay = Display() pcDuinoImage = Image("pcDuino.jpg") while myDisplay.isNotDone(): if myDisplay.mouseLeft : break rotated = pcDuinoImage.rotate(270) rotated.show()
[/vc_column_text][/vc_tab][vc_tab title=”Cut Picture” tab_id=”1394412403-2-87″][vc_column_text]
from SimpleCV import * myDisplay = Display() pcDuinoImage = Image("pcDuino.jpg") while myDisplay.isNotDone(): if myDisplay.mouseLeft : break warped = pcDuinoImage.warp( ((100,0), (300,0), (450,400), (0,400)) ) warped.show()
[/vc_column_text][/vc_tab][vc_tab title=”Film Effects” tab_id=”1394415746167-2-0″][vc_column_text]Code:
from SimpleCV import * myDisplay = Display() pcDuinoImage = Image("pcDuino.jpg") while myDisplay.isNotDone(): if myDisplay.mouseLeft : break inverted = pcDuinoImage.invert() inverted.show()
[/vc_column_text][/vc_tab][vc_tab title=”Add your favorite string on picture” tab_id=”1394415911123-3-3″][vc_column_text]Code
from SimpleCV import Image,Display,DrawingLayer,Color from time import time,sleep myDisplay = Display() pcDuinoImage = Image("pcDuino.jpg") myDrawingLayer = DrawingLayer((pcDuinoImage.width,pcDuinoImage.height)) myDrawingLayer.setFontSize(50) myDrawingLayer.setFontItalic(True) myDrawingLayer.text("MiNi PC + Arduino !",(10,20),color=Color.BLACK) pcDuinoImage.addDrawingLayer(myDrawingLayer) pcDuinoImage.applyLayers() myDrawingLayer.setFontSize(50) myDrawingLayer.setFontItalic(True) myDrawingLayer.text("pcDuino",(70,70),color=Color.BLACK) pcDuinoImage.addDrawingLayer(myDrawingLayer) pcDuinoImage.applyLayers() myDrawingLayer.rectangle ((430,570),(600,600),color=Color.RED,filled=True) myDrawingLayer.setFontSize(30) myDrawingLayer.setFontItalic(False) myDrawingLayer.text("www.pcduino.org",(430,570),color=Color.WHITE) pcDuinoImage.addDrawingLayer(myDrawingLayer) pcDuinoImage.applyLayers() pcDuinoImage.save(myDisplay) while not myDisplay.isDone() : sleep(0.2)
[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.