For those who like, I will introduce how to build a Python integrated development environment called Canopy and an example of its use. It is very easy compared to building a C ++ & openCV environment using Visual studio etc. It is mainly aimed at students to faculty and staff (I will talk on the premise of an academic account). Also, I have introduced an example of building on Mac, but I think that there is not much difference on other platforms. For Linux and Windows Please read around the path setting appropriately.
If you have a college email account like ***. Ac.jp, you can open an academic account with Canopy and get over 200 pre-build packages for free. If you do not have a university account, http://www.iu-tokyo.ac.jp/edu/entra/ http://www.i.kyoto-u.ac.jp/admission/guide.html Please refer to.
In most cases yes is fine, but if you want or are creating a python development environment with Vim or Emacs, http://stackoverflow.com/questions/19617936/importerror-no-module-named-site-vim- and-enthought-canopy There is a problem that I get angry with an error around here.
If you don't want to use such a GUI! I want to do my best on the terminal, use enpkg. I am exclusively an enpkg sect.
You can search for packages with + -s.
Canopy itself has a console editor, and development is possible by itself, but here, let's use iPython notebook, which is the web-based development environment of iPython.
ipython notebook
on the terminal↓
Finally, let's briefly try out the features of openCV.
`cv2.VideoCapture (0)`
will connect to the 0th connected camera. If you specify a video file here, that video will be loaded.`cap.read ()`
to capture the image and imshow to spit it out. In the above inline environment, the video does not play well, so here we will use the osx environment.`plt.draw ()`
, the image will be updated interactively for the first time (easy to forget)Here, we will try the famous Viola & Jones cascading face detection.
In addition to openCV, Python has a package called scikit image, which has a method that is not implemented in openCV. For more information http://scikit-image.org/docs/dev/auto_examples/index.html
`skimage.io.ImageCollection``` reads the image group that matches the argument as a list. For example, if you execute ```img = ImageCollection ('img * .png')
`on the directory where img0.png, img1.png, ... img10.png is located, the i-th element will be the i-th. A list containing the images of is created.`skimage.segmentation.slic``` is one of the image segmentation methods, and it is possible to divide the image into several superpixels as shown above. I can do it.
`mark_boundaries``` is a function to draw it.Recommended Posts