Face Coordinates / Gravity for not faces

Options
OPEHub
OPEHub Member Posts: 2
edited December 2023 in Developer APIs

I'm searching through all of the resources, but haven't came across this yet, so here I am.

What I'm doing specifically is - I have images that I'd like to add a "starburst / shine" to. The location of where I'd like to add this is "at the highest point on the thing". Kind of like "on the face" but in this case, it's not a face.

Is this sort of thing possible?


For reference, I'm dynamically creating what you see on the attached image out of assets on the fly. The shine on the top of the lawn mower is what I'm referring to. There will be many different types of equipment.


Answers

  • Cloudinary Team
    Cloudinary Team Administrator, Cloudinary Staff Posts: 124 admin
    Options

    Hi there,

    So you would add the starburst effect as an overlay? Is that correct?

    I think you would be able to do this with the Cloudinary AI Content Analysis add-on. If the equipment is supported by one of the models, you would be able to use g_<object> to find the equipment. You might have to adjust a bit for precise positioning of the starburst. But I think the Content Analysis add-on would work well for you. Please note that you need to register for the add-on before you can use it.
    https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#getting_started

    If you want to search for some of your equipment, to see if it will be supported by one of the built-in models, you can do that here by entering the name of the equipment in the search bar
    https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#supported_objects_and_categories

    The documentation for using the gravity parameter with the Content Analysis add-on can be found here:
    https://cloudinary.com/documentation/transformation_reference#g_object

    Please give it a try and let me know how it goes. If you get stuck or have questions, just let us know.

    Kind regards,

    Tia

    Helpful Links For You
    💬 Share questions, connect with other users in our Cloudinary Community forums and Discord server!
    🧑‍🎓 Join our Cloudinary Academy for free courses, workshops and other educational resources.
    📄 Read our documentation for in-depth details on Cloudinary product features and capabilities
    📰 Check out the Cloudinary blog for the latest company news and insights

  • OPEHub
    OPEHub Member Posts: 2
    Options

    Hi Tia, thanks for you response.

    Before I jump into solving this, I'd like to clarify. This entire image is assembled from 6 different assets/layers. The equipment is not the same each time. The trick is finding the tip top of the equipment. I am hearing you on identifying the equipment in the image, but it's the only thing on that layer.

    Would you still recommend I go this method to find the top of the equipment? Imagine that layer as only the piece of equipment with a transparent background.

  • Cloudinary Team
    Cloudinary Team Administrator, Cloudinary Staff Posts: 124 admin
    Options

    Hi there,

    As your equipment will be different each time, I think you would be better off using X and Y coordinates manually. Using the object analysis add-on, you will need to update the transformation each time to say "chair" "lawnmower" etc. Plus, as I mentioned earlier you would likely need to make some small adjustments for precise positioning.
    So, to answer your question - I believe it will be possible to do what you have in mind. However, there will not be a simple one-component transformation that you can apply to every delivery URL. There is not a one-size-fits-all approach, unfortunately.

    So I think a better recommendation is to use X and Y coordinates for positioning your starburst overlay. You can find the relevant documentation here:
    https://cloudinary.com/documentation/transformation_reference#x_y_coordinates

    Take a look at that and let me know what you think.

    Kind regards,

    Tia

    Helpful Links For You
    💬 Share questions, connect with other users in our Cloudinary Community forums and Discord server!
    🧑‍🎓 Join our Cloudinary Academy for free courses, workshops and other educational resources.
    📄 Read our documentation for in-depth details on Cloudinary product features and capabilities
    📰 Check out the Cloudinary blog for the latest company news and insights