We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
this is a camera scanner sdk demo.
It get pic and info from the sdk,the pic data is a jpeg format array pointer.
I try to convert the data into a Mat. but i try to save it as a .jpg file ,it returned fail.
So,How should I to use this crate right?
the code is .
unsafe{ let p_data: *mut *mut u8 = &mut std::mem::zeroed(); let pst_frame_info: *mut hk_camera_sdk::MV_CODEREADER_IMAGE_OUT_INFO_EX2 = &mut std::mem::zeroed(); loop { let ret = hk_camera_sdk::MV_CODEREADER_GetOneFrameTimeoutEx2( *handle.as_ref().unwrap(), p_data, pst_frame_info, 1000, ); println!("get a frame from sdk{}", ret); println!("the pic type is {}", pst_frame_info.as_ref().unwrap().enPixelType); let _p_data = std::mem::transmute::<*mut *mut u8,*mut c_void>(p_data); let mat = Mat::new_rows_cols_with_data_def(1,4096*3072, opencv::core::CV_8UC1, _p_data).unwrap(); let retcode = imgcodecs::imwrite_def("camera.jpg",&mat ).unwrap(); println!("{}",retcode); //here is a false result }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
this is a camera scanner sdk demo.
It get pic and info from the sdk,the pic data is a jpeg format array pointer.
I try to convert the data into a Mat. but i try to save it as a .jpg file ,it returned fail.
So,How should I to use this crate right?
the code is .
The text was updated successfully, but these errors were encountered: