First time here? Check out the FAQ!
answered 2013-09-24 16:31:56 -0600
I tried your program and the null pointer exception was resolved just giving memory to the storage in the loop:
storage = cvCreateMemStorage(0);
Hope will help you!