Mostrando postagens com marcador digital image processing. Mostrar todas as postagens
Mostrando postagens com marcador digital image processing. Mostrar todas as postagens

segunda-feira, 1 de julho de 2013

Android apps with OpenCV

Last week, I discovered a blog about Android apps developed based on OpenCV. The developer uses OpenCV to create new features in the Android device.

The link is: http://engcross.blogspot.com.br/ and his page in Google Play is https://play.google.com/store/apps/developer?id=Eng+Cross

There is following some screenshots presented in the page in Google Play.

App 4 View: applies 4 effects in your camera visualization, then you can select which you want, just touching on the screen, and take photos these are saved in SD card.


App Right Angle: transforms your Android device in a set-square tool, identifying right angles in the image captured from the camera, all you need to do is to put the mark over a 90° object, as a desk, table, draw, furniture, etc.


Other information, these two apps are free and without advertisement, so we can use them right now!

quinta-feira, 19 de março de 2009

Mathematical Morphology using OpenCV

I did a post about mathematical morphology, I wrote about theory of mathematical morphology.

Now, I want to write about the functions of OpenCV* for manipulate the structural element and apply the operations of erosion and dilatation.

The following function creates the structural element:

IplConvKernel* cvCreateStructuringElementEx( int cols,
int rows,
int anchor_x,
int anchor_y,
int shape,
int* values=NULL );

cols: Number of columns of the structural element

rows: Number of rows of the structural element

anchor_x: Horizontal offset relative to point of anchor, normally equal to 0 (zero)

anchor_y: Vertical offset relative to point of anchor, normally equal to 0 (zero)

shape: Type of structural element, possible values:
  • CV_SHAPE_RECT, square element;
  • CV_SHAPE_CROSS, element in disc;
  • CV_SHAPE_ELLIPSE, elliptic element;
  • CV_SHAPE_CUSTOM, element defined by user. In this case, the parameter values specifies the mask, delimiting the vicinity of the pixel in analysis.
values: Pointer to structural element defined by usuer, this parameter is used just for shape = CV_SHAPE_CUSTOM.

Function of erosion:

void cvErode( const CvArr* src, CvArr* dst,
IplConvKernel* element=NULL, int iterations=1 );

Function of dilatation:

void cvDilate( const CvArr* src, CvArr* dst,
IplConvKernel* element=NULL, int iterations=1 );

src: Input image;
dst: Output image;
element: Structural element. If it's NULL, the structural element is a square 3x3;
iterations: Number of times for apply the operation.
The interfaces for development in Python is the same, and all functions are very fast because they're implemented in C.

More informations here.


----------------------
* OpenCV (Open Computational Vision) is a API for development using Computational Vision. It's a very powerful set of functions for capture, processing and showing of images and videos.

segunda-feira, 2 de março de 2009

Convolution

What's convolution? Who studies functional analysis in mathematics or signal and/or image processing, they ask themselves: "what's convolution?" and now we'll try to show a light.

Give a generic function f(t), for example a signal of voice.

We want to analyze the similarity between f(t) and another function h(t) (known). The similarity should be calculated for all t, because we don't know the moment that f(t) is most similar to h(t).

Okay, now we know what we have to do, let's learn how we do.

We have a function f(t), the most similar function to f(t) is f(t) (obvious), so if we dislocate f(t) over itself, for each lag (t - s) we calculate the similarity between f(t) and f(t - s), the maximum similarity occurs for s = 0.

But, if we have the function f(t - a) (f(t) shifted to left of a), thus if we dislocate h(t) = f(t - a) over f(t) the similarity between f(t) and f(t - s), the maximum similarity occurs for s = -a.

If we have a function h(t) and we don't know the moments and the values of similarity between f(t) and h(t), then we need calculate the similarity for each t, and I say: this calculus is the convolution.

For finish, Why do we want to calculate the similarity between two functions?

Because we can find known patterns in given functions. Return to signal of voice, we can find phonemes (known patterns) over a captured signal.

--------------
The command in Scilab that calculates the convolution is convol().

quinta-feira, 5 de fevereiro de 2009

Neural learning

Let's talk about neural computation.

The algorithms of neural computation are based in observations of nature, specially in animal's nervous system.

I did a post (here - in Portuguese) about neural networks, I wrote about concepts for who wants develop the algorithms.

The neural algorithms are able to assimilate the information by itself, like us.

The computers hold the information in digital memory and access the information by memory addresses, if we need an information then we send the address and get the content. In neural systems, if we need an information then we send a correlated information.

Let's think. You can't enumerate your neurons and access the information one by one. But you can access the information in your brain using other information correlated to it, for example: dog. You thought in a dog conforms to the standards you know.

Other example:
You look the image and you think the words garden, flowers, plants and the emotions like peace, tranquility, etc...

