I have a photo processing IOS app (written mostly in Objective C and OpenCV). In this app I want to add a bulge to an image at a given location. I found the following question for how to add a bulge in the middle of an image: Image Warping - Bulge Effect Algorithm. What I am wondering is how to apply this algorithm to my IOS app. I was considering looping through all the pixels with the equation given in that question. An alternate possibility would be to use the warp tool in OpenCV. How do I add the bulge to an image?
Asked
Active
Viewed 648 times
1
-
Perhaps this might do what you want: http://stackoverflow.com/a/9896856/19679 – Brad Larson Jul 13 '16 at 14:26
-
@BradLarson That is a good possibility. My concern with that answer is it is using the GPUImage library. I'm not completely opposed to it, but OpenCV is already installed on the app and I'm afraid that adding another framework will make the app more heavy weight. How do you feel about it? Is that a valid concern or should I not worry about using several graphics libraries? – Tyler Hilbert Jul 13 '16 at 14:38
-
If you're already using OpenCV, it shouldn't be that hard to warp an image via one of the several manipulation functions inside it. Performance might be a consideration, since OpenCV generally isn't as fast as GPUImage on mobile devices for simple image manipulation like this. If you don't want to pull in another framework, you could copy the shader code I use for this and build a small OpenGL ES renderer that applies one of those shaders on a quad. – Brad Larson Jul 13 '16 at 14:42
-
@BradLarson Do you know what functions that would be? Looking through the documentation I would say detail::RotationWarper::warpPoint , detail::RotationWarper::warp , detail::RotationWarper::warpBackward , or detail::SphericalWarper (http://docs.opencv.org/2.4/modules/stitching/doc/warpers.html). Unfortunately the documentation doesn't have pictures of the warps. I can't tell which one would look the same as the one from http://stackoverflow.com/questions/5055625/image-warping-bulge-effect-algorithm – Tyler Hilbert Jul 13 '16 at 14:57