Closed VPetukhov closed 4 years ago
This sounds reasonable to me! But perhaps it would be better to make it a keyword argument? Perhaps called mask
or something?
But perhaps it would be better to make it a keyword argument? Perhaps called mask or something?
Yep, perhaps it would be better. Thanks!
Following the example from the documentation, currently segmentation is performed on the whole image, and later it's filtered with the binary mask. Though, using mask during the segmentation would allow to significantly reduce computation time, avoiding computation for background pixels.
How about adding new optional parameter
img_bin::Union{Array{Bool,2}, BitArray{2}, Nothing}=nothing
to the function? So the interface will be changed fromto
On my example, new function works 3.5 times faster. If you think it's fine, I will create a pull request.