Friday, October 26, 2012

My CV Experiments - Shape Detection


Here is my first Computer Vision Experiment I done few months ago. Enjoy. :))



It's Time for C++...


Hey guys,

Here we are again. Today I'm gonna post a C++ Beginners' Tutorial. Don't worry, I'll continue my PHP Lessons and Computer Vision Tutorials in my next articles. I haven't forgot that. :)

As you know C++ is a very common, widely used popular programming language. So I thought it might be great to post some C++ tutorials here. I hope to post some tutorials in game programming in C++. But I'm not quite sure yet cause I'm still new to there and I hope I will be able to post game programming tutorials in later posts. But before that we should learn the basics.

Do you know the original name of C++?
Originally C++ called as C with Classes. But later It called as C++. As many of you know, when we want to increase the value of a variable by 1 in programming, we always use ++ after the variable name.
Eg: x++;
And that's how C++ got its name. :)
It means  One better than C

So now you know how it got its name. And I'm not going to tell another boring details. Let's get to work right away.

First you need to download your C++ Compiler.
I'll be using MinGW
You can download it from here : http://sourceforge.net/projects/mingw/files/latest/download?source=files

Of course you can use Microsoft Visual C++, But I recommend you to use MinGW. But later you can switch to Visual C++. It's not a problem. But as you learn I think it's better to code in plain notepad. :)

(For Windows 7 Users)
After you install MinGW right click on My Computer and select Properties. Then select Advanced System Settings from the left hand side. Then select Advanced tab and click on the Environmental Variables button.



Follow the details in the image. Yeeee!!! Now you are ready to start programming in C++.

See you on next post. :))


Monday, October 22, 2012

What is Computer Vision?

It's been a long time since my last post here. I almost forgot that I had a Blog. However, here I am. :)
Today I gonna post about something fresh, new and awosome.  :D

So I thought today I'm gonna post here about Computer Vision. But I'll write this post in English cause it's hard to find Computer Vision tutorial in the web for Emgu CV. So this may be a guide to non-sinhalese as well. :)

So What is Computer Vision??

Humans use their eyes and their brains to see and visually sense the world around them. Computer Vision is the science that aims to give a similar, if not better, capability to a machine or computer.

Computer vision is concerned with the automatic extraction, analysis and understanding of useful information from a single image or a sequence of images. It involves the development of a theoretical and algorithmic basis to achieve automatic visual understanding.

The applications of computer vision are numerous and include:

  • Agriculture
  • Augmented Reality
  • Autonomous Vehicles
  • Biometrics
  • Character Recognition
  • Forensics
  • Industrial Quality Inspection
  • Face Recognition
  • Gesture Analysis
  • Geoscience
  • Image Restoration
  • Medical Image Analysis
  • Pollution Monitoring
  • Process Control
  • Remote Sensing
  • Robotics
  • Security and Surveillance
  • Transport

(source: bmva.org)

If you decide to study computer vision, you should have solid knowledge of mathematics and of course you should have computer programming experience. I'll post few computer vision tutorials with my next posts. Still I'm also new to computer vision, there will be many mistakes.  So please don't mind. :)

In next posts, I'll use Emgu CV (Open CV Wrapper for C#) and Visual C# for the tutorials. Please download them and Install.


Install these and be ready to dive in to the computer vision world....

See you later....!!!!!

Wednesday, May 16, 2012

PHP Lesson 02

ඔන්න අද මම කියල දෙන්න යන්නෙ කලින් Post එකෙන් අපි ඉගෙන ගත්ත echo කියන Command එක ගැන වැඩි විස්තර තමයි.

මේ Post එක වැඩිය ලොකු වෙන එකක් නෑ. පොඩි දෙයයි අද කියල දෙන්න තියෙන්නෙ. OK. So Let's get started.

අපි කලින් Post එකෙ කරේ මම පහල දාලා තියන Code එකනෙ.

<html>
<head>
<title>MY PHP Lesson</title>
</head>
<body>
<?php
echo "Hello PHP";
?>
</body>
</html>

අද අපි ඒකෙ තියන "Hello PHP" කියන එක වෙනුවට HTML Code එකක් දාලා බලමු මොකද වෙන්නෙ කියල.
හරි මෙන්න Code එක.


<html>
<head>
<title>MY PHP Lesson 2</title>
</head>
<body>
<?php
echo "<b>Hello PHP</b>";
?>
</body>
</html>


දැන් අපි මේ Code එක Run කරලා බැලුවම මොකද වෙන්නෙ කියලා බලා ගන්න පුලුවන්. මේක Run කරාම "Hello PHP" කියන එක Bold වෙනවනෙ. ඒ කියන්නෙ අපි දාපු HTML Code එක වැඩ කරා කියලනෙ. ම්ම්ම්... අදට ඔච්චර තමයි කියන්න වෙන්නෙ. ඔයාලා තව HTML Code දාලා බලන්න.


අපි පාඩම් ටික චුට්ට චුට්ට කරමු නෙ. නැත්තම් එක පාරට ලොකු ඒවා කියල දෙන්න ගියාම එපා වෙවි. :))


මම ඊලඟ පාඩමෙන් Special Characters ගැන කියල දෙන්නම්. ගොඩක් කට්ටිය දන්නවත් ඇති. ඒත් දන්නෙ නැති කට්ටියත් ඉන්නවනෙ.



Thursday, April 19, 2012

PHP මoගල Lesson එක

ඔන්න මම කලින් Post එකෙන් කිව්ව වගේ PHP Lesson එකක් දැම්ම..

ඔන්න කස්ටිය දැන් PHP ඉගෙන ගන්න නම් ඔයාලා use කරන IDE එක Open කරන්න. මම නම් use කරන්නෙ Dreamweaver IDE එක. ඔයාට IDE එකක් නැත්නම් Notepad එක open කර ගන්න. අපි මේ ගහන හැම code එකක්ම Notepad එකෙනුත් කරන්න පුලුවන්. :)

අපි code ගහන්න කලින් Computer එකට කියන්න ඕනනෙ අපි මේ ගහන්නෙ PHP codes කියල. HTML වල නම් <html> Tag එකෙන් කියන්නෙ දැන් මේ අපි HTML codes ගහනව කියලනෙ. ඒ Tag එකට කියන්නෙ HTML වල Opening Tag එක කියලනෙ. ඒ වගේම තමයි PHP වලටත් එහෙම Opening වගේම Closing Tag එකකුත් තියනව HTML වල </html> Tag එක වගේ.

ඉතින් PHP Start කරන්නෙ <?php එහෙමත් නැත්නම් <? Tag එකෙන්. ඒත් මේ tag 2න් වැඩියෙන්ම පාවිච්චි කරන්නෙ <?php කියන Tag එක. දැන් මේක Start කරා වගේම End කරන්නත් එපයි. සෝ PHP Script එක ඉවර කරන්නෙ ?> කියන Tag එකෙන්.

ඒ වගෙම තමයි PHP වල File Extension එක වෙන්නෙ .php කියලා. මේ PHP File එක ඇතුලෙ තියෙන්න පුලුවන් PHP Codes ම විතරක් නෙමෙයි HTML Codes, Javascripts, Ajax ඔය වගෙ හැම එකක්ම මේ PHP file එක ඇතුලෙ තියෙන්න පුලුවන්.

ඔන්න පල්ලෙහා තියනව මම කරන මුල්ම PHP Code එක.

<html>
<head>
<title>MY PHP Lesson</title>
</head>
<body>
<?php
echo "Hello PHP";
?>
</body>
</html>


ඔන්න ඕක තමයි මම කරන මුල්ම PHP Code එක. මෙකෙ echo කියන එකෙන් කියන්නෙ " " ඇතුලෙ තියන ඒවා print කරලා පෙන්නන කියල. ආහ් කියන්න තව පොඩ්ඩෙන් අමතක වෙනවා. අපි PHP වල හැම Statement එකක්ම ඉවර කරන්න ඕන semicolon (;) එකෙන්. Programming කරන ගොඩක් කට්ටිය නම් ඒක දන්නව. දන්නෙ නැති කට්ටියට තමයි මේ කිව්වෙ.. :)

දැන් අද Homework වලට දෙන්නෙ echo කියන එක වෙනුවට print කියලා දැම්මොත් මොකද වෙන්නෙ කියල ඔයාලා කරලා බලන්න. හැම එකක්ම මම කියල දුන්නම ඒකෙන් ඔයාලට වැඩක් වෙන්නෙ නෑ..

ඉතින් අදට මම පාඩම නවත්තනවා. ඊලඟ දවසෙ තව අළුත් පාඩමක් අරගෙන එන්නම්කො. එතකන් බායි.. :))

ප.ලි. : මොනා හලි පුරස්න තීනවනම් කොමෙන්ටුවකින් අහන්න.

