Wednesday, April 20, 2016

Topping the tulips


Tulips grown in natural habitat go through a life cycle to look like perennial plants. They need cold winters and hot airy dry summers.

Life of tulips start from the bulbs we plant. They bloom using energy from bulbs, they create new bulbs using remaining energy and bulb will die as it is all used up,  Planting is done in early fall. Root expanding happens in winter. Sprout starts in spring. Blooming takes place in hot summer. Disintegration starts from that time and new bulbs will be formed. They start growing by accumulating more energy from environment. The period from blooming to plant dyeing is called as grand period of growth.

Growers in Holland and Seattle dig their tulips every year and give temperature treatment to their bulbs manually and replicate what they receive in their natural region. Growers from regions with year around cold weather give temperature treatment to new bulbs. Growers from regions with year around hot weather give cooling treatment to bulbs.

Tulip growers top the tulips when they bloom fully. They do that for three reasons.
  • They do not want petals of flowers falling into foilage and cause plants to rot and die before new bulbs had chance to grow.
  • They want to use all energy for new bulbs to grow and avoid new seedpod consuming energy and create small late blooms.

Monday, March 21, 2016

Unix

In the words of one of the founders of Unix,  the best thing about unix is it's community and not the tools, files, c language, portability or open source, and the worst thing about unix is that there are many communities.

References:
Good, Bad and Ugly about Unix

Friday, March 18, 2016

telecine 2:3 pulldown

Films are shot and projected at 24 frames per second. NTSC based televisions and monitors display 60 pictures per second. The technique to convert from film fps to telivision fps is called telecine process.

First each input frame is divided into two fields, odd and even scan lines. This is called interlacing. It reduces the bandwidth to transmit by half.

Next it follows a field duplication method called 3:2 pull down. Since 60/24 = 2.5 = 5/2, we need to create five pictures out of every two frames. It repeats the first field two times and second field three times and so on for the odd and even number pictures.

If the input is already interlaced for broadcasting and we want to display on computer monitor, we need to deinterlace at the least to properly display it. It is not simple summing the fields into one picture and need some averaging of some pixels from adjacent fields. Pictures are not static and they are half pictures of two consecutive pictures of motion. If it is telecined, then deinterlacing is more than the averaging the adjacent pictures and involves finding the right pictures to average.

The term pulldown is actually about slow down. It was mandatory to have color television broadcasting to allow old black and white televisions to continue to work. They continued to transfer luminescence or lightness or brightness information along with chrominance or color information. They were also concerned about additional bandwidth required to transmit color information to black and white telivsions. They slowed down the frames per second by transmitting only 1000 frames during the interval 1001 frames were transmitted earlier.

References
Wikipedia page 3:2 pulldown process
Apple tutorial telecine process
Miscrosoft doc temporal rate conversion
Framerate follies trick

Saturday, March 12, 2016

Gamma coding


Humans are more sensitive to relative differences between darker tones compared to relative differences between lighter ones.  This is some kind of power law. 


If we simply linearly encode the image for all hues, we need to allocate too many bits to store it and also cause too much bandwidth to transmit it.  Assuming humans can respond to luminescence values 100 to 1 and can detect the contrast ratio of two values that exceed 1% or 1.01 delta, we need to encode values 1, 1.01, 1.02, .... 99.09, 100 and the total number of codes needed is 99/0.01 or 9900 codes or 14 bits for each tone. We also end up using few bits to shadow values that humans are sensitive to and that will be lost opportunity to improve the quality. We use more bits to portions that humans are not sensitive to and that will be additional cost with no improvement to visual quality. So linear encoding is not good from both the compression and quality point of view.


If we use the observation that most highlights cannot be differentiated by humans, we can employ nonlinear encoding.  If we encode only ratios starting from 1,  1 + 0.01, (1+0.01)^2, ... , then we need just  log(100)/log(1.01) or around 462 codes or nine bits. If a television or display has only contrast ratio of 50:1, then it is just eight bits.



Power law :  Vout = Vinγ


Gamma(γ) is slope of log plot of input and output. Most of our images are encoded with 0.45 gamma value and decoded with 1/0.45 or 2.2  gamma value.  There is another power law in place in CRT based display monitors. The light produced on the display is approximately proportional to the applied voltage raised to the 2.5 power. This is also called gamma. This is amazing coincidence that vision gamma or image gamma is kind of inverse to display or monitor gamma. The net effect of applying both gammas is called system gamma and ideally should be 1.0. 



References

Gamma correction
Gamma FAQ
System gamma

