Saturday, August 15, 2009
To run you must install .Net Framework: v2.0
"To run you must install .Net Framework: v2.0.50727 ..."
Simply, just download the Microsoft .NET Framework and install on your PC. Some cases, restart the PC is required.
Cheers..
Sunday, July 27, 2008
Load & Display Image using OpenCV
1. Open OpenCV workspace: Click Start-->All Programs-->OpenCV-->OpenCV Workspace MSVC6
2. Create new C++ source file: Click File-->New-->C++ Source File. Put the file name & the folder. Now you have a blank editor to write the code.
3. Write the following code:
#include "cv.h" //main OpenCV header
#include "highgui.h" //GUI header
int main() {
// declare a new IplImage pointer
IplImage* myimage;
// load an image
myimage = cvLoadImage("sayyidsmile.jpg",1); //change the file name with your own image
//create a new window & display the image
cvNamedWindow("Smile", 1);
cvMoveWindow("Smile", 100, 100);
cvShowImage("Smile", myimage);
//wait for key to close the window
cvWaitKey(0);
cvDestroyWindow( "Smile" );
cvReleaseImage( &myimage );
return 0;
}
4. Add library in the project setting: Click Project-->Setting-->Link-->Object/Library Modules then write cv.lib cvaux.lib cxcore.lib highgui.lib. Make sure that you do this step anytime you create a new project.
5. Save and click "Execute Program" icon, then your window named "Smile" will appear.
Easy right ...? Explore other functions in OpenCV and enjoy it !
Saturday, July 26, 2008
cxcore100.dll or highgui100.dll not found error
PROBLEM: When I run my project, OpenCV gave an error like this:
"This application has failed to start because cxcore100.dll was
not found. Re-installing the application may fix this problem"
SOLUTION: Add OpenCV DLL (...OpenCV/bin) directory to system PATH.
For detail of how to add to the system PATH, please refer to my previous posting: How to setup OpenCV ?
The same solution is also solved the error caused by missing others DLL files, such as highgui100.dll not found.
Some friends suggested to copy cxcore100.dll to the directory of the .exe file. But ofcourse it's tedious since we should copy every time we create a project.
Good luck! If you still got problems, please write in comment area.
Thursday, July 24, 2008
How to setup OpenCV ?
The following are the procedures to setup OpenCV:
- Download the OpenCV installation file from here. Find the latest version.
- Run (double click) the installation file. After completed, you will get OPENCV icon menu in your PROGRAM.
- Make a linking in the system PATH to OpenCV DLLs files, using the below steps:
- Click My Computer --> Properties --> Advanced --> Environment Variables --> Systems variable --> highlight PATH --> Edit.
- Add "C:\Program Files\OpenCV\bin" to PATH. The location of OpenCV DLL files might be differentEach different path file is separated by semicolon (;)
- If your OpenCV is already opened, you should close it then open again to take effect of the new path.
- Select directories for Include files, then add four OpenCV directories as show in the figure.
- Also add OpenCV directories for Library & Search files (see the figure)
Now your OpenCV is ready for creating your own project. How to develop a project using OpenCV? Be patient for the next tutorial.
If you have problems or suggestion related to this article, please feel free to give comments. TQ.
Monday, July 21, 2008
OpenCV: An Easy Way of Computer Vision Programming
Web resources:
Official webpage: http://www.intel.com/technology/computing/opencv/
Software download: http://sourceforge.net/projects/opencvlibrary/
Others will be listed later.
Friday, July 18, 2008
Interfacing with Parallel Port using MATLAB
Parallel port IDs and pin number:
| Port ID | Pins | Description |
| 0 | 2 – 9 | Eight I/O lines, MSB = pin 9 |
| 1 | 10 – 13 and 15 | Five input lines used for status (output pins) |
| 2 | 1, 14, 16 and 17 | Five I/O lines used for control (input pins) |
MATLAB has digital I/O (DIO) subsystems which are designed to transfer digital values to and from hardware. To send out data, follow the below procedures:
- To check the support of your system, type
daq=daqhwinfo(‘parallel’)
- Create a Digital I/O Object with the digitalio function
dio=digitalio(‘parallel’,’lpt1’);
- Add lines to a Digital I/O Object
addline(dio,0:7,0,'out'); % add the hardware lines 0 until 7 from port 0 to the
% digital object dio
- Send data to the lines
putvalue(dio.line(1),1); % send data ‘1’ to line 1
Before executing the program, of course you must have the parallel connection attached to your PC and some LED to indicate that the digital data have been sent.Have a nice practice controlling your device via parallel port, and please give your comments!
Wednesday, July 16, 2008
Video & Image Acquisition using MATLAB
In the machine vision system, data acquisition is the first step which programmer should aware. You want to preview object using your camera, capture it, store the captured image in your PC? With simple way, you will get your own preview window of your webcam by following this tutorial.
Equipments:
- CCD camera & frame grabber or webcame
- PC with MATLAB 7.x
- Make sure that you have a functional CCD camera or webcam connected to your PC. Functional means it's driver has been installed in your PC. To see whether your camera can work well or not, you can install a windows standard video capture, named AMCAP.
- MATLAB has built-in adaptor to communicate with the acquisition device. To check whether your MATLAB has this support or not, type
>> cam=imaqhwinfo
cam =
InstalledAdaptors: {1x1 cell}
MATLABVersion: [1x12 char]
ToolboxName: [1x25 char]
ToolboxVersion: [1x12 char]
>> cam.InstalledAdaptors
ans =
'winvideo'
For more information about your device, type
>> device_info=imaqhwinfo('winvideo',1)
- Type the following code in your editor and run the program
vid=videoinput(‘winvideo’);
preview(vid)
im=getsnapshot(vid)
imshow(im)
Check your workspace, now you have RGB image data im.
- To store the image data to a .jpg or .gif file, type
imwrite(im,’myimet.jpg’);
Very easy? If you face any problem or you have suggestions, do not hesitate to write in the comments area below.

