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

Use GetData() get an array of the wrong length #128

Open
grjiq opened this issue Mar 14, 2019 · 1 comment
Open

Use GetData() get an array of the wrong length #128

grjiq opened this issue Mar 14, 2019 · 1 comment

Comments

@grjiq
Copy link

grjiq commented Mar 14, 2019

I have a 1000(rows)*1000(cols)3(dims) mat, the i use GetData() to get a []byte, but the len of []byte is 3000.

@grjiq
Copy link
Author

grjiq commented Mar 14, 2019

func (mat *Mat) GetData() []byte { //return C.GoBytes(unsafe.Pointer(C.myGetData((*C.CvMat)(mat))), C.int(mat.step)) return C.GoBytes(unsafe.Pointer(C.myGetData((*C.CvMat)(mat))), C.int(mat.rows*mat.cols*3)) }
here C.int(mat.step) is 3000.

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

No branches or pull requests

1 participant