Ask Your Question
1

LINE-MOD/LINE-2D: Why does the OpenCV implementation use only silhouettes of the object?

asked 2014-06-05 08:26:27 -0600

paxida gravatar image

updated 2014-06-05 08:27:05 -0600

On his website (section "Software") Hinterstoisser notes that OpenCV implementation of LINE-MOD/LINE-2D uses only sihouettes when learning templates, but doesn't reason why. So here's my question: Why is that?

The lines of code that I'm talking about can be found in file opencv/modules/objectdetect/src/linemod.cpp:

For LINE-2D:

bool ColorGradientPyramid::extractTemplate(Template& templ) const
{
  // Want features on the border to distinguish from background
  Mat local_mask;
  if (!mask.empty())
  {
    erode(mask, local_mask, Mat(), Point(-1,-1), 1, BORDER_REPLICATE);
    subtract(mask, local_mask, local_mask);
  }
//... 
}

And same for LINE-MOD:

bool DepthNormalPyramid::extractTemplate(Template& templ) const
{
  // Features right on the object border are unreliable
  Mat local_mask;
  if (!mask.empty())
  {
    erode(mask, local_mask, Mat(), Point(-1,-1), 2, BORDER_REPLICATE);
  }
//...
}

Why erode the mask? Why not just leave it what it is and take all the gradients anywhere on the object like Hinterstoisser et al. originally proposed in their paper? (As I understood it, LINE-MOD/LINE-2D is for detecting textureless object, not for detecting silhouttes of objects.)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-06-09 21:45:13 -0600

updated 2014-06-09 21:45:43 -0600

I read the paper some time ago, so I'm not too familiar, but it seems like you answered your own question. If an object is textureless, then its interior provides no useful information (except for maybe color). For that reason, the silhouette is the very thing that allows such an object to be identified at all (that and the fact that it is textureless). A textureless object will have no interior gradients of value, so why compute them?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-06-05 08:26:27 -0600

Seen: 2,485 times

Last updated: Jun 09 '14