Oct 22 2008

Computer Vision Project

Computer Vision

Another project that I am working on is a computer vision problem for my software engineering class. Our goal is to use a robotic arm to find and pick up a fallen soda can to set it upright.

My position on the project is dealing with the computer vision.  I’ve basically written all of the code for this rather large piece of the puzzle making good use of Intel’s OpenCV library.  This library helps to connect to the webcam, capture a frame, conduct an edge detection algorithm, and to draw some pretty circles for me.

As far as the algorithm for detecting the corners, it’s rather expensive.  It’s close to o(n²) 4 times, but it doesn’t really search the entire image. For each corner, I move in on the object. A picture would do better justice.  Imagine each line moving along the image until it gets to the object.  So the top left scans right, and moves down.  The top right scans down, moving left…

Scanline Algo

It gets the job done for this project, but I can’t quite figure out how I could improve it (not that I’ve had a lot of time to think about it).  The arm of the bot needs the center point of the object  (x,y) and the angle of the object. The angle is computed with point B and the line intersection.

The project isn’t done.  The next big step is figuring out what side of the can is the TOP.  But I’m ahead of the curve and thought I’d share what I’ve been doing.


Oct 16 2008

voted!

Not that it is any surprise for whom I picked.  I’ve been following Obama for the past 2 years, after initially following Hillary for a brief point of time (a month or so) before I realized who this Obama fellow was.  I’ve always kept an open mind about who I vote for being an independent. But I just can’t envision seeing a Republican hold the office of the presidency for the next four to eight years.

In a largely republican state, people often question why even bother voting.  I’ve fought for this privilege in Iraq, and served with extreme honor for this country.  I, truly, appreciate the value of having the right to vote in our election cycle because I understand.  I understand that nations around the world bleed just to make their voices heard, while others don’t even have that luxury.  I understand that if you want anything to happen, your voice is your only chance to carry your desires to the next level.   I understand that to have this nation fall further is not an option, our voices are needed now more than ever.  To take a spare moment of my day to bubble in an ballot sheet is hardly a feat compared my day-to-day activities, and the kind of things that I’ve devoted my time to in the past.  With the ease of absentee voting, there really is no excuse to not be part of the system.   Find a democratic friend, and ask them about the candidate.  Find a republican friend, and ask them, too.  Hear the opinions, and decide for what YOU believe in.  It’s your voice, why keep it bottled up inside?

So why in the world did I chose Obama?  A largely unknown figurehead in US politics?

I have little concern for a deep history of a candidate.  I’m much more concerned with somebody who can speak intelligently, who can inspire a world, who can use his judgment to surround himself with bright people, and somebody who cares about the future of this country.  I want somebody who is not afraid to challenge the norm, and most of all I want somebody who is ready to try something vastly different.

I also am a true believer that prosperity does move from the ground up.  I hope to own a business some day, and if I made a lot of money, I would fully support playing into the system.  You only need so much greed before it becomes mundane.  Yes, you were very, very lucky to get to the position that you’re at.  You probably worked your ass off to become that wealthy.  Does that mean that people need to be so damn greedy that they can’t try to bring up another generation of businessmen and women?

We have a saying in the military, “You’re only as strong as your weakest link.” Time to focus on our weakest links.


Oct 14 2008

Plug-In Based Architecture for Application Tool Development

So for the past week or so, I’ve been really crunching down on two different plug-in architecture with C#: Reflection and System.AddIn.

Why?

Well, I want to create a much more robust 2D RPG editor than I’ve done in the past.  I want to give people the foundation to build off of while allowing me to learn how to make a dynamic tool that can continue to grow beyond what I do to it. And Jeff motivated me to do it.

I decided not to use Reflection because I really didn’t want to sit here and spend time creating all kinds of security links between my application and the plug-in.  While System.AddIn is incredibly tedious, I feel that it will be worth it in the long term.

So to get my hands dirty with the AddIn framework, I developed a plug-in based calculator prototype.

Prototype Plug-in Editor

There are 3 different development pieces that construct the ‘pipeline’ between the application and the plug-in. The project structure is pretty strict. You can see that, here.

The Contract 

  • Contract – Isolates the Plug-in for better sandboxing and robustness of the host application. Think of this as the formality that the HOST and the PLUG-IN must adhere to.

The Host:

  • View – Defines how the HOST application sees the ADD-IN
  • Adapter – Converts the CONTRACT to the HOST view
  • Application – Your application

The Plug-In

  • View – Defines the base class for the ADD-IN.  This is what you distribute to people, to build their plug-in from.
  • Adapter – Converts the VIEW to the CONTRACT
  • Implementation – Your plug-in

As far as plug-in development goes.  The only concern is with the AddIn view, which will be provided.  In it, we have our abstract class.

using System.AddIn.Pipeline;

namespace AddIn.View
{
[AddInBase]
public abstract class AddInView
{
public abstract int ComputeNums(int x, int y);
public abstract string GetSign();
}
}

Which can be used to actually define our method declarations.

using System.AddIn;
using AddIn.View;

namespace Addin.Addition
{
[AddIn("Addition Plug-In",
Version = "1.0",
Description = "Add 2 Numbers",
Publisher = "David McGraw")]
public class Addition : AddInView
{
public override int ComputeNums(int x, int y)
{
return (x + y);
}

public override string GetSign()
{
return “+”;
}
}
}

The application is build to search the plug-in directory for *.dll files, and will load them if they match the contract. As a plug-in developer, this is little of to no concern as long as you followed the view.

Play with the prototype here, if you want. I hold no promises that it won’t blow up your computer.  Feel free to implement divide, I provided the source for plug-in development.


Oct 9 2008

No doubt these are some tough times

This is my first involvement in this sort of financial disaster and I have to admit that it has been one hell of a ride.  It definitely takes a gut of steel to stomach these steep declines in the market, and I’ve got to imagine that we are close to a bottom.

But just remember, every disaster has a bottom.  Professional investors are just sitting on the side lines with their cash on hand to dive right back into the action.  I’m looking at stocks that are extremely discounted because they have been beaten to death. There is nothing fundamentally wrong with these companies! People just jumped off the ship because they were scared as hell.  Which, is a natural reaction.  Nobody in their right mind wants to lose money.  But if you sell, you LOCK IN those losses.  If you don’t sell, you have time on your side to recover that money unless you are very close to retirement.

And you’ve got to realize.  You’re not the only one getting thumped.  Order will restore itself eventually, and I believe it’ll happen pretty soon.

In other news, this job search is a pain-in-the-butt.

I can say without a shadow-of-a-doubt that network contacts are so freaking vital it’s not even funny.  It’s not like I didn’t know this (see: Darius, this applies to even more than the gamedev industry), but seeing the value of it first hand is mind blowing and it really makes me wish I would have pounded MUCH harder on it.  So if you are a freshman or sophomore, listen up.  Get on it.

It doesn’t help when you are searching for a job in a recession, nor does it help when you are applying during the time when companies typically go through a hiring lull (Fall).

I’m optimistic.  I know I’m valuable.  I’ve been admired by those who have led me, and those who have followed me.  I also know how hard I work in a business environment.  I mean, hell, some day I want to be an entrepreneur.  Not just an entrepreneur, but a successful entrepreneur.   Raw passion, an eye for initiative driven opportunities, and a motivated attitude all drive my work ethic.

65 days until graduation.  I’m excited.