You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Could you provide a usage example of the gpujpeg_encoder_input_set_gpu_image function? #113
Could you provide a usage example of the gpujpeg_encoder_input_set_gpu_image function?
How should I fill in the input parameter uint8_t* image for this function? I want to pass cv::cuda::GpuMat image; from OpenCV as the parameter. How do I use it?
It should be the normal pointer to device memory so provided that the image is on-device, I believe you'd need to pass there the cv::cuda::GpuMat::ptr()? An issue can be that OpenCV might have the buffer padded, while GPUJPEG expects it isn't. In this case set gpujpeg_image_parameters::width_padding passed to gpujpeg_encoder_encode(). I've grabbed an example from GLM itnt it seems legit to me:
Activity
MartinPulec commentedon Nov 4, 2026
It should be the normal pointer to device memory so provided that the image is on-device, I believe you'd need to pass there the
cv::cuda::GpuMat::ptr()? An issue can be that OpenCV might have the buffer padded, while GPUJPEG expects it isn't. In this case setgpujpeg_image_parameters::width_paddingpassed to gpujpeg_encoder_encode(). I've grabbed an example from GLM itnt it seems legit to me: