Thursday 14 February 2013

JavaCV in Hackberry

Installing JavaCV in Hackberry A10:

After installation of OpenCV in Linux-Hackberry , if you guys wanna workout with JavaCV then here are the steps you need to follow:

  1. Install Eclipse or Netbeans-Ide through the terminal by typing : " sudo apt-get install eclipse " or   " sudo apt-get install netbeans ".
  2.  Next step is download the ARM-Linux version of JavaCV. Download the ARM-Linux version of JavaCV ( javacv 0.3) from this link: " https://drive.google.com/folderview?id=0Bxr1St4kFOnQb2hZSWhycE11bzA&usp=sharing ". 
  3. Once you have got the JavaCV-ARMLinux Files Watch the video of "JavaCV Installation part2" for creating new projects with JavaCV in eclipse and netbeans: ( The video is for running eclipse or netbeans project in Windows , but even in Linux the steps are same. The only thing that needs to be changed is that when choosing the option " Add External Jar files", browse to the folder " JavaCV-ARMLinux" and choose the "javacv , javacpp , javacv-linux-arm" files.)
 
 













 


OpenCV in Hackberry

How to Install OpenCV into Hackberry-Linux:

After you have got Linux running on Hackberry if you wanna install OpenCV then follow the steps below :
  1. Open the Terminal an type: " sudo apt-get update ", and " sudo apt-get upgrade ".
  2. Then type :" sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libeigen2-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev
  3. The above command install all the dependency files as well as "Python". If you don't want "Python" , you can remove "python-dev python-numpy python-tk "  from the above command.
  4. After the above dependencies have gotten installed type the command : " wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.4/OpenCV-2.4.4-beta.tar.bz2 " to get the OpenCV-2.4.4 version. Or you can simply go to the OpenCV homepage and download the Linux version of OpenCV.
  5. Next type : " tar -xvf OpenCV-2.4.4.tar.bz2 " to un-tar the Opencv files . 
  6. Type: " cd OpenCV-2.4.4 "
  7. Create a new folder named "build" inside "OpenCV-2.4.4" Directory or type the command : " mkdir build "
  8. Now type " cd build".
  9. To build the OpenCV files with Cmake type the command : " cmake -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON .. "
  10. The above command configures the files for installing Python examples as well as c-examples, you can remove the unwanted files by removing the corresponding command parameter. 
  11. Now type " make " . {Warning: This command builds the OpenCV files for the Linux-os , It will take more than 3-hours continuous, so be patient until it completes to 100%(ignore any warnings). If in case you attempt to restart the system then you need to rerun the make command once again if it is not 100% complete.}
  12. After the "make" command completes to 100% , type : " sudo make install ".  {Warning: This command installs the OpenCV build files for the Linux-os , It will also take more than 3-hours continuous, so be patient until it completes to 100%(ignore any warnings). If in case you attempt to restart the system then you need to rerun the make command once again if it is not 100% complete.}
  13. After the " sudo make install" commands completes to 100% type  " sudo your-text-editor /etc/ld.so.conf.d/opencv.conf ( your-text-editor can be replaced by any kind of the text editor app found in your os, for eg if you are having a LXDE-Linux then the text editor will be leafpad, so the command would be : sudo leafpad /etc/ld.so.conf.d/opencv.conf).
  14. The above command opens a file named 'opencv.conf', add the following lines to the file and save it: /usr/local/lib .
  15. Now run : " sudo ldconfig " to configure the installed library. 
  16. Then type the command : " sudo your-text-editor /etc/bash.bashrc " . This command opens a file named ' bash.bashrc '. 
  17. Add the following lines to the end of the ' bash.bashrc ' file and save it: PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
    export PKG_CONFIG_PATH
 Finally close the terminal and restart the system.
You will have OpenCV installed with Qt and Python.
To test opencv with Qt :
  1. Type the command in the terminal as : " cd ~/OpenCV-2.4.4/samples/c ".
  2. Then type : " chmod +x build_all.sh ", and " ./build_all.sh ".
  3. Now run an example by typing : " ./facedetect --cascade="/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" --scale=1.5 lena.jpg "













Linux-OS in Hackberry

How To Install a Linux-OS into HackberryA10:

Requirements:
1. A Host PC running Windows or Linux.
2. A SD-Card 4GB or more.
3. A Linux-distro img file which you want to install to your Hackberry.( ArmHF-Debian for Hackberry) ( Or visit the "Wiki" or " Forum" links of Hackberry A10 homepage to get the Linus-OS)


Mainly 2 Methods:
1st:





  • Choose the Image file and Device(i.e the Drive which you have connected your SD-CARD).
  • Click on "Write" Option. Thats it, after the writing of the image to SD-Card is successful, you can insert it to the Hackberry and boot up the Linux .

2nd:
(a):
  • If you are having a Linux Host Pc and if you are having a pre-built image for the Hackberry then,
  • Unzip the downloaded Image File.
  • Run the Command in Terminal as :dd if=yourimagefile.img of=/dev/<device> , press enter . (to know your SD-Card's 'dev' just run the System monitor and in the File System you will find the vfat filesystem as "dev/sdc" or "dev/sdb", just replace the "<device>" with "sdc" or "sdb" depending on your system ) {Warning : Choosing the wrong dev/device could erase your HDD}.   
  • After the "dd" finishes type the command " sudo sync" , press enter. Thats it, the Linux OS is installed onto the SD-Card , you can insert it and boot the Hackberry. 
(b)
  • If you are having Linux Host but if you don't have a pre-built Hackberry Image then :
  • Download the u-boot files (sunxi-spl.bin and u-boot.bin): https://drive.google.com/folderview?id=0Bxr1St4kFOnQRXFwLXVxaGdFUW8&usp=sharing
  • Download the Script Files (evb.bin and script.bin): https://drive.google.com/folderview?id=0Bxr1St4kFOnQbjVwUHJOVDFXcG8&usp=sharing
  • Unzip the downloaded Image File.(OS -file)
  • Run the Command in Terminal as :dd if=yourimagefile.img of=/dev/<device> , press enter . (to know your SD-Card's 'dev' just run the System monitor and in the File System you will find the vfat filesystem as "dev/sdc" or "dev/sdb", just replace the "<device>" with "sdc" or "sdb" depending on your system ) {Warning : Choosing the wrong dev/device could erase your HDD}.
  • After the "dd" finishes type the command " sudo sync" , press enter.
  • Next type the command :" sudo dd if=sunxi-spl.bin of=/dev/sdc bs=1024 seek=8 ", press enter.
  • Type : " sudo dd if=u-boot.bin of=/dev/sdc bs=1024 seek=32" , press enter, and Type "sudo sync " , press enter.
  • Remove the SD-Card and Re-insert it again , you will have two partitions one is Fat and other one is ext4 partition, this ensures that the image has been written to the SD-Card successfully. Next type the command in terminal as : " cp evb.bin /media/<drive label>/evb.bin " , press enter and type " cp script.bin /media/<drive label>/  ", press enter.
  • Thats it finally remove the SD-Card and insert it to the Hackberry and boot the Linux.






                                                                                                                                                                                                                                          

About Hackberry A10-DevBoard





Hackberry-A10 Devlopment Board:

HomePage : miniand.com



















The Video is of Unboxing and Reviewing the Hackberry A10 DevBoard.
Specifications:
CPU:  1.2GHz Allwinner A10 ARM Cortex A8.
Memory: 1GB DDR3.  
GPU: Mali400.
Networking: 10/100 Ethernet, Realtek 802.11n WiFi.
Serial Port: 3.3v TTL 4-pin header.
Digital Video Output: HDMI up to 1080p.
Analog Video Output: 3.5mm composite AV, 3.5mm component Y/Pb/Pr .
Audio Input : 3.5mm mic jack.
Audio Output: HDMI.
USB: 2 x USB A 2.0 ports.
Internal Storage: 4GB NAND Storage.
External Storage: SDHC card support upto 32GB.
Operating System: Android 4.0 ICS and Linux .