I have an image loaded from a video:
Image<Gray, byte> imGray=cap.QueryGrayFrame();
Now, I want to use the cvCornerHarris function from openCv as following:
Image<Gray, byte> harRes = new Image<Gray, byte>(imGray.Size);
CvInvoke.cvCornerHarris(imGray, harRes, 8, 3, 0.04);
But I get an cvException:
OpenCV: src.size() == dst.size() && dst.type() == CV_32FC1 Error

How should I fix this?
You can deduce from the given exception, that the type of the destination image should be
CV_32FC1.In your case, the destination image is
harRes, which you have declared as:The type of this image is
CV_8UC1.It should be declared as:
Now its type is
CV_32FC1, which is the type expected by the functioncvCornerHarris.