Changed main + opencv code

opencv skip some code for vtk viewing thread (new stuff)
main changed while loop  ( we have to look into that)