Quello che mi viene in mente è che il frame catturato non abbia le caratteristiche che tu pensi che debba avere nel tuo programma (640 x 480 IPL_DEPTH_8U) ...
Dovresti cercare di ottenere (non so con quale funzione) le caratteristiche del frame letto.