Showing posts with label AP 186. Show all posts
Showing posts with label AP 186. Show all posts

Thursday, July 14, 2011

A5 - Enhancement by Histogram Manipulation

This is the image I chose for this activity.

This the grayscale of the image.This is the CDF of the image and the desired CDFThis is the histogram plot of the image.This is the histogram plot of the grayscale image and also the normalized histogram plot.This is the normalized grayscale image.After the backproject, this is the enhanced(?) image.
Using a gaussian CDF, this is the modified image that I got.
This is the histogram plot of the modified image. Note that it looks like a gaussian distribution function (more or less).
This is the CDF of the modified image.
For this activity, I'd give myself an 8/10. Same reason as the previous post. Check check check. :|

Estimation is Green - A4

All through out our education life, we have encountered 'area' quite a lot of time. But if you were asked to define 'area', how would you explain it? Maybe right now you're coming up blank as to its definition. From wiki, Area is a quantity that expresses the extent of a two-dimensional surface or shape in the plane. Area can be understood as the amount of material with a given thickness that would be necessary to fashion a model of the shape, or the amount of paint necessary to cover the surface with a single coat. It is the two-dimensional analog of the length of a curve (a one-dimensional concept) or the volume of a solid (a three-dimensional concept).

We were sometimes tasked to take the area of various objects. Area of a box, a circle, a paper, a triangle, any object and the list goes on and on. As we grow older, we also encounter 'area'.

The black and white regular geometric shape I chose. Using paint, I made this 150 by 80 pixel size white rectangle. This rectangle has an area of 12,000 pixels. Using Green's Theorem and Scilab, i got the value of 11,544 pixels as the area of the rectangle. This is quite close with the real value.















Next, we had to choose a location of our interest. I chose the Quezon City Circle. From Google Maps, I saved an image of the QC Circle.










In paint, I delineated the area of interest from the rest and the result is shown below:


















Using the same procedure and calculating the area of the image, I got the area of 50,549.5 pixels. To convert this to square meters, I used the techniques learned in Activity 1. From the QC circle image above, we can see the scale bar on the lower left corner of the image. Then 87 pixels = 200m in lengthwise. So converting/dividing, we can compute that 1 pixel in lengthwise = 2.299 meters and 1 pixel square = 5.28 sq. meters. Converting 50, 549.5 pixels, we have 267, 139.65 sq. meters.

For this activity, I'd give myself an 8/10. Although I did complete the activity I posted late because for some reason, my blog wasn't posted(it was only saved and needs to be edited yet). And since I didn't check if my blog was indeed posted, I deserve a deduction.

Monday, June 27, 2011

Image Types and everything nice

Pictures. They're everywhere. They're a part of our everyday lives. We always want to take a picture of something that happened to us. If one didn't bring a camera with him, he'd say, 'I wish I could have taken a picture of that' & etc. Pictures are either
hard or soft copies of our memories, may it be happy or sad. It's a means of preserving something that has happened to us. It's also a means of expressing oneself, because sometimes, the words are not that good enough or the words are hard to say.With our technology today,different image types now exists. How are they different from each other? What's the difference? They're one and the same. They're still pictures.

They are pictures. But different kinds of pictures means different image types. There are four basic image types: binary images, grayscale images, truecolor images, and indexed images.

Binary images are the simplest images. They are either black or white. A pixel can have a value of either one (1) or zero (0). It has a matrix size of MxNx1. Images are saved in binary if you are only interested in the line shapes. Examples of binary images are document text, fingertips, etc.

FileSize: 2660 Format:
PNG Width: 200
Height: 140
Depth: 8
StorageType: indexed
NumberOfColors: 2
ResolutionUnit: centimeter
XResolution: 72.000000
YResolution: 72.000000


Grayscale images comes next. These images are black and white images. Each pixel can have a value between 0 (black) to 255 (white). These are the images back in the past. But, you can see many photographers taking pictures in grayscale. Maybe, because in some sense, looking at a picture in black and white, you can see more details and you can appreciate the picture more than the colored one. Also, there's a sense of specialty in them. It also has a matrix size of MxNx1.

FileSize: 29342
Format: PNG
Width: 150
Height: 200
Depth: 8
StorageType: indexed
NumberOfColors: 256
ResolutionUnit: centimeter
XResolution: 72.000000
YResolution: 72.000000





Truecolor images are the basic colored images. Theses are comprised of three channels or bands. each channel is an intensity of a primary light (red, green, and blue). Truecolor images can come form many different sources. One is a digital camera. a Truecolor image has a matrix size of MxNx3.

