Thursday, January 27, 2011

Playing Around With Matlab

For the first class, the professor walked us through some basic image manipulation using matlab. I won't post the specifics, in terms of what I did for each manipulation, but I will post the end result.




First here's the original image. Basically I just took a jpg I took with a digital camera. In this case it's an image of the Nationals Scoreboard in Washington, DC.
Original Image
Next I converted the image to a .gif. In matlab I loaded the image as the image and the color map. Next I opened up the image without the color map. The following is just an image with the different color extremes.
Image with color map extracted
With the color map extracted I generated a new gray scale color map and applied it to the image. The following is the result of the image with a gray scale color map applied.
Image with gray color map
Next I created a red scale color map and applied it to the image
Image with red color map
Now we take a green color map and apply it
Image with green color map
Now the image has a blue color map applied to it
Image with blue color map

Next time: Adding two images together

How to Connect to Matlab on the Mason Server

For this course, we'll need to use the tool Mat Lab to manipulate the images. Matlab can be purchased from the GMU bookstore for $99, (at the student rate). In addition all of the servers on mason have it installed. As long as you run a ssh session with the -X -Y flags added, you can run Matlab remotely. Please note, only George Mason University students can do this. Also the following was done on Windows 7.
  1. Obtain access to the mason server.  Go to http://mason.gmu.edu/ and follow the instructions to set up an account. 
  2. Download Cygwin and Cygwin-X: Go to http://x.cygwin.com/ and download cygwin and cygwin x. 
  3. SSH into the mason server: Open up XWinServer. Right-click on the server and open up a ssh session.

    Log in with your password.
  4. Run Matlab: It may take a few minutes, depending on connection and such:

  5. Start Using Matlab