Raspberry Pi OpenCV, Which is used on Raspberry Pi

Source: Internet
Author: User
About Raspberry Pi:

Raspberry Pi is a Linux-based PC equipped with a 256 MHz processor, memory, SD card and Ethernet support. It has two USB interfaces and supports HDMI and RCA output. It is reported that although the Raspberry Pi looks very mini-it only has one credit card, it can run games like thunder hammer 3: arena and play P videos. The hardware foundation is
ARM is an open-source Linux operating system. Its built-in Iceweasel, KOffice, and other software can meet basic network browsing, text processing, and computer learning needs.

(For more information, see Phodal's blog)

Before getting started

Use raspberrypi properly by referring to your known manual or guide. You also need a camera.

It is based on 2013-02-09-wheezy-raspbian. That is to say, Raspbian is used Based On debian. Install opencv
sudo apt-get updatesudo apt-get install libopencv-dev 
sudo apt-get install python-opencv
Test
import wxfrom opencv.cv import *from opencv.highgui import * class MyFrame(wx.Frame):    def __init__(self):        wx.Frame.__init__(self, None, -1, 'camera')        self.SetClientSize((640, 480))         self.cap = cvCreateCameraCapture(0)        self.Bind(wx.EVT_IDLE, self.onIdle)     def onIdle(self, event):        img = cvQueryFrame(self.cap)        self.displayImage(img)        event.RequestMore()     def displayImage(self, img, offset=(0,0)):        bitmap = wx.BitmapFromBuffer(img.width, img.height, img.imageData)        dc = wx.ClientDC(self)        dc.DrawBitmap(bitmap, offset[0], offset[1], False) if __name__=="__main__":    app = wx.App()    frame = MyFrame()    frame.Show(True)    app.MainLoop()

Source: http://www.phodal.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.