-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IplImage row alignment #1
Comments
The interface was coded a bit too hastily :-). In C, there's an API function called THTensor_getContiguous(), which creates a contiguous tensor from any tensor. In Lua, that function is just called :contiguous(). These should always be used/called when creating interfaces to other libs. |
I'm not sure how they would help in this case. For example, in the function
the copy is done like this
Whether tslice is contiguous or not isn't the problem. It's that we're treating the raw data from IplImage as if widthStep == width. I think this could be solved by dropping the macro and writing the inner loops, by padding tslice, or if you're feeling particularly evil by referencing the macro's loop variable inside the code we send it. |
I believe this was from a while ago, but fixed the bug in my branch and issued a pull request. Issue can be closed after pulled. |
Hi, |
The libopencv routines assume that IplImage data is contiguous, but the rows are padded to be 4 or 8 byte aligned (although I've only observed 4 byte alignment).
http://opencv.willowgarage.com/documentation/c/core_basic_structures.html#align
As an example, this works:
But this does not:
The text was updated successfully, but these errors were encountered: