Skip to content
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

rows(), cols()... now returning -1 if not 3D #275

Merged
merged 2 commits into from
Dec 5, 2018
Merged

rows(), cols()... now returning -1 if not 3D #275

merged 2 commits into from
Dec 5, 2018

Conversation

HGuillemet
Copy link
Contributor

No description provided.

@saudet
Copy link
Member

saudet commented Dec 5, 2018

BTW, a semi-related question, I don't think this is actually true, what do you think?

     * {@code strides[i] > strides[i + 1] && strides[strides.length - 1] == 1} must hold.

https://github.com/bytedeco/javacpp/blob/master/src/main/java/org/bytedeco/javacpp/indexer/Indexer.java#L61

@saudet saudet merged commit 32610ea into bytedeco:master Dec 5, 2018
@HGuillemet
Copy link
Contributor Author

From the OpenCV doc about Mat:

Note that M.step[i] >= M.step[i+1] (in fact, M.step[i] >= M.step[i+1]*M.size[i+1] ). This means that 2-dimensional matrices are stored row-by-row, 3-dimensional matrices are stored plane-by-plane, and so on. M.step[M.dims-1] is minimal and always equal to the element size M.elemSize() .

So for Indexer (when indexing a Mat), your assertion should hold.

@HGuillemet HGuillemet deleted the hg_indexer_nD branch December 5, 2018 09:09
@saudet
Copy link
Member

saudet commented Dec 5, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants