- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I need to filter, zoom and pan an image. My implementation first filters the source image (smoothing or sharpening), then using Lanczos resizing, zooms and pans it into an output image. After spending a lot of time to get this working I sadly realize that these 2 steps (one is filtering and one is Lanczos resizing) end up being too slow for real-time interaction.
With that my question is, is there a resize function which allows one to set a convolution filter?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi umundry,
Intel(R) IPP library does not contain resize functions, which can set a convolutional filter for smoothing.
Could you please specify hardware parameters, library versions and all parameters for the resize functions for the case when ippiResizeLanczos has worse performance that ippiResizeSqrPixel?
The function ippiResizeSqrPixel is deprecated, however you can use it with Intel(R) IPP legacy libraries: https://software.intel.com/en-us/articles/intel-ipp-legacy-libraries
Thanks,
Valentin
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'll investigate this and get back to you soon.
Thanks,
Alice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Alice!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI umundry,
Did you threaded your code get the performance improvement?
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tiling would help too, I guess. That is, do the consecutive operations on one image tile (and then do those operations on the next tile, etc.) That prevents costly cache misses.
Or using a small preview image to get the real-time interaction user prefs.
Regards,
Adriaan van Os
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To answer Adrian's question, the app does not allow for a "small preview image".
For Chao: The entire app is highly optimized and uses every core/thread available. I had to start tinkering with this when the function ippiFilterSharpen_8u_C1R() was deprecated and removed and I had to start fishing for an alternative. Resizing using Lanczos was the visually equivalent, but it is way slower hence the reason for this post.
So the question remains and I hope that Alice (or Chao?) will come up with THE answer.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am sorry, correction, the deprecation of the ippiResizeSqrPixel_() function caused the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
> To answer Adrian's question, the app does not allow for a "small preview image".
I didn't ask a question, just gave two suggestions on how to solve your posted problem. I sincerely apologize for doing that,
A. van Os
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you don't mind a hack, you can rewrite ippiResizeLanczosInit to create a IppiResizeSpec_32f with your own convolution filter. It's sort of documented at https://software.intel.com/en-us/articles/the-intel-avx-realization-of-lanczos-interpolation-in-intel-ipp-2d-resize-transform
Alternatively, you can switch to https://github.com/uploadcare/pillow-simd which has full source code.
Bruno
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bruno, your referred article has several missing image links!
Otherwise, its is a very informative text.
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To Adrian: Sorry if I offended you, not my intent.
To Bruno: That "hack" seems to be a PhD thesis :-) Sadly I won't have the time to dive deeply into that but as Thomas said, still very informative.
Chao/Alice, I am hoping that you'll come up with something that I can use. It seems like performance went backwards with the deprecation of ippiResizeSqrPixel() and forcing a more fancy but slower alternative. I am not certain what exactly the cause of the slowdown is, it seems that the numerous memory allocations and de-allocations might play a role. In the application, this code is called 4 times -each on a separate thread-, and all of that approx. 20 ... 30 times per second when interacting. If I only filter, but not pan/zoom, then all works like butter, very smooth, no hick-ups whatsoever (ippiResizeSqrPixel() kept up and was smooth as well). So the culprit definitely is the Lanczos resizing.
Thank you everyone!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Thomas Maybe the PDF has the images.
@umundry I found ResizeSqrPixel to be slower than ResizeAntialiasing. What exact functions are you using? Are you sure you are comparing apples to apples? Is Antialiasing the same? I think the sweet spot is linear (not lanczos) interpolation with antialiasing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am comparing ippiResizeSqrPixel() to ippiResizeLanczos(). No antialiasing handling involved. Regarding interpolation type, we have performed extensive testing on image quality and determined that Lanczos reproduces what we need best.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use VTune to profile each function and compare the kernels. Another advantage of ippiResizeSqrPixel is that the pan can be subpixel accurate. I don't know if you are using that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ippiResizeSqrPixel() is deprecated...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi umundry,
Intel(R) IPP library does not contain resize functions, which can set a convolutional filter for smoothing.
Could you please specify hardware parameters, library versions and all parameters for the resize functions for the case when ippiResizeLanczos has worse performance that ippiResizeSqrPixel?
The function ippiResizeSqrPixel is deprecated, however you can use it with Intel(R) IPP legacy libraries: https://software.intel.com/en-us/articles/intel-ipp-legacy-libraries
Thanks,
Valentin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Valentin,
that Is a clear albeit disappointing answer, thank you!
I have looked at that legacy link which apparently lists the deprecated functions and ippiResizeSqrPixel is not one of them. But I'll check. If it is, then my problem is solved that way.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have downloaded the legacy zip file but need a password to use its content. Where do I obtain that password?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI Umundry,
can you check the "readme.txt" file at the package, and it includes the password for unzipping?
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Chao, yes I found it, and using the legacy lib support, everything is back to working at lightning speed again! So, Valentin gave the decisive hint.
Thank you everyone!!!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page