Monday, November 22, 2010

Digital Camera Programming (VC++ /VB6)

Introductions:

Hello to eveyone,as I was continuing the develoment of RoBook Scanner project I've experienced a lot of unexpected technical problems which needed to be resolved by myself. Actually, I am confident that the project design is almost completely done aside from the proof of concept implementations - a working prototype.
Eversince, the Decapod Team had some gap/delays on the release of their new software (Decapod 5.xx) I had decided to reworks the available Decapod softwares (until now its unchanged-oh am sad) though, it could be a very painstakingly task of debugging it from scratched- I beleive in a long run it would be fullfilled .So,I have no choice ,but to initiate programming my own program SDK in RoBook Camera as soon as possible; weew! days are coming to fast and 2010 would be over -a redemption ,my project deliverables(Scanner).
I have just realized its very hard to download and depend on the availble drivers /softwares of some cameras on the net.My option, is to study the interface protocols that made the camera communicate with PC's and search for a free source code too .Luckily I've found some few codes and documents: Layer 1 Protocol and Picture Transfer Protocl -ofcourse using USB port.Both of the two protocos are still used today but PTP is a more recoginized protocol for all available still cameras.
To appreciate the works of some geeks (very useful article!) here I listed some of thier webiste.
Well, I have to enumerate the least strategy to keep time from being wasted and here are my own suggestions.
[Windows]:
1) Download Canon Powershot SDK,RAW software.
2) Convert VC++ to VB6 and enhance some DLL
3) Parsing the minimal but primary functions on camera remote capturing (pictures/images)
4) Use two cameras in just a single PC
5) Do the tricking & tweaking (OCR,Imaging )
[Linux:]
1) Convert VB6 made program in Windows to Linux
..and that is it!


Requirements:



Methodology:



Remarks:


Conclusions:

Tuesday, September 7, 2010

Linux Database Programming(Gambas2)

Introductions:

Objectives:

Requirements:

Methodology:

Remarks:

Conclusions:

Serial Communication Programming (Gambas2)

Introductions:

Objectives:


Requirements:

Methodology:



Remarks

Conclusions:

Sunday, July 18, 2010

PICMe in Linux

Introductions:
And now the PICMe OpenGL version ,

Objectives:
To port PICMe (Windows) Downloader into Linux Downloader
To enhance the use of PICMe in Linux OS platform

Requirements:
qt
gtk
kde
gb.net


Methodology:


Detail(1)Fedorra 13 with Gambas IDE(Visual Basic for Linux)


Detail(2)PICMe linux opening the code


Detail(3) PICMe linux executing the downloader


Detail(4)PICMe linux executing its serial monitor


Detail(5)PICMe-linux showing its loading with progress bar


Remarks:
It is quite laborious but offering it for free somehow relieves fatigue in burning eyebrows and that my hair is decompressing-(Oh,come on go to R&D)

Conclusions:
PICME for Linux is now available

Saturday, July 17, 2010

Optical Character Recognitions (Gambas2 & Tesseract/OCROpus)


Introductions:

This topic is quite interesting and a lot more fun, to tell you frankly,I had a little applications experience of using it before. Perhaps this time ,I have a simple way to use these freely available OCRs . Of course, back in our old school age we didn’t have cameras, mobile phones nor inexpensive Digicams, to apply such kind of software .But it so cumbersome of doing jotting/writing every time during class hours then and wouldn’t it have saved hours of copying notes!

Basically , this blog is just a complementary to my project "Robo-Book Scanner" and what we will be discussing here are: the main software that will make it easier to use OCR's engine (Tesseract or OCROpus) as a back end applications.And by using Gambas version(VB for Linux) which has an advantage featured of designing front end GUI.

Hence using Open source software as what I have said awhile ago, requires a lot of tweaking before we avail it by our own convenience .Anyway- that is how we patronize and support open community -freedom for all digital applications(my own term). Optical character recognition (OCR) is a system of converting scanned printed/handwritten image files into its machine readable text format. OCR software works by analyzing a document and comparing it with fonts stored in its database and/or by noting features typical to characters. Some OCR software also puts it through a spell checker to “guess” unrecognized words. 100% accuracy is difficult to achieve, but close approximation is what most software strive for.

To make it short ,we need to come across of how we can use Gambas 2 & Tesseract to work one application together ,and for us to see how each would give an excellent results as Robo-Book Scanner software which is an OepnGL release OCR software tool.So, our intentions is to use Gambas as IDE /GUI for OCR and its engine no other than- Tesseract or OCROpus.

The last one , is to give you a brief an idea technically

