facebookresearch / facebookresearch/ocean
findOutline4 function does not check itself for nonMaskValue
- Dominant language
- C++
- Stars
- 790
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/facebookresearch/ocean/blob/3c24ca74a826ae3273f3eb4294b0e071e906318a/impl/ocean/cv/segmentation/MaskAnalyzer.cpp#L306
The output for this function is described as this:
> Resulting outline-4 pixels, **the pixel itself is not a mask pixel** but has at least one neighbor mask pixel in the four-neighborhood
But nowhere does it ensure that the pixel being analyzed is not a mask pixel. As a result the output contains all of the mask pixels in addition to the outline pixels. See Line 381 for example:
`if (maskRow[x - 1u] != nonMaskValue || maskRow[x + 1u] != nonMaskValue || maskRowBottom[x] != nonMaskValue)`
It is done correctly in other functions, such as here in Line 1784:
`if (row1[x] != nonMaskValue && (row1[x - 1u] == nonMaskValue || row1[x + 1u] == nonMaskValue || row0[x] == nonMaskValue || row2[x] == nonMaskValue))`
Contributor guide
Assessment
This issue has not been assessed yet.