I am using Opencv in Visual Studio 2012 with C++ in a Console Application.
fastx and fasty are both pointers to image matrices, a cv::Mat. When i hit i=1194 fastJy crashes when assigning it a value. Using break points, it seems that fasty has a value of '<Unable to read memory>' when the variable is inspected.
This is odd as i am still using the Jy.step with the Jx matrix. Both matrices are initialized with the same constructor, just before the function is calledas shown below.
You're passing default-constructed cv::Mat4 objects to the function. Look closely at line 3 of the last code block you posted. Also, you're passing by value. Does cv::Mat have valid copy / move constructors? Also...fastJx and fastJy are not declared identifiers in the code you posted.
I have corrected the mistakes in the above post so it reads correctly.
1) You're passing default-constructed cv::Mat4 objects to the function. Look closely at line 3 of the last code block you posted.
This was an error. This is a much simpler version of the issue without all of the variable names that would clutter and make the problem unclear. Apologies.
2) Also, you're passing by value. Does cv::Mat have valid copy / move constructors?
Would a reference be ok? OpenCV uses smart pointers so only headers are created when a cv::Mat is created. It is designed to minimise data duplication for large data.
3) Also...fastJx and fastJy are not declared identifiers in the code you posted.
As above, spelling mistakes on my part.
The issue is the access violation. It doesn't happen with Jx, just Jy. How do i even begin to investigate this?