First foray into the openCV world - fix the it only works the firsttime problem