- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
why IamgeData has no ToBitmap for C++? I want to translate the iamge data to a picture with bitmap or jpg or png after acquireaccess.
The following is my code:
sample = sm->QuerySample();
cpic = sample->color;
if (cpic->AcquireAccess(PXCImage::ACCESS_READ,PXCImage::PIXEL_FORMAT_RGB32, &cData)<PXC_STATUS_NO_ERROR) {
wprintf(L"没能正常获取深度图像!\n");
break;
}
info = cpic->QueryInfo();
wprintf(L"图像的深度值\n");
unsigned char * cpixels = (unsigned char *)cData.planes[0];
int dpitches = cData.pitches[0] / sizeof(unsigned char);
for (int y = 0; y < (int)info.height; y++) { // R
for (int x = 0; x < (int)info.width; x++) {
fprintf(fpDataBmp,"%u ", cpixels[y*dpitches + x*sizeof(unsigned char)*4]);
}
fprintf(fpDataBmp,"\n");
}
fclose(fpDataBmp);
does the for loop get the R values for a picture?
I import these data into matlab and imshow them. but I got a very black gray picture. what mistake did I make?
Sincerely
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no tech difficulty to implement this. We will consider this feature. If it’s a common request, we will implement in the future. Thanks!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page