Tuesday, June 23, 2009

それでいいですか? (Activity # 3)

We were oriented with the different kinds of images today:
1. Binary - simply black and white images
2. Grayscale - shades of gray; where a pixel is given a value between 0 (black) and 255 (white)
3. True-color - has three color channels (usually in RGB)
4. Indexed - similar to true-color except it contains both the image and indexed RGB info.. it is safe to assume that most grayscale images are indexed.

We were asked to collect different types of images.. I selected four pictures, one for each basic type.

Binary

(My own generated image--same as Activity # 2)

FileName: activity_3.bmp
FileSize: 12864
Format: BMP
Width: 320
Height: 320
Depth: 8
StorageType: indexed
NumberOfColors: 2
ResolutionUnit: centimeter
XResolution: 28.340000
YResolution: 28.340000

Grayscale

(This is a picture from the Azusa Nakano Fanclub.)

FileName: 100720.jpg
FileSize: 70426
Format: JPEG
Width: 204
Height: 600
Depth: 8
StorageType: indexed
NumberOfColors: 256
ResolutionUnit: inch

XResolution: 72.000000
YResolution: 72.000000

True-color (the one here is in JPEG.. BMP is not web-friendly)

(Adding the Mahou Shoujo Lyrical Nanoha emblem makes me the final author of this image. If it interests anyone, I got the original background from moe.imouto.org)

FileName: nanoha_wallpaper.bmp
FileSize: 768056
Format: BMP
Width: 640
Height: 400
Depth: 8
StorageType: truecolor
NumberOfColors: 0
ResolutionUnit: centimeter
XResolution: 78.720000
YResolution: 78.72000

Indexed

(Just so you wouldn't think that I prefer 2-D girls over 3-D.. xD I got this fine picture of my favorite seiyuu and J-Pop artist, Mizuki Nana, from Sankaku Complex's Seiyuu Idol Gallery)

FileName: isisuke_uljp01368.png
FileSize: 46755
Format: PNG
Width: 300
Height: 240
Depth: 8
StorageType: truecolor
NumberOfColors: 256
ResolutionUnit: centimeter
XResolution: 117.720000
YResolution: 117.720000

[Edit: Included part b of the activity.]

Unfortunately, Activity # 3 does not end here. What's left to do is to use the area calculation routine in Activity # 2 for a scanned image in Activity # 3. A scanned image is used so that we can have a sense of its physical area, and compare this area with the one obtained using the Green's Theorem.




I got the image of Japan from my old volumes of Grolier's Encyclopedia of Knowledge (1999, Vol. 10, p. 316, JAPAN article.) What I did next was to lasso the Hokkaido part of the map, and paint black on a another layer. I removed the layer with the original map, and it left me with a black object on a white background. Then, I inverted the colors to get the second image, and had my contour follower perform the routine to get the last image to the right.

Now here comes the part where I give the details, enough to give the reader an information overload. Wiki tells me that Hokkaido has a land area of 77,981.87 km². The map was drawn to a scale of 1:10,615,000--proper conversion tells me that 1mm in the map is 10,615,000km in physical units (this was confirmed with the use of a ruler xD). The image was scanned to a resolution of 200 dots per inch. Now all that's left to do is the math:


Hehe.. getting that formula to fit the length of this blog site was rather tricky. In any case, the area calculation routine gave me 18691.5 pixels. Now, if were to compare this to our theoretical value, we realize that we have an error of 56%. Why that large of an error? Simply because the routine's weakness is concave curvatures, something that can be quite prominent to an outline of an island.

Oh well, at least the contour follower gave me one hell of an outline. It almost looks like the original pattern. If there's one thing we can learn from this, it's the fact that this area estimation routine has its limits and that more can be done to actually fine-tune its estimation.

P.S. I think I'll have to settle for a ROMANIZED title for my blog post. Will change it the moment I get home. CSRC computers don't have IME. T_T [Edit: Done!] [Edit: Added the imfinfo descriptions.. xD]

The only trick here is to make sure that the filename points to the file and to make sure the file extensions are there. Yey! I get another 10. xD

No comments:

Post a Comment