Hi Matias,
For "high level" objects like that I would recommend a deep learning library like PyTorch. Then you can follow the approach of just labeling a bunch of objects and letting machine learning do its thing. For coffee there is probably a pre-trained model too.
If doing it in BoofCV, the best way to do that would not be to detect a coffee but some attribute that it has. Color or contour information are the typical ways to go about it. Maybe in the future more ML will be added to BoofCV.
"Now, now my good man, this is no time for making enemies." — Voltaire (1694-1778), on his deathbed in response to a priest asking that he renounce Satan.