Powered by Blogger.

Monday, December 20, 2010

Segmentation and feature extraction. Contours and blob detection.

In BasiOCR tutorial i explain  how to preprocess, extract features and clasify a handwritten number, and a lot of people ask me how to segment an image where contains several numbers or objects.

In this tutorial I want explain how to segment an image and detect each object inside image, in this tutorial we can detect objects from plate (the numbers) or each object draw into a paper.

Published: By: David Millán Escrivá - 6:14 PM

Tuesday, September 14, 2010

OpenCV and CMake

From OpenCV 2.1 version we can use CMake to create and manage our OpenCV projects.

CMake is a cross-platform and open-source build system, and it's used to control our compilation process, using a simple text files for define compilation process with independent platform and compiler.

Thanks to CMake we can create our project in our operating system as linux compile and work in it, and then use it to compile a new version in other os as windows, osx, ..., even create a visual studio project, xcode project or eclipse.

To create a basic project with 1 main.c file with cmake and opencv we must create a new file called CMakeList.txt.
Published: By: David Millán Escrivá - 4:42 PM

Wednesday, February 10, 2010

CvFileStorage. How to save our custom structures with OpenCV functions

[caption id="attachment_311" align="aligncenter" width="645" caption="OpenCV"]OpenCV[/caption]

In this tutorial we go to show how to save our custom structures with opencv functions.

We go to imagine we have this structure in our program.
Published: By: David Millán Escrivá - 5:29 PM

Friday, January 29, 2010

Pseudocolor implementation with OpenCV.

In Computer Vision works in a lot of cases with gray images because there are a lot of motives. But human vision don't perceives the gray levels so well as color levels.

Then if we need show a image to a person, we can color it. But, how is the best way to coloring gray image?

There are 3 ways to do it: Manually, automatically and colored by ranges.

In this tutorial, i go to develop the way most common automatic for gray image coloring.

To do it we need know we go to receive a gray level and we need return 3 values, one for red, one for blue and other for green.

We go to use this function:

$latex \displaystyle{ s(x,y)=\vert sin(r(x,y)*p*PI + \Theta*PI)\vert}$

And r(x,y) is the gray level and p is the number of repetitions and $latex \displaystyle{ \Theta }$ is the displacement.

Then we only need define the p and $latex \displaystyle{ \Theta }$ for each channel.

If we create a plot with this function with this parameters for red, green and blue ((2,0),(2,-0.1),(2,-0.3)) we get:

[caption id="attachment_253" align="aligncenter" width="300" caption="Pseudocolor Graph with red(p=2,theta=0) green(2,-0.1) and blue(2,-0.3)"]Pseudocolor Graph[/caption]

Then we only need set the gray level in range 0 to 1 and the sine returns values from 0 to 1 we interpret as float image values or we set in range 0 to 255.

To finish this is the result:

[caption id="attachment_255" align="aligncenter" width="387" caption="Pseudocolor Result"]Pseudocolor Result[/caption]

Download the code.
Published: By: David Millán Escrivá - 12:19 AM

Thursday, January 21, 2010

Neuroph, Java/Netbeans tutorial.

Neuroph is a Neural network for image recognition in java. In netbeans dzone are a netbeans/java tutorial for image recognition with neuroph library. Published: By: David Millán Escrivá - 11:23 AM

Tuesday, January 19, 2010

Chamilo. The new e-learning platform

Today is born the new e-learning platform. Chamilo!

Chamilo is a new project that opts for open source in a radical way. It aims at bringing you the best e-learning and collaboration platform in the open source world.
Published: By: David Millán Escrivá - 1:32 PM

Saturday, January 16, 2010

Segmentation & object detection by color.

In this tutorial i go to explain how to image segmentation or detect objects byred color, in this case by red color.

This task is simple, but there are some things we must known.

Now i go to explain and get a demo code for segmentation, how to determine if each image pixel is red or no, and then, i go to explain how we  can detect object, it's similar but with diferent concept.
Published: By: David Millán Escrivá - 11:40 PM

Tuesday, January 12, 2010

VIM how to remove ^M at the end of lines

In unix the end of line is different than other systems. More times we edit windows files and when open in VI/VIM we see the ^M character at end of lines.

We can remove this characters with a simply search and replace of vim with this command:
:%s/^M//g

The ^M character is not valid write first ^ character and then M it's not the valid character. To write correctly this we must push Control+v and Contro+M keys, then appear our ^M Character.

Take care with this.
Published: By: David Millán Escrivá - 11:37 AM