-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Help #543
Comments
You should use the imdecode function, but first convert the slice to unsafe { Mat::new_rows_cols_with_data_def(1, jpg_buff.len() as i32, u8::opencv_type(), jpg_buff.as_mut_ptr().cast::<c_void>()) } Just make sure that you drop this |
thanks. converting the slice to Vector by calling Vector::::from_slice(jpeg_buff) works but the new_rows_cols_with_data_def dont work. unsafe { Mat::new_rows_cols_with_data_def(1, jpg_buff.len() as i32, u8::opencv_type(), jpg_buff.as_mut_ptr().cast::<c_void>()) }
|
When you say it doesn't work what kind of error are you getting? |
I'm going to close this for now with the hope that you made it work, but feel free to reopen and supply additional details if it's not the case. |
Hi,
I got a jpeg buff ,I want to convert it to opencv Mat for more image opration .
I have tried the Mat::from_raw 、Mat::new_rows_cols_with_data_def 、Mat::from_slice 、Mat::from_slice_rows_cols
it all got wrong,
now I have to save it as jpeg file and imread from it .
Is there a direct way to do that?
The text was updated successfully, but these errors were encountered: