Skip to content

Commit

Permalink
[apps] Feature masking openMVG#513
Browse files Browse the repository at this point in the history
- use the following predicate: we keep points if (mask(pointposition)!=0)
  • Loading branch information
pmoulon committed Apr 22, 2016
1 parent e9212e3 commit beb0aba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/sphinx/rst/software/SfM/ComputeFeatures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Arguments description:
- You want to speed up the computation by reducing the number features/regions and thus the number of tie points.

For this kind of needs you can use a mask. A mask is simply a binary image having the same size (width and height) than the target image.
The black areas on a mask denote the "bad parts", *i.e.* the areas to be masked and for which descriptors are not computed.
The black areas on a mask denote the "bad parts", *i.e.* the areas to be masked and for which descriptors are not computed. A point is kept if the mask value at the point position is different than 0.
In openMVG_main_ComputeFeatures, the association of a mask and an image is implicit. It uses the following conventions:

- It tries to load a global mask.png file from directory where the the SfM container file (sfm_data.*) is stored.
Expand Down
2 changes: 1 addition & 1 deletion src/nonFree/sift/SIFT_describer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class SIFT_Image_describer : public Image_describer
if (mask)
{
const image::Image<unsigned char> & maskIma = *mask;
if (maskIma(keys[i].y, keys[i].x) < 255)
if (maskIma(keys[i].y, keys[i].x) == 0)
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions src/openMVG/features/image_describer_akaze.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class AKAZE_Image_describer : public Image_describer
):Image_describer(), params_(params), bOrientation_(bOrientation) {}


bool Set_configuration_preset(EDESCRIBER_PRESET preset) override
bool Set_configuration_preset(EDESCRIBER_PRESET preset) override
{
switch(preset)
{
Expand Down Expand Up @@ -85,7 +85,7 @@ class AKAZE_Image_describer : public Image_describer
*/
bool Describe(const image::Image<unsigned char>& image,
std::unique_ptr<Regions> &regions,
const image::Image<unsigned char> * mask = nullptr ) override
const image::Image<unsigned char> * mask = nullptr ) override
{
params_.options_.fDesc_factor =
(params_.eAkazeDescriptor_ == AKAZE_MSURF ||
Expand Down Expand Up @@ -121,7 +121,7 @@ class AKAZE_Image_describer : public Image_describer
if (mask)
{
const image::Image<unsigned char> & maskIma = *mask;
if (maskIma(ptAkaze.y, ptAkaze.x) < 255)
if (maskIma(ptAkaze.y, ptAkaze.x) == 0)
continue;
}

Expand Down

0 comments on commit beb0aba

Please sign in to comment.