1. Lab Exercise: Installation of Software and Data¶
1.1. OpenCV¶
Installing OpenCV is not trivial. You can download binary distributions and install them but it is not always clear that all we need is packaged. For the course we need the module containing the non-free SIFT software.
I am using the anaconda Python distribution. I didn’t install the standard OpenCV but i got a version from binstar:
conda install -c https://conda.binstar.org/menpo opencv3
If all went well you must be able to run the following code:
In [1]: import cv2
In [2]: x = np.arange(128)-64
In [3]: X, Y = np.meshgrid(x,x)
In [4]: f = (100*(np.hypot(X,Y)<32)).astype(np.uint8)
In [5]: plt.clf()
In [6]: plt.imshow(f);
In [7]: plt.gray()
In [8]: sift = cv2.xfeatures2d.SIFT_create()
In [9]: kps, dscs = sift.detectAndCompute(f, mask=None)
In [10]: ax = plt.gca()
In [11]: for kp in kps:
....: ax.add_artist( plt.Circle((kp.pt), kp.size/2, color='green', fill=False))
....:
In [12]: plt.show()
No worries (yet) in case you have a hard time understanding what is done in this code fragment. If you get an image that looks like the one above you have correctly installed OpenCV.
1.2. Standard Images and Data Sets¶
In the lab exercises you will need some standard data files. All these files are collected in one directory on the web.
1.2.1. Skin Color Data Set¶
1.2.2. Standard Images¶
Below are some standard images used a lot in image processing research. The images shown here a small images (\(256\times256\)) which is an advantage when experimenting with code in development.
You can download these images by clicking right on an image.