1) We need to hack Tesseract engines, i have read some articles "Hacking Tesseract V0.04" and this is the website - http://tesseract-ocr.repairfaq.org/ and if we could combine testing OCROpus which documentations can be found here -http://code.google.com/p/ocropus/wiki/InstallTranscript well that is better!

2) We need to study Gambas interfacing with C/C++ specially their shared libraries in the Linux Kernel. "How To Program Components In C/C++" and this website -http://gambasdoc.org/help/dev/overview

3) How we open image file in Gambas version 2 (esp: *.TIFF,JPEG,BMP ) and other available free "pdf"converter ;in this website - http://gamblis.com/2009/08/08/sharpdevelop-tutorial-how-to-rotate-an-image/


Objectives:


Requirements:

g++
scons
svn
libpng12-dev
libjpeg62-dev
libtiff4-dev
libavcodec-dev
libavformat-dev
libsdl-gfx1.2-dev
libsdl-image1.2-dev

Methodology:


Installing iuLib

Download iulib 0.3 package from iulib's google code page. http://code.google.com/p/iulib/
Get any missing libraries, run: sudo apt-get install libpng12-dev libjpeg62-dev libtiff4-dev libavcodec-dev libavformat-dev libsdl-gfx1.2-dev libsdl-image1.2-dev

if you get errors downloading any of these libraries, change your package download server. See the note at the top of this document.

Run: sudo scons install (This will help avoid an error in the next step. Make sure to have scons installed.)
Run: sudo make install

Installing Tesseract

svn co http://tesseract-ocr.googlecode.com/svn/trunk/ tesseract-ocr
cd tesseract-ocr
./configure
make
sudo make install

Install OCROpus


# pick one of the following


release
="-r ocropus-0.4.4" # this selects release 0.4.4

release
=""

# download everything

hg clone $release https
://iulib.googlecode.com/hg/ iulib
hg clone $release https
://ocropus.googlecode.com/hg/ ocropus
hg clone $release https
://ocroswig.ocropus.googlecode.com/hg/ ocroswig
hg clone $release https
://ocropy.ocropus.googlecode.com/hg/ ocropy
wget
-nd http://mohri-lt.cs.nyu.edu/twiki/pub/FST/FstDownload/openfst-1.1.tar.gz
hg clone $release https
://pyopenfst.googlecode.com/hg/ pyopenfst
date
;

# compile iulib

cd iulib
sudo sh uninstall
sudo sh ubuntu
-packages
scons
-j 4 sdl=1
sudo scons
-j 4 sdl=1 install
cd
..
date
;

# compile ocropus

cd ocropus
sudo sh uninstall
sudo sh ubuntu
-packages
scons
-j 4 omp=1
sudo scons
-j 4 omp=1 install
cd
..
date
;

# compile openfst

tar
-zxvf openfst-1.1.tar.gz
cd openfst
-1.1
./configure
make
-j 4
sudo make install
cd
..
date
;

# compile ocroswig

cd ocroswig
make
cd
..
date
;

# compile ocropy

cd ocropy
sudo python setup
.py install
cd
..
date
;

# compile Python bindings for openfst

cd pyopenfst
make
cd
..
date
;

You may have to update your LD_LIBRARY_PATH to include /usr/local/lib, for example:

export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib

Remarks:


Conclusions:

Monday, March 29, 2010

Pointer (Coding skills & technique)


Interlude:

Or pointes, these could be one of the challenging scheme a programmers must be adept or skillful to . Almost data declarations in a compiler epscially to an objected oriented programming languages ,a pointer is a bit extra technique which is interesting to be learned.Basically, one reason is the minimizations of coding and the eficacy of applying it in a given program.

Here , we coud have a look of some methods how we would be able to learn adopting and simpliying the use of a pointer to debug a source code.My experienced way back then in dealing with this "pointer" seriously was the challenged that convinced me in porting a TCP/IP Stack code from one c compiler to another(AVR glib libraries to CCS libraries and hopefully to SDCC).

Another are the encouragement that I need to convinced these kind of tricks by myself; 1)I am able to run PIC16F877a as an ethernet server and include details of applications to it, 2) published the documents if nescessary for free.So I decided to recode first the Microchip TCP/IP Stack -a sort of: enc28j60(h,c) , mac(h,c) then the stacktask(h,c) before I can make any algorithm or programming flow of my own style.

Here is that thing I was thingking then-a simple ping reply
main()
{
initialise :
MCU
ENC28j60
tweaking the TX/RX between the two interface
detect for a raw packet then send back to it.
}