To finish, remember that God created the perfect nature, we can contemplate the nature and seek inspiration in God's creations.

quinta-feira, 15 de janeiro de 2009

Blog about Scilab

I created a new blog just about Scilab.

I want to teach how to use the Scilab for English speakers.

I'll post codes and tips for developing in Scilab and Scicos.

I want to teach something about digital images and signals processing in the new blog, but I'd like receive comments and interactions (votes in polls, for example) in the blog.

If I receive comments and suggestions, then I'll do posts as you want.

So, it's all! Visit me here, too.

terça-feira, 6 de janeiro de 2009

I'm back

I will travel today and my return is next Monday. I will start a tutorial about Scilab, I'm thinking in create a new blog over the English version of the Scilab tutorial.

I'd like that the readers comment this post with suggestions about examples areas like digital signal and image processing, computational intelligence, automation and control, etc...

I will use the suggestions on the Scilab's codes that I will develop.

I created a new blog (all in English). I'd like to receive visits on my new blog.

sábado, 20 de dezembro de 2008

Lighting manipulation by histogram

I did a post about segmentation (in portuguese), in that post I cited a histogram's equalization, and, I'm working with enhancement for my DIP class, so I will show a very simple technique here.

I use just Scilab and SIVP for develop my codes (search for scilab and sivp tags here in the blog).

Ok, let's do a offset manipulation in the image's histogram. This technique consists in add or subtract a constant value in all pixels.

See the picture.

Its histogram is this.

Ps.: The histogram is the number of pixels for each value (send comments for any question).

This is a lighter image, and its histogram is concentrate in higher values. Thus, let's subtract a constant value 50 of each pixel.

The result.
Old imagem | New image.

And the hew histogram.

The technique is very simple, but the simplest form is the best in many cases.

If anyone wants more about histogram's manipulation then send me comments.

domingo, 2 de novembro de 2008

Vowels in Sign Language

I recorded some videos more to my mastering qualify (the alphabet in Libras - Brazilian Sign Language).

I'm having problems with the Scilab (it doesn't read the videos), thus I used the mplayer to extract the frames. For extract frames from a video, I use the command:

>> mplayer -vo jpeg name_of_the_file.avi

Now, I'm doing tests about skin segmentation. I tried threshold and clustering algorithms, but nothing works with all pictures that I have.
If anyone can helps me, I will be very grateful.

These are some pictures that I have:

Letter 'A':

Letter 'E':

Letter 'I':

Letter 'O':

Letter 'U':

terça-feira, 14 de outubro de 2008

Image processing in batch

I don't have very free time (because I'm doing my mastering qualify), thus this post will be small.

I want show the Phatch.

It's a software for image processing in batch. I don't know how that works, but I believe that it makes the same processing for all images (in a sequence).

Some examples of operations in the Phatch:
  • Resize;
  • Water mark;
  • Smoothing of boundaries;
  • Rotate.

The Phatch has more complex operations, but I don't use it yet, so I cann't talk about them.

terça-feira, 30 de setembro de 2008

Neural Segmentation of Hands

I developed an algorithm for segmentation of objects in digital images.

I maked this algorithm because I will need do segmentation of hand in my mastering project.

This a video whose I do for show the result.



The algorithm consists in build 2 clusters, the first for mapping the object and the second for mapping the ground.

I used Self-Organizing Maps for build the clusters.

I wrote the code in Scilab, using the SIVP toolbox.

sexta-feira, 26 de setembro de 2008

Mathematical morphology

One of most important areas in digital image processing is mathematical morphology.

It consists in max and min filters on the input image, changing the structural element (filter's mask).

Some applications of mathematical morphology are:
  • Filtering of binary images;
  • Objects resize;
  • Enhancement of specific areas.
The next images are showing the results of mathematical morphology:
Image 1: original image.

Image 2: result of original image's dilatation (max filter).

Image 3: result of original image's erosion (min filter).

The GIMP (GNU Image Manipulation Program) does these mathematical morphology operations, as showed.

Before all, I want explain the structural element. It's a sub-set from input image and its form may change depeding on the application.

For example, given a image F(x,y) and a structural element which is a squad with 3 columns and 3 rows. The cited sub-set is Struc{F(x,y)} = {F(x-1,y-1), F(x-1,y), F(x-1,y+1), F(x,y-1), F(x,y), F(x,y+1), F(x+1,y-1), F(x+1,y), F(x+1,y+1)}. The structural element defines the neighborhood for each point (x,y) on the image.

The most common forms are:
  • Squad;
  • Circle;
  • Cross;
  • Dash (diagonal, vertical or horizontal);
  • Diamond.
The max and min filters are used in dilation and erosion, respectively. But they may be used in sequence with equals or diferents structural elements, proving the opening and closing operations.