0
$\begingroup$

I am having 400 images that look like the following:

enter image description here

I would like to remove the frame and only get the image in the middle:

enter image description here

I tried the MODNet model modnet_photographic_portrait_matting. However, I get:

enter image description here

As you can see the model selects the person, BUT not the sticker itself.

I would only like to get the image without the frame.

Any suggestions how to tackle this problem?

I appreciate your replies!

$\endgroup$
1
  • $\begingroup$ Hello, I woudn't try to apply a machine learning model to this problem. I'd rather use color detection (background seems black and there is a white frame around the sticker). Or simply rectangle shape detection with a library such as openCV. To then sort the rectangles try using x, y coordinates if the sticker is always approximately as the same spot in the image. $\endgroup$
    – Ubikuity
    Commented Jan 16, 2022 at 10:23

1 Answer 1

1
$\begingroup$

MODNet, based on the paper, is a network that removes the background entirely just as if the person is standing in front of a green screen. And I assume that is why you are left only with the player and not the rest of the sticker.

I think you would find more use in a Region Proposal Network, such as that used in Faster R-CNN (sec. 3.1).

Here is an example of the PyTorch (torchvision) implementation of such a network. Notice how the network outputs boxes (in the forward() method) which is a tuple (x1, y1, x2, y2). From these four coordinates, you can get the four corners of the player sticker and crop it with a simple function.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.