Pergunta de entrevista da empresa Tonbo

Q: How to separate foreground and background in an image?