viernes, 3 de octubre de 2014

Robot?


 Muchas veces nos tropezamos con esta palabra en nuestro lenguaje cotidiano, y aunque no lo parezca, la definición surge de cualquier cosa que haga movimineto u operaciones automáticas. En esta entrada, hablaré un poco de esta definición con el fin de compartir opiniones y resultados de búsquedas que he realizado a lo largo de mi corto trayecto con la construcción de equipos móviles. No pretendo realizar una descripción detallada como la ofrece Wikipedia o Monografías, solo desarrollaré una serie de ideas para describir a los equipos que se identifican con el nombre de robots.

miércoles, 1 de octubre de 2014

My Robot HAN-Bot

It has been a long time since I write a new post. But today I want to talk you about a personal project related with robotics and computer system... That project its named HAN-Bot.

Why HAN-Bot? the name HAN, represents the initials of the names Horus, and ANgela. The first name corresponds to an Egyptian symbol, the "Eye of Horus " that represents the posibilities of my robot to see the real word with the help of a web-cam. And the second name, ANgela, it's a personal reason for dedicate to an important women in my life... and Well "Bot" indicates that its is a robot.

domingo, 3 de agosto de 2014

First Project with OpenCV: inRange Code for detect objects.

Well the following code let us, to remove all of elements of the pictures that are not of our interest using OpenCV and Java. For realize it, its necesary to use the inRange method (more information here). The first step is to convert the image in HSV format and them apply the inRange code.

 import org.opencv.core.Core;  
 import org.opencv.core.Mat;  
 import org.opencv.core.Scalar;  
 import org.opencv.highgui.Highgui;  
 import org.opencv.highgui.VideoCapture;  
 import org.opencv.imgproc.Imgproc;  
 import values.MyIntegers;  
 /**  
  * @author aldajo  
  */  
 public class InRange {  
   public static void main(String[] args) {  
     System.loadLibrary(Core.NATIVE_LIBRARY_NAME);  
     VideoCapture camera = new VideoCapture(1);  
     Mat framevideo = new Mat();  
     camera.open(1);  
     camera.read(framevideo);  
     Highgui.imwrite("image.png", framevideo);  
     Highgui.imwrite("imageInRange.png", preproc(framevideo));  
   }  
   public static Mat preproc(Mat frame) {  
     Mat preprosMat = new Mat();  
     Imgproc.cvtColor(frame, preprosMat, Imgproc.COLOR_RGB2HSV);  
     Core.inRange(frame, new Scalar(242, 228,103),  
         new Scalar(255, 255, 255), preprosMat);  
     return preprosMat;  
   }  
 }  

I used the above code and I got the following pictures:


Of course, you need change the values of the range for achieve it...

I have configured NetBeans for use the OpenCV library...

First Project with OpenCV: single code for web-cam capture.

Well, today I want to share you a simple code that let us to show a single frame from web-cam. The simple code uses OpenCV, and Java code... I have configured NetBeans for uses the OpenCV library.

 import org.opencv.core.Core;  
 import org.opencv.core.Mat;  
 import org.opencv.highgui.Highgui;  
 import org.opencv.highgui.VideoCapture;  
 /**  
  * @author aldajo  
  */  
 public class SingleCameraCapture {  
   public static void main(String[] args) {  
     System.loadLibrary(Core.NATIVE_LIBRARY_NAME);  
     VideoCapture camera = new VideoCapture(1);  
     Mat framevideo = new Mat();  
     camera.open(1);  
     camera.read(framevideo);  
     Highgui.imwrite("image.png", framevideo);  
   }  
 }  

The value in VideoCapture construct and camera.open method correspond to the number of the camera device in your computer. If you have only a web-cam, the value is 0.

I used the above code , and I have the following capture (my camera is a logitech c920):


viernes, 16 de mayo de 2014

First Project with OpenCV: Objetives.

Well, let's start with my project with openCV. The idea is to recognize differents robots with the help of a webcam. Suppose that we have differents robots, in a place. The objective is to get the position of the robot in pixels, and create a system that let us to locate the robot. For that, we use openCV library with Java language. For this project, is required the followings items:

- A computer, that run the program with OpenCV.
- A webcam (for the moment, any camera is useful)
- Differents sheets.

The idea with the sheets, is to create a pattern that identifies the robot, and have a specific characteristic, easy to identify for the program through the program with OpenCV. For this first project, is necessary only calculate the X and Y position. No is necessary consider, initially, the rotation of the robots (this is very useful, but the idea is to realize a simple Artificial Vision Algorithm).


If you have any suggestion, or you iddentify an error in my write, I hope your comments.

martes, 13 de mayo de 2014

Content on English for integrate users of other countries.

Well, for a short time, I publish my writes on this space on English because, I want to share a project with people from other countries, and to stimulate the English on many peoples... I thank your understanding.... And I hope your comments, a plus or like...