iOS custom image crop using paths - ios

I need to implement a custom image crop on iOS and I can't seem to be able to find a technology that will allow me to do that easily. The goal is to have an interface as follows:
The idea is to have some sort of path or something around the face that the user can "nudge" around with their finger. Is there a library for this?
I have played a bit with UIBezierPaths, but I don't see how they can be edited after being stroked.
The best that I can come up with is having the user manually draw a line around the face, but then the line wouldn't be editable.
Please help! Does anyone know of a solution for this? I am in a bind and need to provide my client with a solution.

Related

Image tracking - tracking a screen with a camera

I want to track the relative position of a camera aimed at a computer screen.
I can’t control what is displayed on the computer screen but I can receive screen dumps whenever something changes on the screen. Those screen dumps can hopefully be used to find the screen when analyzing the video from the camera.
I see many videos on youtube for face, logo or single colored objects tracking using OpenCV but I’m unsure those methods would work finding and tracking a more detailed image like a screen dump.
Maybe Template Matching is the way to go? But I need to find the screen even at an angle.
Basically I don’t know where to begin and need help from people with experience in this field to find the best way for achieving what I want.
Thanks
Using feature matching should do the trick (Sift/SURF/ORB/...)

Find corner of field

I am working on project in C#/Emgu CV, but answer in any language with OpenCv should be ok.
I have following image: http://i42.tinypic.com/2z89h5g.jpg
Or it might look like this: http://i43.tinypic.com/122iwsk.jpg
I am trying to do automatic calibration and I would like to know how to find corners of the field. They are marked by LEDs, but I would prefer to find it by color tags. If need I can replace all tags by same color tags. (Note that light in room is changing so the colors might be bit different next time)
Edge detection might be ok too, but I am afraid that I would not find the corner correctly.
Please help.
Thank you.
Edit:
Thanks aardvarkk for advice, but I think I need to give you little bit more info.
I am already able to detect and identify robots in field and get their position and rotation. But for that I have to set corners of field manually first. So I was looking for aa automatic way, but I was worried I would not be able to distinguish color tags from background because light in the room is changing quite often.
And as for the camera angle. Point of this is that camera can be every time from different (reasonable) angle.
I would start by searching for the colours. The LEDs won't be much help to you as they're not much brighter than anything else in the scene. I would look for the rectangular pieces of coloured tape. Try segmenting the image based on colour. That may allow you to retrieve the corner tape pieces directly without needing to know their exact colour in advance. After that, you may look for pairs of the same colour blob that are close to each other to define the corners where the pieces of tape are the same. Knowing what kinds of camera angles you are going to have to solve is also very important -- if you need this to work when viewing from the side, then this approach certainly won't work. If it's almost top down, this would probably be a good start. Nobody will be able to provide you with a start to finish solution, but this might be a good base to begin with.

Is there a way to curve text/labels in Cocos2d?

Here is an example of what I would like to achieve.
Is there a way to "transform" a label in Cocos2d and obtain a curved text? I do not find any property in the CCLabelBMFont class that seem to allow this.
Any suggestion wellcome.
Rason for asking: I would prefer not to use pre-generated (with Photoshop or GIMP) text images. Hence I am looking for an answer to this problem and not to an alternative method.
One of the moderators of the Cocos2D forum has replied to me in their forum and it doesn't seem possible. Here is the link to the discussion on the forum, but as far as I can tell there is no solution (In my opinion it would require having implemented a draw call in the labels that blends the pixtures according to the new image matrix resulting from bending the original label image and as far as I can understand CCLabelBMFont does not seem to support this - and I am not sure that is easily possible to do so as the class does not derive from CCSprite but it may be in some other way that I do not know at the moment).

Stretching a UIImage across the length of a UIBezierPath

What I basically need to achieve is a Fruit Ninja - style "slash" effect, where the "slash" trails the user's touch and follows the shape of the user's gesture, and is thinner the longer the distance the user has swiped.
The simplest way to achieve this seemed to be to collect all the points the user passes through in a UIBezierPath, and "stretch" an image through the length of the BezierPath. This would achieve the kind of "trailing" effect I was looking for and also ensure that the line is thinner if the distance travelled is longer.
However I can't seem to find a way to actually implement this. Is this even possible?
Alternatives? Thanks.
P.S: This is for a low-medium priority section of a regular app and not a game, so I would like to avoid having go down to OpenGL and spend a lot of time to achieve this (with completely custom drawing, etc). Something at the SDK level would be preferred, and if that's not possible at all, we'll just figure out a different UI.
Thanks!
For pretty easy-to-use stretching teqhniques of images/views you could look into
https://github.com/hfossli/AGGeometryKit/
I recommend trying to draw using CoreGraphics. See this link
http://www.effectiveui.com/blog/2011/12/02/how-to-build-a-simple-painting-app-for-ios/
Okay. Maybe you can use this.
https://github.com/hfossli/AGDraw
Just something I wrote a while ago. Hit clear and try to draw something (clear will toggle between two types of strokes). You'll see the width of the penstroke will increase with the velocity you use.. I guess that fits your need. If you fix some bugs, please make a pull request. You are free to use the code, but I will add a MIT license later.

Whats the best way to check whether one image is somewhere on/similar to another image?

I want to use openCV to check whether an image is somewhere on another image. This other image could also be a photo. I dont want to know the position or anything, I just want to know whether the image is there or not - or, if the images are "equal enough".
Example: I use my iphone to take a photo of a static object. Now, one day later I take this photo again and I want to check if it is the mostly the same object.
Whats the best way to do this? I alos tried CVMatchTemplate (but was not able to get a working check) and CVNorm.
Maybe SURF (Speeded Up Robust Features) can to this.
I used it to check if an template image can be found on objects along an moving conveyor belt.
Have a look on this page, it describes the usage of SURF with the EMGU-OpenCV wrapper classes.

Resources