- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an image that I am copying into another image using ROI. Format is YV12. The code I am using is from the intel sample Image,cpp: BOOL Image::CopyDataP_ROI(void** ppData, int* step, IppiSize roiSize) { if (!(m_InitFlag & initAlloc)) return FALSE;
if (!ppData) return FALSE;
if (!m_plane) return FALSE;
roiSize.width *= ItemSize();
for (int c=0; c < Channels(); c++) {
IppiSize size = roiSize;
CorrectPlaneSize(size.width,size.height,c);
ippiCopy_8u_C1R((Ipp8u*)ppData
}
m_Updated = TRUE;
return TRUE;
}
If I have a 640x480 image that I copy into a 640x480 ROI, it appears correct.
If I have a 320x240 image that I copy into a 640x480 image, the image appears as shown int he attached image.
The image appears stretched vertically and repeated four times.
If I have a 640x480 source and resize it to 320x240 and place it within a 320x240 ROI in the destination 640x480 image, it appears correctly. It seems that everything works correctly if the source image resolution is the same as the destination resolution.
The same exact code compiled for 32-bit does not have this issue at all. Not sure why but could it have something to do with the x64 pointers to the planar data or perhaps the ptr math (common errors when converting to x64).
Has anyone else run into this issue or can perhaps point me int he right direction? Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I don't see anything attached. BTW - do you use correct srcStep and dstStep? Do they match source and destination?
regards, Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is the image I tried to attach in the original post:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi shadowwolfx,
It may happen, that this function erroneously changes CImage resolution data, like m_width. Check CImage.Step() before and after calling of CopyDataP_ROI.
This class might work good on interleaved (RGB) images, but I'm not sure if we use planar images, especially with different sampling like YV12. We haven't checked this sample for several years.
Use debugger to step into this function and to look what's happening with image attributes.
Regards,
Sergey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page