Monthly Archives: October 2014

Image Histogram

Image histogram is a type of histogram that represent the lightness distribution in digital image. In order to clarify the idea, I am going to give an example.

Suppose we have an image, say depth is 2 bits (2 bpp). Therefore, the possibility value 0 – 3.

Sample Image

As I mentioned, histogram is going to represent the distribution of pixel value. You can see, there are 5 pixels with value 0, 7 pixels with value 1, 9 pixels with value 2 and 4 pixels with value 3. These information is tabulated as follows.

Pixel distribution

As you know, like histogram in math, histogram is presented using graph. The following graph represent the distribution in image above.

Image Histogram

Continue reading

Nearest Neighbor Interpolation for Resize Image

If you are not a computer scientist maybe you will think that resize image is an easy task. Just scroll the mouse wheel and all done. But do you know the process behind just “scroll the mouse wheel” ? I am going to discuss the simplest way of Image Scaling(what most people know as resize image). The most simplest way is Nearest Neighbor Interpolation, of course there are some other sophisticated interpolation methods.

Before we discuss about the method, It’s better if you’ve already known about the basic properties of image. If you aren’t , you can imagine images as a matrix. Look the picture below

Image[{{0., 1., 0.}, {1., 0., 1.}, {0., 1., 0.}}]
image matrix

Based on the picture above you can image if you have image with width=3 pixel and height=3 pixel so you have 3×3 matrix. If you have image 512×512 so you have matrix 512×512 (if your image pixel 8bpp or 1byte. I used 8bpp for example just for simple explanation).

Suppose we have 4×4 pixel image and we need to enlarge to be 8×8 pixel. We can imageine like this


Continue reading

Halo Dunia

Hi guys. After retired from blog, I’m coming back now. :D
This is my new blog. I would like to share about my life as a PhD student. My life in Hsinchu, Taiwan. Maybe to make me higher in intellectual :D sometimes I’m gonna share about my research or other “science” related to computer science.

I’m writing this post in my lab. If you want to know about my lab you can read brief information there. Here, some pic of my lab.

Gear in my Lab

Gear in my Lab

Continue reading