Hello, terminals! :) I am now a dual-OS user. hahaha! See!
|
Running Ubuntu on Windows |
When I learned that the easiest way to get done with the activity is to install Scilab in Ubuntu, I was quite excited. I have never really used Ubuntu (except for those rare cases when the computer I was assigned to in the lab is run by Ubuntu). I am a Windows user ever since I learned about computers. I only learned about Ubuntu when I entered college. Loser much? =D
I seized the opportunity and asked a friend about the things I should know about Ubuntu. I asked him if I need to reformat my laptop so that I can have a dual boot. He is a Computer Science Major, he should know. He suggested that in order to save time (since reformatting laptops take long), I can use VMware Player. It's a virtual machine player. I can run any OS in VMware Player without needing to have a dual boot in my laptop. Cool! There were problems during the installation, at first, but I managed to run Ubuntu successfully in the virtual machine.
Next target: INSTALL SCILAB
I successfully installed Scilab using the Ubuntu Software Center. The version of Scilab that I installed is 5.2.2. Now, it's time to install SIP. My first attempts were unsuccessful. Google proved to be the best source of help during that time. I had to Google how to install SIP. I came across lots of tutorials but none proved to be successful. Until, I finally succumbed to the text file that tells the user the proper installation. I was really hesitant, at first. I'm not used to using terminals. Thanks again to Jerome for introducing me to the basic commands such as sudo, cd, ls and sudo apt-get install. It was quite confusing at first. Then, I realized I had no choice but to really learn it so I tried to play around. What seemed to be complex became interesting and fun, especially when you see lots of lines flashing on the terminal. Sometimes, it's frustrating if I get messages like "Permission deniend" or "Error". Nevertheless, the anticipation that the everything will work well (at the bottom line) was quite fun. So, for the successful installation of SIP, I used the terminal (since it also cannot be found in Ubuntu software center). Look, I am now using a terminal!
|
Although this run failed, it was still amazing to see how the computer processed my commands. |
I downloaded SIP 0.5.6 from http://siptoolbox.sourceforge.net. I downloaded the source code.
However, before installing the SIP toolbox, I must have properly installed AnImal (Animated Imaging Library), the image processing library of SIP. For AnImal to be properly installed, I must first have installed first ImageMagick. So, I first downloaded the AnImal 0.15.5 and ImageMagick 6.7.8 . I got them from the following site:
AnImal - http://animal.sourceforge.net
ImageMagick - www.imagemagick.org
First, I have to manually extract the ImageMagick file (it's in tar ball file). Inside the folder, look for Install-unix.txt and follow the instructions. In your terminal, make sure that you are in the directory in which the file is located. Here are commands for the installation:
./configure
make
sudo make Install
make check
Once ImageMagick is successfully installed, install AnImal 0.5.15 using the same commands.
After installing AnImal, you may now install SIP toolbox.
First, type this command "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig". Then compile and install SIP using the same commands you used for AnImal and ImageMagick installation. Once the installation is successfully done, type "make autoload" in order to load SIP to Scilab. And there you go! A successfully installed SIP toolbox in your Scilab.
Of course, since I'm a newbie at installations like this, it took me three days to get everything right. But it was worth it! I can say that if not for those errors, I wouldn't learn how to properly use the terminals plus I've already learned basic Unix codes. Feels good to learn new things! :)
Since, I'm done with the installation. Let me now discuss how I did the activity.
Activity 4: Area Estimation
|
Test Images |
First, I converted the images to black and white. Using the code below,
|
RGB to Black and White conversion Code
|
Since, I have already installed the SIP toolbox. I used the function follow () in order to get the contour of the images and the coordinates of the the contour. Here is the code I used:
In order to get the area of interest, Green's theorem was used. According to the theorem, an area of interest (with no concavities) is calculated by getting the summation of its pie slices.
|
Summation of the Pie slices is equal to the area |
|
Green's Theorem |
To implement the formula above, I used the the following code:
And to get the accuracy of the algorithm, the code below was used.
|
Algorithm accuracy checker code |
The table below shows the results of the accuracy of my code.
Now, it's time to implement my code on area estimation.
My area of interest is the Quezon Memorial Circle. Here is its snapshot:
|
Quezon Memorial Circle
|
Post-processing was done using Paint. Here is the monochrome version of the image after post-processing.
|
Monochrome Image of the Map after Post-Processing |
|
Snapshot of the Area tool and the calculated area |
Using ratio and proportion, I found that 500m is equal to 107 pixels. I got the theoretical value of the land area from
http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm. Below is a tabulation of results.
The low percentage for accuracy can be attributed to the manual post-processing of the image and the defined area for the area tool for Google maps.
For this activity, I grade myself a 10 for learning Ubuntu and accomplishing the task at hand. :)
References:
1. Soriano, M. Area Estimation for Images with Defined Edges
2. theiszm.wordpress.com