FileSize: 1155749
Format: JPEG
Width: 1600
Height: 1200
Depth: 8
StorageType: truecolor
NumberOfColors: 0
ResolutionUnit: centimeter
XResolution: 100.000000
YResolution: 100.000000







Indexed images are images where colors are referenced to a color map index. Two sets of data are stored in an indexed image, the image and the color map.

Format: GIF FileSize: 10015 Width: 100 Height: 100 Depth: 8StorageType: indexed
NumberOfColors: 256
ResolutionUnit: centimeter
XResolution: 72.000000
YResolution: 72.000000



Now with the internet, and more advanced techniques and devices, there are also advanced image types. Some are: High dynamic range (HDR) images, Multi or hyperspectral image, 3D images, and Temporal images or videos.

High dynamic range (HDR) images. There are lost of scenes that require more than 8-bit grayscale recording in order to be very appreciated. According to wiki, HDR images are images that uses a set of techniques that allows a greater dynamic range between the lightest and darkest areas of an image than current standard digital imaging techniques or photographic methods.

FileSize: 384990
Format: JPEG
Height: 600
Width: 800
Depth: 8
StorageType: truecolor
NumberOfColors: 0
ResolutionUnit: inch
XResolution: 300.000000
YResolution: 300.000000








Hyperspectral Images are images that have more bands than 3 (for Red, Green and Blue). These images collects and processes data from across the EM spectrum (from wiki).
FileSize: 30398
Format: JPEG
Width: 311
Height: 311
Depth: 8
StorageType: truecolor
NumberOfColors: 0
ResolutionUnit: inch
XResolution: 128.000000
YResolution: 128.000000













3D images are images in the three dimensions.
FileSize: 1498967
Format: JPEG
Width: 2346
Height: 1760
Depth: 8
StorageType: truecolor
NumberOfColors: 0
ResolutionUnit: inch
XResolution: 72.000000
YResolution: 72.000000








Temporal Images or Videos. Moving Pictures. Their digitization, compression and method of capture has advanced dramatically.

The figure I chose to convert to grayscale and black and white is shown below(first figure). Its properties are listed above(under the indexed image). Turning it into black and white, I used the function im2bw and threshold values of 0.7 and 1 (2nd and 3rd figures respectively). To convert to grayscale (4th figure), I used gray_imread.










This is the scanned copy of the graph that I used for activity 1
The grayscale of this image is shown below.

Using histplot, I examined the graylevel histogram of the grayscaled graph image. The histplot is shown below.
Now, we have to convert our grayscaled graph image to black and white, but at what threshold would it be? Since our image is a graph(filled w/ lines), we have to choose the threshold value w/ the least number of points. For example, for the histplot above, we should choose our best threshold value from 0.0 to 0.6 and not from 0.6 to 1 (since those are already points from the background). To show the difference of all the threshold values, I made a video showing all the output images at different threshold values.
The best threshold value I think would be between 0.4 and 0.5. So I think it’s 0.45(figure below).

Image compression may be lossy or lossless. Lossless compression is preferred for archival purposes and often for medical imaging, technical drawings, clip art, or comics. Lossy methods are especially suitable for natural images such as photographs in applications where minor (sometimes imperceptible) loss of fidelity is acceptable to achieve a substantial reduction in bit rate(from wiki).

JPEG (Joint Photographic Expert Group) is a commonly used method of lossy compression in digital photograhy(here). This is the most commonly used image file format. Another file format is the Bitmap Image file. This image file is a common output of the Windows Operating System. The BMP supports all the four image types. Another image file type is the tiff (Tagged Image File Format). This file format is used for storing images, popular among graphic artists, the publishing industry, and both amateur and professional photographers in general (here).

PNG(Portable Network Graphics) is a bitmapped image format and video codec that employs lossless data compression. PNG supports palette-based images (with palettes of 24-bit RGB or 32-bit RGBA colors), grayscale images (with or without alpha channel), and RGB[A] images (with or without alpha channel). PNG was designed for transferring images on the Internet, not for professional-quality print graphics, and therefore does not support non-RGB color spaces such as CMYK.(here).

GIF (Graphics Interchange Format) is a bitmap image format. GIF images are compressed using a lossless data compression technique to reduce the file size without degrading the visual quality.(here)

For this activity, I would give myself a grade of 9. Although Ia was able to do the activity successfully, I submitted a late report. I would like to thank Ma'am jing for the support and wonderful advises. Thank you.