- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm trying to implement iplConvolve2D() using ippiFilter and I'm not sure how to do it right.
First of all, the IPL manual states that the combine method parameter (i.e. IPL_SUM, IPL_SUMSQ, IPL_MIN, ...) is ignored when using a single kernel. But I'm using a single kernel and it doesn't seem to beignored, because the output for each IPL_SUM, IPL_SUMSQ, etc, looks different in the IPL version!
So Iwasassuming that for e.g. IPL_SUMSQ, even the result of applying a single kernel to the image needs to be squared. But if I do that using ippiFilter* and ippiSquare, the results look very different. Using ippiFilter with a single kernel and not doing anything to the results seems to yield the same image as iplConvolve2D() with IPL_SUM... But I'm lost as to how to make the others work.
Does anyone have an idea how to do it right?
Thanks!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
there is comment from our expert:
I would suggest the user to ignore that filter combination flag at first, unless his application needs this feature.
For single kernel the easiest way to emulate iplConvolve2D is to:
1) create temporary buffer that is
2) then, copy the source image to the interior of the buffer and add necessary borders at once using one of ippiCopy{Replicate|Const|Wrap}Border (Replicate is usually the best default option, but it may also be taken fro IplImage header).
3) Call ippiFilter with source set to the temporary buffer and the destination set to the iplConvolve2D destination. That will automatically make in-place operation possible.
Another option is to use cvFilter2D from OpenCV. It also operates on IplImage. It is able to use ippiFilter for small kernels and ippsDFT for large kernels.
Note that cvFilter2D and iplConvolve2D/ippiFilter treat the array of coefficients differently, in cvFilter2D the array is flipped around the anchor point.
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