Mostrando postagens com marcador simulation. Mostrar todas as postagens
Mostrando postagens com marcador simulation. Mostrar todas as postagens

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.

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.

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':

quinta-feira, 9 de outubro de 2008

Qualification

I was told that I have 1 month to complete my mastering qualification.

Thus, I can't make posts frequently until the next month.

But, I want to thank to readers who visited the MultiSign (yesterday I had 37 visits, see here). I'm very happy too because I saw the first place with more than 10 visits out of Brazil and Portugual, look the picture.


See the west of United States (the left side).

So, it's all.

segunda-feira, 25 de agosto de 2008

Free Games

Games, or any entertainment aplication, ever are questioned in Free Software, because when someone is talking about GNU/Linux and others free systems other one be the question: "I will can play the game {X}??". So is necessary to cite the incompatibilities between the systems (GNU/Linux and Window$, for example). Sometimes the emulators (as the wine) can resolves the problem, but the games are a big problem to use free software, for domestic users.

Currently exists many free games, or compatible with free enviroments, that are very interesting, for example:

  • Nexuiz;
  • Super Tux (similar to Super Mario of SNES);
  • America's Army;
  • Open Arena;
  • Tremolous;
  • Tux Racer;
  • Alien Arena;
  • The Open Racing Car Simulator;
  • Frets On Fire;
  • Scorched 3D;
  • Mania Drive;
  • FreeCraft;
  • Cube.

List with many games here.

I believe that money is the biggest complicating for free game developers. But I find some answers to this question:

Publicity - a company can pay to the developers and the game could have advertisements of that, for example a car company (Ferrari, GM, Toyota, etc...) paid for a racer game, and all cars will be of this company.
"Closed" games - the game is free, so the source-code just together the program, but is possible to develop specific hardware to game and to market hardware and software together, or only the hardware, could be possible, too, make a portal with tutorials, tips, upgrades, device drivers, multiplayers games, etc...
Games to mobile devices (or embedded systems) - charge a fee by acess the site, download a program, upgrade, any resource, etc... And yet, the users could be tools to develop levels, for example.

Make money with free games is possible, invent your way!

Other big problem of game market is the developer's (programmers, game designers, graphic artists, etc....) greed, because many developers want be rich with only one game and live of this game forever.

Is better to do some games and make few many in each game than to do one game and make US$ 1,000,000.00 from it.

Today, most players can't pay for expensive games, but they can pay some cents for "simple" games.

Ok, it's all! Come on, let's to develop free games!!

quinta-feira, 14 de agosto de 2008

Computational Vision in Scilab

In this post I will share knowledge about Scilab and SIVP (Scilab Image and Video Processing toolbox).

To Ubuntu (and similars) users the Scilab can be downloaded and installed by package manager (synapic, apt-get, adept, ......), you just to download all files. The SIVP can be downloaded from here.

To install the SIVP is very simple, only do this steps as root:

  1. Unpack the file;
  2. In shell: cd {SIVP's directory}
  3. In shell: ./configure
  4. In shell: make
  5. In shell: make install
After this proceeding, the Scilab is all set to use computational vision resources: webcam's access, files (images and videos) readers, image display, ......

The SIVP uses the OpenCV API, and it can be downloaded and installed by package manager.

Before of start the Scilab, test your webcam with the Camorama (it can be downloaded and installed by package manager too).

This is the initial Scilab's screen:


The toolboxes button is detached.

To load the SIVP is only select it in toolboxes button.

This code is a example to use the webcam and display the images.

// Display images from webcam

Cam = camopen(); // open the webcam
nFrames = 1000; // set number of frames

for n = 1:nFrames, // main loop
im = avireadframe(Cam); // read the frame from webcam and hold the image in 'im' as a matrix of vectors RGB

imshow(im); // display image
end; // finish of the main loop

This example is the first step to complex computational vision algorithms.

quarta-feira, 6 de agosto de 2008

Scilab simulation enviroment

This is my first post in english. I like the Scilab, so it's the subject of this post.

The Scilab is a simulation enviroment to numeric computation, i. e., the Scilab have many resources to solve complicated problems.

Examples of aplications that I work in Scilab:
  1. Neural networks;
  2. Genetics Algorithms;
  3. Analysis os temporal series (in economy);
  4. Digital images and signals processing;
  5. Computational vision;
  6. Electromagnetism.
The most important work that I developed was a new algorithm to detect and localize critical points in digital images, I have used details enhacement in this work and the classical technics uses boundary analysis.

The Scilab has many toolboxes, for example: SIVP - Scilab Image and Video Processing toolbox and SWT - Scilab Wavelets Toolbox (this have functions for signals and images). The Scicos is a graphical simulation enviroment, this is on the Scilab (called by "scicos" in prompt), with the Scicos is possible to develop "getting blocks", this is a easy and fast mode to work.

To finish, the Scilab is a free software and doesn't have less resources than proprietary softwares.