There are two functions that they donβt tell you about:
1) EdsGetPointer
2) EdsGetLength
This will give you a pointer to the start of the JPEG stream and size accordingly.
Once you use LibJPEG Turbo to unpack, Libjpeg simply not fast enough.
After unpacking, you can show the image using opencv .
bool CanonCamera::downloadLiveViewImage() { EdsError err = EDS_ERR_OK; EdsEvfImageRef image = NULL; EdsStreamRef stream = NULL; unsigned char* data = NULL; unsigned long size = 0; err = EdsCreateMemoryStream(0, &stream); if (err != EDS_ERR_OK) { cout << "Download Live View Image Error in Function EdsCreateMemoryStream: " << err << "\n"; return false; } err = EdsCreateEvfImageRef(stream, &image); if (err != EDS_ERR_OK) { cout << "Download Live View Image Error in Function EdsCreateEvfImageRef: " << err << "\n"; return false; } err = EdsDownloadEvfImage(cameraRef, image); if (err != EDS_ERR_OK) { cout << "Download Live View Image Error in Function EdsDownloadEvfImage: " << err << "\n"; return false; } err = EdsGetPointer(stream, (EdsVoid**)& data); if (err != EDS_ERR_OK) { cout << "Download Live View Image Error in Function EdsGetPointer: " << err << "\n"; return false; } err = EdsGetLength(stream, &size); if (err != EDS_ERR_OK) { cout << "Download Live View Image Error in Function EdsGetLength: " << err << "\n"; return false; }
rossb83
source share