I am using OpenCV to develop a retinal recognition application. Initially I was using VS2010 but had to switch because of problems with integrating OpenCV with Windows Forms. Now the same source code which works as a VS2010 console app gives me a SIGSEGV error on Qt. The error always occurs on the following line

Qt Code:
  1. scalaire_moy=cvGet2D(MOY, y, x);
To copy to clipboard, switch view to plain text mode 

where scalaire_moy is a cvScalar which holds the value of the pixel x,y in IplImage MOY. I have checked and x, y are well within bounds, and the error always occurs at pixel 560x400 i.e the code works up to a certain point. Commenting out the function only generates the same error with another cvScalar down the line ad infinitum. The code works fine in VS2010 Please help this project is due in ten days and I don't know what to do!!!