- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will pass this borderedImage to ippiFilter() as the source.
What I mis is how I tell ippiFilter() to offset the image processing by anchor.x and anchor.y.
According to the formula in ippiman.pdf on page 419 it does not.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
offsetData=borderedData+(anchor.y*(bordered_width*3) + anchor.x*3)
and pass offsetData instead of borderedData to ippFilter(). Is it supposed to be done like this, or am I overseeing something?
Note: I am using the _8u_C3R family of functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
strtSrc = (Ipp8u*)pSrc - ( kHeight - anchor.y - 1 ) * srcStep - ( kWidth - anchor.x - 1 ) * 3;
so for users image (if he want to filter the whole image) strtSrc point should be upper left corner of the border and he should pass pSrc pointer to the function. A customer should remember that a kernel is flipped before applying to an image.
Fffffbbbbbbbbbb
fffffbbbbbbbbbb
ffAffiiiiiiiiii
fffffiiiiiiiiii
fffffiiiiiiiiii
bbiiiiiiiiiiiii
bbiiiiiiiiiiiii
Here is an example for 5x5 mask, C1 image and anchor in the center of the kernel:
f = filter mask
b = border
i = image
A = anchor point and it should point to which pSrc should point
F = upper left corner or strtSrc point, from which filtering begins.
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you help what shall be step size, As I was ending up getting ippStsStepErr,
I have created example 5x5 image, and added padding of 1 col, 1 row on top, bottom, left, right, the new size of bodered image is 7x7
I have copied source contents to newly created bordered image. I have created new image with same 7x7 size.
I calculated src step
as
srcStep = 7 * sizeof(float);
if run
aStatus = ippiFilter_32f_C1R(anImage, srcDstStep,
anImage_out, srcDstStep,
roiSize, anAverageKernal_in,
akernelSize_in, anchor);
I end up in step error, I can describe the variable i am using
float anImage[49];
float anImage_out[49];
roiSize = { 7,7 }
IppiSize akernelSize_in = {3,3};
IppiPoint anchor = {1,1};
Could give clue about step calculation.
regards,
Chandra-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Chandra,
please take a look on comment provided by our expert:
srcStep had been calculated right.
But the code must be like this:
float anImage[7*7];
float anImage_out [
5*5];/* Output image is less then input image.
For 3x3 kernel size the output image is less by
1 col & 1 row on top, bottom, left and right.
5 = 7 1 - 1. */
IppiSize aKernelSize_in = { 3,3 };
IppiPoint anchor = {1,1};
IppiSize roi
DstSize = { 5, 5 };/* roiSize must fit for
output image. */int srcStep = 7 * sizeof(float);
int dstStep =
5 * sizeof(float);float *pSrc;
#define nChannels 1
/* The using filter is for one-channels images. ippiFilter_32f_
C1R */Prepare input image anImage.
Prepare kernel anAverageKernel_in
pSrc = (float *)( (unsigned char *)anImage + srcStep * (aKernelSize_in.height anchor.y 1 ) );
/* The source pointer is moved by 1 row down. */
pSrc += ( aKernelSize_in.width anchor.x 1 ) * nChannels;
/* The source pointer is moved by 1 col right. */
aStatus = ippiFilter_32f_C1R (
pSrc,srcStep,
anImage_out,
dstStep,
roiDstSize,
anAverageKernel,
aKernelSize,
anchor);
.
srcStep is row length of source image by bytes.
dstStep is row length of destination image by bytes
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the filter started working, had same issue with ippiErode, i had modified the code as you suggested, thanks.
warm regards,
chandra-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
please feel free to share your feeling about IPP functionality performance or any issues you've met with it. It might help other in using this software and might help us to improve the future versions.
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
please feel free to share your feeling about IPP functionality performance or any issues you've met with it. It might help other in using this software and might help us to improve the future versions.
Regards,
Vladimir
Hi Vladimir,
I have a similar problem to use ippiFilter_32f_C1R(). I am pretty sure I follow the way you suggest early email. The function works with proper return status and results. However, it crashs at the second time call (from upper level IDL). The function actually return properly but the application down. If I comments out this function, the application works fine. Please advise.
Thanks.
Joe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ho Joe,
The issue in previous post was related to incorrect usage of the function. Could you please provide a code snippet to show how do you use the function and what are parameters passed by at run time?
Regards,
Vladimir

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