Here's an example of OpenCV digit recognition with a given TrueType font (*.ttf) and digit height. It uses python PIL module to load digit glyphs. These glyphs (converted to CV images) are then used to train a K-Nearest model.
Monday, July 21, 2014
Monday, October 28, 2013
AVR32 IDE (C/C++)
- uses AVR32 GNU toolchain
- requires FLIP 3 for uart bootloading
- tested only on eGizmo AVR32 mcu board (AT32UC3L0128)
svn repo source:
svn co http://yus-repo.googlecode.com/svn/trunk/AVR32/avr32-ide
forum link: AVR32 GCC IDE
Sunday, June 2, 2013
Here's another application that uses opencv libraries in the Debian disto. It performs face detection using Haar cascade.
The code below continuously captures frames with a USB web-camera. (In this demo, I displayed a sample picture on a separate laptop but this will also work for actual faces). Using the input frames and a loaded Haar classifier cascade, vector of rectangles containing the detected faces is returned to the user. A bounding box is drawn to each face to show successful detection.
Below is the C/C++ equivalent of the above python script. (The code appears lengthy due to the comments and cleanup routines.)
Saturday, June 1, 2013
Here is a sample application that utilizes OpenCV in my customized Debian disto. Sample codes are posted below. The demo simply displays images captured by the camera. This can be extended to utilize other opencv functions.
Below is the C/C++ equivalent of the above Python script.
- thanks to hilite.me for formating the codes. (best viewed with Firefox browser)
- webcam can also be tested with guvcview (Applications Menu->Multimedia->guvcview)
I purchased a mini android tv box available at cd-rking. The item is actually a re-branded BC218 (similar specs to MK802+). This connects to a hdmi monitor, and with a mouse and keyboard this can function as a mini computer. After some testing, I decided to customize a Debian image dedicated for OpenCV development.
download: Debian Wheezy armhf image (~164MB)
- Debian Wheezy w/ XFCE4 desktop (debootstrap log )
- Kernel 3.4.43 (6416f0bf9e32d0950ba6f768ac20228ce8940a79) [Linaro 4.7]
- natively build MALI GPU drivers
- natively build OpenCV 2.4.5 libraries (C/C++ and Python2.7 support)
- with build-essential (e.g. compiler) and python packages
- needs at least 2G microSD card
- extract *.img file using p7zip or 7zip,
then use dd (Linux) or win32diskimager (Windows) to burn the image
- resize partitions (optional )
- root password: toor
- tested only on BC218; so the u-boot, script, and kernel may need to be modified to work for other boards)
- this Debian is intended only for opencv development, NOT for everyday use. There are other linux distro's that are more functional than this.
- no CedarX (VPU) libraries
- to keep the image size small: (1)there's no media player and no web browser included (wifi still works though); (2)remove docs, some locales, and /var/cache/ files.
- some kernel drivers in the default "sun4i_defconfig" were disabled. While, UVC, usb2serial, etc drivers were enabled for interfacing development.
Debian Wheezy armhf image V2
* with LXDE desktop
* apply some tweaks (may cause instability in the system!!!)
- increase dram clock to 432MHz
- increase default min cpu freq to 204MHz, default max to 1104MHz
- use tmpfs for "tmp" and "log" folders
* re-build opencv libraries
If interested only on uboot and kernel files, here's the archive.
Wednesday, April 10, 2013
...an alternative Integrated Development Environment for TI's Stellaris® LM4F120 LaunchPad (ARM Cortex-M4F @80MHz, 256kB FLASH + 32kB SRAM)
download: lm4f-gcc-arm-ide-win32.7z 17.7 MB only.
- fast light-weight IDE (PyQt based)
- using gcc-arm-embedded 4.7.3
- auto-completion (NOT IntelliSense)
- code-outline using CLang
- lm4flash (flash loader from lm4tools)
- serial monitor
- supports C++ projects
- stellarisware peripheral driver library
- supports 8 hardware UARTs: Serial0 to Serial7 (Serial0 is the same as the debug "Serial". Serial6 pins are mux w/ USB pins)
- advanced libraries( USB device, FreeRTOS kernel)
- basic libraries (gpio's, delay's, buttons, RGB led, N6100 lcd)
forum discussion link