- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
James
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there
For me ,i 've never tried to crop an image using IPP.Because it's a little bit difficult for me.I am not so familiar with IPP.However,i usually crop the image or do other image processing issues using another .NET image SDK.It can easily crop a rectangular section from source image object and save cropped image as a new file.You can have a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi James,
allmost all IPP image processing functions work with ROI - so all what you need - just to define ROI that you would like to extract from your image and use ippiCopy function:
- define the top-left border between transparent and non-transparent pixels
- define the bottom-right border
set pSrc pointer to the top-left, define ROI size as {left-right,top-bottom} and srcStep as you initial image step/pitch; use this new ROI for further processing or use ippiCopy function to copy this ROI to a new one (the new one you can create with ippiMalloc function).
regards, Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Igor,
I just tried cropping an image (an example as shown below) as per your above information. But I am not getting the expected output. Do you know what happens here?
IppiSize roiSize = {2,2};
IppiPoint srcOffset = {1,1};
int stride = pSrc.GetWidth(); //Gives me value 3
int dstStride = pDst.GetWidth(); // Gives me value 2
ippiCopy_32f_C1R(pSrc + srcOffset.x + srcOffset.y* stride, stride, pDst, dstStride, roiSize);
Source - pSrc
const float inputImage [1][9] = {{0.0, 0.0, 0.0,
0.0, 1.0, 2.0,
0.0, 3.0, 4.0}};
Expected output - pDst
const float expectedOutput [1][4]= {{1.0, 2.0,
3.0, 4.0}};
I am getting junk values here
Expected array data:
1 2 3 4
Tested array data:
8.96831e-44 2 9.37762e-39 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jithin,
In IPP all strides are in bytes (by definition) - so you should multiply your strides above by sizeof(float).
regards, Igor

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page