Showing posts with label pattern recognition. Show all posts
Showing posts with label pattern recognition. Show all posts

Tuesday, January 25, 2011

Face detection-- code patch and tests with some drawings

My colleague introduced me an OpenCV site in Japanese in which many sample codes are available. Most of the sample codes are written in C++, and some are converted to Python also. I copied one sample code, which is used for face detection.

After testing, I found the sample code has two lines which have to be modified to run properly. The first one seems to be a typo. The variable named as ``storage1'' should be ``storage'' according to other lines of code. The 25th line with variable ``starage1'' should be deleted. Another modification is to change assign the path of Haar-cascade xml files [*] explicitly. The original code gives the xml file without the complete path, and the program cannot find the so-called ``haarcascade_frontalface_default.xml.''

The patch file:
@@ -22,9 +22,8 @@
                 sys.exit(-1)
         src_gray = cvCreateImage(cvSize(src_img.width, src_img.height), IPL_DEPTH_8U, 1)
 
-        storage1 = cvCreateMemStorage(0)
         ## (2)ブーストされた分類器のカスケードを読み込む
-        cascade_name = "haarcascade_frontalface_default.xml"
+        cascade_name = "/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml"
         cascade = cvLoadHaarClassifierCascade(cascade_name, cvSize(1,1))
 
         ## (3)メモリを確保し,読み込んだ画像のグレースケール化,ヒストグラムの均一化を行う



Here I tested the sample code with some of my drawings, which can be viewed on my another blog. The results are interesting (at least for me).









---
[*] I have just begun to learn things about computer vision, so I might use some terms wrong.

Thursday, July 30, 2009

[SW] HMM source code/library

Two free source code/library of HMM:
I've installed it in my Ubuntu, but still have no time to play with it.
Written by Prof. Dekang Lin. The overall package looks not complex. I've compiled the source code with the included Makefile and the program works normally. I would dive into these code files to learn something about HMM's working principle and how to implement it.
I found this package when I was searching ``k-means HMM''. I've not tried it yet.

[Study] Useful websites for pattern recognition

I am learning pattern recognition and want to find useful information for PR beginners like me. Here are something I found and might be helpful:

This is a personal website with abundant content. Dr. Kardi Teknomo introduced some techniques used in PR or ML (machine learning) in a very friendly way. There are still many other topics which I don't know much, and may be also useful if you are searching them.

Lots of links. But the web page reads ``Due to a reorganisation we are not able anymore to maintain these files. They will be removed in the near future.'' I hope they keep maintaining these information if they have web space for it.

If you do read Taiwanese Han-characters (traditional Chinese), this website is another tutorial you could consult.

(The list might be extended when I find more.)