Fixed raw connected component count.
In ConnectedComponents, the number of components is available either via a counter (connectedComponents), or by using the size of the connectedComponentSize map. The former allow easy access to the number of components (raw count), the second to filter the result based on component size restriction at a cost of a more complex operation. The count update could, in some cases, create empty connected components. Those were counted and lead to erroneous results where the raw count of connected components was used. Empty connected components are now filtered out during the raw and size-based count.
Please register or sign in to comment