Thursday, March 3, 2016

Mirrors and images

Characteristics of the image formed when an object is placed before a plane mirror.

  • Image size is same as the size of the object. Magnification factor is one.
  • Distance of image from mirror is same as the distance of object from mirror.
  • Image is upright and not inverted.
  • Image appears left and right reversed.
  • Image is virtual. It appears like it is formed in the back of the mirror where the light can not even reach.
Single mirror produces one image. When an object is placed between two mirrors, there will be more than one image. When the mirrors are placed together to form a right angle, then the number of images formed is three - one in each mirror and one in the crease. When the mirrors are placed with 60 degrees, then the number of images formed is five.  When the angle is theeta, the number of images will be (360/theeta -1). 

The more accurate formula depends on the angle and the position of the object.  This was from a paper by V.M. Kulkarni in 1960.


  • When 180/theeta is integer x, then the answer is 2*x - 1,
  • When 180/theeta is integer x + 0.5, then the answer is 2*x when the object is on angular bisector or symmetrically located with respect to two mirrors or 2*x + 1 otherwise.
  • When 180/theeta is integer x + (n/q), then the answer is 2*x or 2*x +1 depending on whether the object is located on central angular sector of (q-2*n) about the angle bisector.
  • When 180/theeta is ineger x + (n/q), then the answer is 2*x or 2*x +1 depending on whether the object is located on central angular bisector of (2*n-1) about the angle bisector.


References
Light from Physics Classroom
Patterns in Multiple Reflections

Monday, February 29, 2016

Smorgasboard


Smörgåsbord is used to refer to a buffet table with variety of dishes.

It was originally a type of Scandinavian meal originating in Sweden. It is served with multiple hot and cold dishes on the table.  

The meaning of Smorgasbord is open faced sandwich table. Smor is butter. Gas is goose but referred to butter floated to surface of the cheese. Bord means table.

Sandwich is two slices of bread with some food filling between them. Open faced sandwich is a single slice of bread with food items like cheese spreads, butter, meat slices, sausages and vegetables on top of it.

A special Swedish smorgasbord is Julbord or Christmas table. Jul means Christmas and bord means table.

References
Smorgasboard

Sunday, February 28, 2016

Grand Slam Tennis


Grand slam tournaments are four major annual tennis tournaments that offer most ranking points, prize money and popularity.
  • Australian Open in January on hard court in Melbourne started in 1905
  • French Open in May or June on clay court in Paris started in 1891.
  • Wimbledon in June or July on grass court in London started in 1877.
  • US Open in August or September on hard court in New York since 1881
Winning all four tournaments in same year winning grand slam. Don Budge in 1938 is the first official champion. Rod Laver won it two times in men's singles in 1962 and 1969. Margaret court won once in women's singles and twice in women's mixed doubles. Esther vergeer won twice in women's wheelchair doubles. Stefen Edburg won in men's juniors. Three women, Martin Connolly Banker in 1952, Margaret Court in 1970 and Steffi Graph in 1988 won all grand slam titles in single year.

Winning four grand slam tournaments in any year is called career grand slam. Six men including Fred Perry, Don Budge, Rod Laver, Roy Emerson, Andre Agassi, Roger Federer and Rafael Nadal are career grand slam winners. Ten women, Martin Connolly Banker, Doris Hart, Shirley Fry Irvin, Margaret Court, BillyJean King, Chirst Evert, Martina Navratilova, Serana Williams and Maria Sharapova won career grand slam in women's titles.

Winning Olympics gold medal along with four tournaments in same year is called golden grand slam. Winning four grand slam tournaments and an  Olympics gold medal is called  career grand slam. Andre Agasse is the first male player to win it.

Dong Budge won six consecutive singles grand slam titles. Roger Federer won 17 grand slam men's singles titles. Pete Sampras and Rafael Nadal won 14 grand slam men's single titles. Rafael Nadal won 9  French Open singles titles and that is the highest in a men's single tournament. Pete Sampras and Roger Federer won seven Wimbledon singles titles.

Margaret Court won 24 grand slam women's singles titles. Steffi Graph won 22 grand slam women's singles titles and is the only winner of golden grand slam in 1988. Serena Williams won 21 gran slam women's singles titles. Hellen Wills Moody won 19 grand slam women's single titles Chris Evert and Martin Navratilova won 18 women's singles titles. Margret Court won 11 Australian Open single titles. Chirst Evert won 7 French Open singles titles. Martina Navratilova won 8 Wimbledon titles. Molla Mallory won 8 U.S. open titles.

References