Even with a copied uChip TCP/IP Stack it couldn't been easy as what had been thought than done -especillay when porting the code.So,need to consider really the functions of buffer,register and bank selector in enc28j60 as to how I could minimized the program to fit exactly from 32Kb to an 8K!(RAM) flash memory of PIC16F877a. In order to make it more definitive, it is the pointer issues that burned my eybrows -just on porting code of the program.And now, let us discussed a learning schemes how pointer/s are adopted using its advantages in coding a program instead.

Let's take a scrutinizations to these:
Pointers and Constants:
Given the following:
char buffer[100];
char name[20];

//pointer to const char
const char *p = buffer;
p = name; // ok
*p = ’x’; // error!

//const pointer to char
char * const p = buffer
*p = ’x’; // ok
p = name; // error!
const char space = ’ ’;
const char *p = &space; // ok
char *q = &space; // error!

Tuesday, March 16, 2010

GAMBAS (Opensource Visual Basic)



Introductions:

Visual Basic is one of the most dominant programming languages throughout the decades and the favorite to all professional devoted programmers. VB6 which was considered as a third-generation event-driven programming language derived from BASIC. Lately, it was revealed that majority of the database program deployed all over the world was developed by using visual basic.Visual Basic got its throne because it had influences so many BASIC programming languages (compiler/interpreter).There are more features that VB platforms offers :uGUI,DBase ,OSX ,DLL ,Web scripting and add ons killer applications.

If we are going to review its predecessor we will find out that its origin is basic for dos to its latest versions until then enhanced to VB for dos (GUI running in Dos). Then later that development came the VB 5-6 (final version was until 1998) up to the designated successor -VB.net.

No wonder ,Gambas was inspired by VB programming ingenuity and intended to provide a similar experience for developing BASIC programs to Visual Basic. Gambas is intended to be an alternative for former Visual Basic developers who have decided to migrate to Linux or Unix like OS.

So Kudos! to VB and its migration in Linux-Gambas.

Objectives:
To be familiar with Gambas
To adapt Gambas with previous VB6 knowledge back ground
To create a simple sample program in Gambas
To use Gambas in MCU embedded support programs.

Methodology:


Detail(1) : sudo apt-get install













Remarks:


Conclusions:


Monday, March 15, 2010

The Big Four(Assembler,Basic,Pascal and C/C++)


It was my first year in highschool when we had an informal orientation of learning a basic computer concepts it was then that I experienced operating a computer - an 8086 AT IBM computer(atlast ! the real keyboard not a dashboard drawing).Fresh from my memory as I was able to remember those weird techy things, I took my first programming lesson way back our third year in highschool. Well, we're a little bit fortunate because our school was supervised by an Italian priesthood(Sumascan order ) and the technology that they had were unselfishly shared to us.

We we're taught a couple of languages: one was GWBASIC and another one was the Pascal 3.0 (I wish I had that right version).I found an easiness of GWBASIC's usage -why? oh,perhaps from the word itself it is "basic" .Alas! We had then the first unforgetable "Hello World" and several program statement;" Enter 1st Number" plus "Enter the 2nd Number" and " The Sum is:" there all begun our world of programming from cut and paste to syntax modifications.

So after our high-school graduations, and serious life was soon eminent to be faced of; I took computer engineering course becuase I really miss computering.During my college, burning eyebrows there was only one rule I insidted my self to stick learning into-"Explore the BIG 4". I am pertaining to the most important computer languages I should have to study (burning eyebrows as I've said) very well: Assembler,Pascal,Basic and C.

Assembly language made me appreciate computer architecture ,Pascal hits me to the extremities of graphical User interface as Super Mario then was so popular computer games-and to inform you it was developed in Pascal. But as oppurtune knocked the door for computer programmer s I'ved realized then that there were changes in maket demand of software programming ;VB6 and a VC++ for application programer and a C origin JAVA++ for a WEB programmer . VB6 dominate much on Database programming wich included killer apps : interface to ADO,MSQL,MSACCES and etc.VC++ and it continous revision with its excellent platforms such device drivers,libraries and addons beside C/C++ entices the majority of the use of computing research to almost University/Insitutions ( a middle level class of programming).

In my own analogy that is business and MicroSoft had supported these two programming languages and included to its package accesories-Visual Sutdio. It was not so surprising becuase MS Windows was built in C and so was its rival OS Linux.Though of such cases Pascal now caveat is Delphi and Assembly never joined the competitions except it play as a useful programming tool to hardware embedded programming. Sometimes Assembler is being used as an inline interface to its 3 contemporaries compiler or interpreter-BASIC,PASCAL and C/C++.

So , what I learn through it was that somehow this " Big 4" really influenced our digital world -nonetheles the syntax the logic and functions.







Real Basic( Porting VB in Linux)