Thursday, February 21, 2008

Bug in OpenCV

I wanted to capture an image from the web cam and convert that to gray scale in my application. I use openCV to do that. But when I directly convert the captured image to gray scale it returned a horizontally flip gray image of the original. but if I load an image using cvLoadImage() and then convert it to gray scale there was no problem. No flipping is involved. I think this was a bug in openCV. Correct me if I am wrong.

here is the code that cause the flipping,

CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );
IplImage* frame = cvQueryFrame( capture );

IplImage* gray = cvCreateImage( cvGetSize(frame), 8, 1 );
cvCvtColor( frame, gray, CV_BGR2GRAY );

Sunday, February 3, 2008

Einstein's Challenge

Would you like some brainstorming challenge. Here it is. It is often called "Einstein's Puzzle" or "Einstein's Riddle" because it is said to have been invented by Albert Einstein as a boy. Some claim that Einstein said "only 2 percent of the world's population can solve it". But I believe it should be more than 2% if they given sufficient time. so here it is, ENJOY !!!!!!!!!!!!!!!

There are 5 houses in 5 different colors. In each house lives a person with a different nationality. The 5 owners drink a certain type of beverage, smoke a certain brand of cigar, and keep a certain pet. No owners have the same pet, smoke the same brand of cigar, or drink the same beverage.
  • The British lives in the red house.
  • The Swedish keeps dogs as pets.
  • The Danish drinks tea.
  • The green house is on the left of the white house.
  • The green homeowner drinks coffee.
  • The person who smokes Pall Mall rears birds.
  • The owner of the yellow house smokes Dunhill.
  • The man living in the center house drinks milk.
  • The Norwegian lives in the first house.
  • The man who smokes Blend lives next to the one who keeps cats.
  • The man who keeps the horse lives next to the man who smokes Dunhill.
  • The owner who smokes Bluemaster drinks beer.
  • The German smokes prince.
  • The Norwegian lives next to the blue house.
  • The man who smokes Blend has a neighbor who drinks water.
the question is , Who owns the fish?


try it your self, it's fun. Here is the answer..........................

But don't look at it till you finished.




House 1

House 2

House 3

House 4

House 5

Nationality

Norwegian

Dane

Brit

German

Swede

Color

Yellow

Blue

Red

Green

White

Pet

Cats

Horses

Birds

Fish

Dog

Beverage

Water

Tea

Milk

Coffee

Beer

Cigarettes

Dunhill

Blend

Pall Mall.

Prince

Blue Mstr




Thursday, January 31, 2008

Inter department tournament

Today we have participated to our inter department cricket tournament. As we are now in our final year this is the last tournament we are competing in the university. Though our team couldn't make it to the finals, it's a great pleasure to took part in such an event as all the batch mates from different departments had the opportunity have a good time with their friends from other departments. Department of Civil Engineering won the trophy and Department of Mechanical engineering was the runners up.

Wednesday, January 30, 2008

Erlang Rocks

Erlang is a general-purpose concurrent programming language. It was designed by Ericsson to support distributed, fault-tolerant, soft-real-time, non-stop applications. It supports hot swapping so code can be changed without stopping a system. One of the main reasons for using Erlang instead of other functional languages is Erlang's ability to handle concurrency and distributed programming. So why don't you try this. believe me you'll love it .