Hello would it be possible to make this app

i am just wondering if it would be possible to make an app that does one of these things

it either

when you select a photo from your gallery on your phone , it then detects the face and makes a shape object of some sort that covers the whole eye .

or when you are select a photo from your gallery on your phone , there is a list of eyes on the right to pick from that you then drag over your eye which you can rotate,scale and move to fit the whole eye so it looks like this … the right side of the picture is the original photo and the left eye is what i want to create :slight_smile:

q8QvDCM.jpg

With Corona SDK you’re not going to be able to face detection.  Images are processed through OpenGL and you don’t have access to the image data itself.  You might be able to do this in Corona Enterprise where you can mix Lua and native coding.

However, the second option, you can certainly do.

Rob

Do you think the second option would be hard to do ? Cause I want to be able to drag the black eye in and then rotate and scale it to fit the eye nice ? I was trying to code it earlier but had problems when it come to letting the user scale an image

Dragging, scaling and rotating things is pretty easy in Corona SDK.  However, given the size of your objects, you may need to think about your user interface (UI) a bit.  Objects less than 44 points (44 pixels on a 320px screen) are hard to touch and manipulate.  Apple considers this the minimum touch target.  See:  https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LayoutandAppearance.html

Depending on the photo you’re trying to replace the eye with, your replacement eye will likely become too small to really touch, pinch-zoom to scale.  Also you need to think out how you’re going to implement user rotation in the UI.  I would study some other apps that do rotation and figure out the best way to present that to the user.

Rob

I was thinking of maybe creating a slider option , so there’s 3 sliders that let you either rotate,scale, and move the eye around , would there be anyone to help me with it because I’m new to corona sdk and am struggling a little bit

Okay sliders might work for rotation and scaling.  See widget.newSlider() in the docs.  You probably would still want to use touch and drag to position it.  There is a touch/drag sample in our sample code that’s a good resource on that.

Rob

How would I implement the slider to change another objects scale ?

Read the documentation on widget new slider.  You’re going to get a percentage from 0 to 100 where 50 is the middle.  Lets say you’re going to allow it to scale up to 2x and scale down to 50%.   You would need to normalize the data.   this is just pseudo code, since I don’t know what your variable names are and it’s untested:

local scaleValue = yourSliderValue

if scaleValue > 50 then

     local newScale = scaleValue - 50 * 2 / 100 + 1  – this gets us a percentage between 1 and 2

     eyeObject:scale( newScale, newScale)

else

    local newScale = 1 - (scaleValue * 2 / 100)

     eyeObject:scale( newScale, newScale)

end

or something like that.

Rob

With Corona SDK you’re not going to be able to face detection.  Images are processed through OpenGL and you don’t have access to the image data itself.  You might be able to do this in Corona Enterprise where you can mix Lua and native coding.

However, the second option, you can certainly do.

Rob

Do you think the second option would be hard to do ? Cause I want to be able to drag the black eye in and then rotate and scale it to fit the eye nice ? I was trying to code it earlier but had problems when it come to letting the user scale an image

Dragging, scaling and rotating things is pretty easy in Corona SDK.  However, given the size of your objects, you may need to think about your user interface (UI) a bit.  Objects less than 44 points (44 pixels on a 320px screen) are hard to touch and manipulate.  Apple considers this the minimum touch target.  See:  https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LayoutandAppearance.html

Depending on the photo you’re trying to replace the eye with, your replacement eye will likely become too small to really touch, pinch-zoom to scale.  Also you need to think out how you’re going to implement user rotation in the UI.  I would study some other apps that do rotation and figure out the best way to present that to the user.

Rob

I was thinking of maybe creating a slider option , so there’s 3 sliders that let you either rotate,scale, and move the eye around , would there be anyone to help me with it because I’m new to corona sdk and am struggling a little bit

Okay sliders might work for rotation and scaling.  See widget.newSlider() in the docs.  You probably would still want to use touch and drag to position it.  There is a touch/drag sample in our sample code that’s a good resource on that.

Rob

How would I implement the slider to change another objects scale ?

Read the documentation on widget new slider.  You’re going to get a percentage from 0 to 100 where 50 is the middle.  Lets say you’re going to allow it to scale up to 2x and scale down to 50%.   You would need to normalize the data.   this is just pseudo code, since I don’t know what your variable names are and it’s untested:

local scaleValue = yourSliderValue

if scaleValue > 50 then

     local newScale = scaleValue - 50 * 2 / 100 + 1  – this gets us a percentage between 1 and 2

     eyeObject:scale( newScale, newScale)

else

    local newScale = 1 - (scaleValue * 2 / 100)

     eyeObject:scale( newScale, newScale)

end

or something like that.

Rob