Marking the elements in the picture using PIC

Hey,

I am looking for a solution that will allow me to do my project.

I would like to create an application that will recognize and separate two elements from a photo.

example:
(the red line is the separator to be added by the app)

I know that PIC allows you to classify items, but I mean classifying several items in one photo and selecting them.

Maybe some of you have already done a similar project and could help me.

I don’t know how to do it and I’m asking for help.