Showing posts with label machine vision. Show all posts
Showing posts with label machine vision. Show all posts

Wednesday, July 11, 2012

python and opencv

Install OpenCV and Python
Yesterday we had problem about installing OpenCV with python, so I tried to install on my computer and it work quite well here. I also have problem with new version of OpenCV (OpenCV version 2). It seems like new version of OpenCV is just a zip file and we need more step that we have tried but it didn’t work such as Add <...>\OpenCV\bin to the system PATH and so on.
What I have installed: python-2.6 and OpenCV1.1 (OpenCV1.1 is .exe file, so it automatically add path for us. If you found problem about downloading the old version of OpenCV, you can email me to send the link to you, it’s about 25.5 MB)
After you installed those two programs, you can try if it work or not by import these two libraries from Python shell

>> from opencv.cv import *
>> from opencv.highgui import *

If it works, it means you can use this function with python.
There are some examples that you can learn more from <yourOpenCVpath>\samples\python. They also provided the example for C if you prefer to use.

Getting start with Python
To create new project,

  • File>New Window, then you will have new space to create your program
  • Import CV and Highgui
    from opencv.cv import *
    from opencv.highgui import *
  • You can try with load image and show image here I show the image called penguins.jpg here is the program;

from opencv.cv import *
from opencv.highgui import *

img = cvLoadImage ("penguin.png",0)
cvNamedWindow("Image", CV_WINDOW_AUTOSIZE)
cvShowImage("Image", img);

while cvWaitKey(0) != 0x1b: pass

  • After that, for test your program just press F5.


I hope I might help you to start your project, you can email me if you have problem about programming or image procelssing. I would glad to help you if I could.

Monday, June 11, 2012

Halcon realtime

Hi, this is going to be my second week working at semi-conductor industrial factory. My work is quite interested, I have to develop machine vision measuring system using Halcon vision software and visual c#. Actually, the workers in team already have the knowledge about machine vision, they just need a programmer who can build the application file for them using c#. So they asked me to join.
Just wow for the equipment they provided for the trainee student.
my computer and lab camera

The following video is showing the measurement of angle rotation for the wafer using Halcon.  At first, they already have a program that can measure the angle of the wafer but it cannot use in realtime. So I have to edit and make it run as an application for the real machine. Actually, before I finished my work today I already finished implement with C# but I'm afraid to make a video at that time because many people in the team came and saw the progress at my table.

PS. I don't know how to stop capturing in C# if someone know the solution please contact me. T^T
PS2. I don't know if it going to be illegal to record and share the video or not but it was my program (LOL).