Powered by Blogger.

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