කාලෙකට පස්සෙ.....

අම්මෝ කාලෙකට පස්සෙ මතක් උනේ පෝස්ට් එකක් දැම්මෙ නෑ නේද කියල.. හිහ් හිහ් මේක බලන්න කට්ටියත් නැති හින්ද එච්චරම ඕන කමකුත් තිබ්බෙ නෑනෙ Post එකක් දාන්න...

අද කම්මැලිකමේ මොකක්ද කරන්නෙ කියල කල්පනා කර කර ඉන්න කොට තමයි මතක් උනේ අඩේ මගෙ Blog කට්ටකුත් තියනවනෙ කියල... ඉතින් ඔන්න මේ පැත්තට ආව මොකක් හරි Post කරනව කියල. ඒ ආවත් දාන්න දෙයක් හිතා ගන්නත් බෑ.. ඉතින් දැන් වල්පල් ටිකක් කොටන්න ගත්තා..

මම PHP කියල දෙනව කියලත් කිව්වනෙ.. ඒකත් භාගෙටනෙ කරේ.. අද PHP වල ඊළඟ පාඩම ලියන්නකො ඉතින්..

එහෙනම් අපි අලුත් PHP පාඩමෙන් Set වෙමු.. :)

Wednesday, September 28, 2011

PHP ඉගෙනීමට පෙර....

දැන් ඉතින් කට්ටිය PHP ඉගෙන ගන්න හිටියට වැඩක් නෑනේ.. ඊට කලින් කරන්න ඕන වැඩ ගොඩාක් තියනවනේ...
මම දැන් කියන්න යන්නෙ PHP අපි install කරගන්න විදිය ගැන..
අපි PHP ගැන ඉගෙන ගන්න කොට ඕන කරන ඒවා තමයි ගැන තමයි දැන් මම කියන්න යන්නෙ.

01. Apache Server එක :
අපි ලියන PHP Scripts run කරන්න තමයි Apache Server එක් ඕන..

02. PHP :
මේක ඉතින් නැතුව කොහොමත් අපිට PHP ඉගෙන ගන්න බෑනේ..

03. MySQL Server එක :
අපිට ඉතින් Database එක්ක ගණුදෙනු කරන කොට මේකත් ඕන වෙනවා..

මේ 3 ඉතින් වෙන වෙනම install කරනවට වඩා ලේසි ක්‍රමයක් ගැන තමයි මම දැන් කියන්න යන්නේ..
අනිත් ඉගෙන ගන්න අයටත් මේ Software එක use කරන එක හෙනම ලේසියි..

Software එකේ නම තමයි XAMPP..
http://www.apachefriends.org/en/xampp.html
මෙන්න මේ site එකට ගියාම ඔයාලට නිකම්ම XAMPP Software එක බා ගන්න පුලුවන්..

මේ Software එක install කරන හැටි ඉතින් මම කියලා දෙන්න ඕන නෑනේ..
එහෙම මොකක් හරි උදව්වක් ඕන නම් කොමෙන්ටුවක් දාන්න..

දැන් අලුතෙන් එන XAMPP Software එක install වෙන්නේ C:\ එකටනේ..

C:\xampp\htdocs\

මෙන්න මේ htdocs කියන Folder එක ඇතුලේ වෙන Folder එකක් හදලා ඒකට තමයි අපි කරන ඔක්කොම PHP files දාන්නේ..

උදාහරණයක් විදියට, අපි හිතමු අපි අර htdocs කියන Folder එක ඇතුලෙ mysite කියලා Folder එකක් හදලා ඒකට index.php කියලා අපි code කරපු PHP File එකක් දානවා.. දැන් අපිට මේ file එක run කරලා බලන්න  ඕන නම් කරන්නේ XAMPP Control Panel එකෙන් Apache Server එකයි MySQL Server එකයි Start කරන්න..

දැන් ඔයාගෙ Web Browser එක open කරලා
http://127.0.0.1/mysite/index.php    හෝ    http://localhost/mysite/index.php
Address Bar එකේ Type කරලා Enter කරන්න..

මම පලවෙනි Lesson එකේදි Screenshots දාලා කරලා පෙන්නන්නම්.. එතකොට තේරුම්ගන්න පුලුවන් වේවි දැන් තේරුනේ නැත්තම්.. :)


හ්ම්ම්ම්ම්...ඇති වගේ.. මම ගියා.. ටටා.. :)