Scilab. what is it? Scilab is a free, high level, scientific programming language which is an
acceptable substitute for Matlab. got that? no? find out more about scilab here. I first
encountered scilab 5.3.0 back in AP 185. So when we saw the activity 2 manual and read that scilab was needed, I thought 'oh yeah, got that installed already, all i need to install is the SIVP
(Scilab Video and Image Processing)' or so i thought. Downloading SIVP was easy, I downloaded the 0.5.3 version. Installing it however, is another story. I don't know how long I spend on trying to install sivp. argh, it was so frustrating. Then Kuya art and BA (love you guys) offered advises via twitter (I was 'sort of' ranting in twitter :D) on how to install sivp. after installing sivp successfully-ish, I tried to execute the example in the manual, creating a centered circle. I tried to copy-paste the code (see below) to scilab, unfortunately, everytime I execute it, it will always say that there's an error with 'imshow'. what?! so i restarted scilab again, same thing happened. after doing it for about 5times, i was so sleepy already that i decided to continue doing the activity the next day. Bad idea.
Figure 1. Code for the centered circle (from the manual)
The next day, class time. I was trying to run the circle code again. to no avail. argh. I realized my "successful" installation wasn't exactly successful (#@$@#%$). I decided then to uninstall scilab and install an older version, the one suggested in the manual. Scilab 4.1.2 with Signal and Image Processing (SIP) Toolbox instead of SIVP. OMG! it worked!!!EUREKA!! I don't know what I would have done if it hadn't work. The figure that came out is shown below.
Figure 2. Centered Circle.
Cool!:D so the next part of the activity was to create different figures: Centered square aperture, sinusoid along the x-direction (corrugated roof), grating along the x-direction, annulus, and a circular aperture with graded transparency (gaussian transparency). This figures will be shown below after the code that was used to create the iamges.
First, the centered square aperture. I just recycled the circle code. The code used for the
centered square aperture is shown below.
Figure 3. Centered Square aperture code.
And the result!:D ta-da!
Figure 4. Centered square aperture.
Next, was the sinusoid along the x-direction (corrugated roof). The circle code was also recycled. I revised the circle code in a way that instead of using an equation for a circle, I used a sinusoidal equation, in this case a sine function.
Figure 5. Sinusoid in the x-direction (corrugated roof).
The figure generated is shown below.
Figure 6. Generated sinusoid in the x-direction.
Next up, grating along the x-direction. This one was sort of difficult for me. I didn't know how I'd make a grating. After having help, finally figured out how to do it, I just hope it's right.
Figure 7. grating in the x-direction code.
This took a long time to generate a figure. There was a problem, since i restarted scilab again (as it was hanging T.T), i forgot to load the sip toolbox (boo). After realizing my mistake (with elo's teaching:D), the figure below was generated.
Figure 8. generated grating figure along x-direction.
Second to the last, annulus. I didn't know what this was. So I googled it, see here for an insight to annulus.:D Once again, the circle was recycled. This wasn't a big shock in this case. Since the
annulus more or less looked like a donut, revising the circle code was the best option. You just have to add another condition so that it would kind of generate a smaller circle within the circle code.
Figure 9. annulus code
Figure generated below. Donut-shaped ---> i'm hungry :))
Figure 10. the Annulus
Hmm, now that i think about it, it kind of looks like a target mat(?), hmmm... Moving on, The last figure. Circular aperture with graded transparency (gaussian transparency).. Say.. ?! Gaussian Function, look here. What I did was I just added a gaussian function into the code, w/ some other revisions.
Figure 11. Circular aperture w/ graded transparency (gaussian) code.
And finally, the figure. It looks a like a light at the end of a very long tunnel:D
Figure 12. Circular aperture w/ graded transparency (gaussian)
WOW. That was.. fulfilling (?). I've never done any work like this before. amazing. Hmm,, gotta practice then.:D I'd like to thank my classmates for the insights:D So, for this activity, I'd think I'd grade myself a 9. I did pretty good (I think), but I could have done better. Still. Need more practice for further improvement. I think I'll try and make other figures, haha playing around on scilab in my spare time:D Till next time :)
No comments:
Post a Comment