Stretch region of image through opencv or opengl in iOS - ios

I am trying to make double chin in fat image as mentioned in my desired result image below.
I have morphed the normal face to fat face by wrapping an image on mesh and deformed the mesh.
Original image
Wrapped image on mesh grid with vertex points displaced
Current result image
I tried a lot by arranging mesh points but could not get the result like I have shown in first image.
Any ideas how to achieve this by open GL or open CV in iOS?

It's obvious from the first image that there is an added effect to produce the double or triple chin.
This actually looks like a either a preset image blended into the original or a scale and stretched version of the original chin blended into the warped image.

Related

Using image morphological techniques, locate the broken locations

Can someone please guide the steps/the operation to be performed to construct this image and detect the broken fence position of the Image.
Thresholding the image to a binary image : to convert the input image to a binary image
Inverting the image : inverting it to get a black background and white lines
Dilation with SE one unit of the fence structure
Apply Erosion
Bitwise-and masks together: retrieve the original back- and foreground the image is inverted by subtracting the bitwise_or from 255
Constructed Image - Original Image will give us the position of the broken fence
Will this solution work ?
Depends what you call locate.
After large horizontal erosion and binarization:

What does normalizedPath refer to and how can I draw it over an image in iOS?

I have two images, one that is a monochrome one which is a mask and another one with full color. What I need to do is find the CGRect of the mask (white pixels) in the other full color one.
What I did is to first find the contour of the mask using the Vision framework. Now, this returns a CGPath which is normalised. How can I translate this path into coordinates to the other image? Both have been scaled the same way to make them the same size so the translation should be "easy" but I can't figure it out.

Find intuitive image orientation with opencv

I have a bunch of images of handtools and I would like to reorient the pictures along the "intuitive" axis. So what I am trying is to find the magenta line:
Eventually I was able to feed fitLine with the main contour of this hammer, but the middle line does not pass by the center of this hammer:
Here the sample image for the scissors:

android: smooth out edges of random shape bitmap

I have an random shape bitmap cut out by user. I want to fade out its borders i.e. contours, so as to make it appear smooth. What should I do? To get the borders and color of every pixel in bitmap, I am traversing it pixel by pixel. It takes long time, still I am ok with it. Is openCV my only option? If yes, can anybody point me towards any tutorial or suggestion for logical approach?
You can just run a smoothing filter on your shape.
In opencv you can use the blur fnnction or gaussainBlur. Look at http://docs.opencv.org/2.4/doc/tutorials/imgproc/gausian_median_blur_bilateral_filter/gausian_median_blur_bilateral_filter.html.
You don't have to use opencv but i think it would be easier and faster.
If you still don't want can use any other code that implement smoothing an image.
In case you just want to effect the border pixels do the following:
Make a copy of the original image
Filter the entire image.
Extract the border pixel using opencv findContours.
Copy from the blurred image only the pixels in the border and in there neighborhood and copy them to the copy you did in step 1.

Cut rectangle out of image after applying several transformations

I want to cut a renctangular shape out of an image.
I know the position of the rectangle relative to the orginal image.
However: When I rotate/scale/translate the image, the image dimensions changes. So my crop to the rectangle does not work anymore.
Is there a way to preserve the "old" coordinate system while transforming the image and then do a crop based on that old system?
The Image is always rotated/scaled around its center. Translation is applied after scaling and rotation.
I aim for a solution in php with imagick. However: When its not possible I am fine with command line imagemagick, too

Resources