Skip to content

This is a fast custom algorithm having O(n) linear time & O(n) memory complexity implemented on the CPU for solving the famous connected component labelling problem. The algorithm implemented here, takes the image and the label of the connected region and spits out the number of such regions in the image.

Notifications You must be signed in to change notification settings

ironhide23586/CPU-Connected-Component-Labelling

Repository files navigation

CPU-Connected-Component-Labelling

This is a fast O(n) linear time CPU implementation of the famous connected component labelling problem. The algorithm implemented here has a O(n) memory complexity; n being the number of elements in the input map.

NOTE: 8-way connectivity has been assumed here.

For example, in problems where we have images like these - Alt text

We desire to find the number of "blobs" or connected regions. The algorithm implemented here, takes the image and the label of the connected region and spits out the number of such regions in the image.

Example usage in the main() method. Have fun!:D

About

This is a fast custom algorithm having O(n) linear time & O(n) memory complexity implemented on the CPU for solving the famous connected component labelling problem. The algorithm implemented here, takes the image and the label of the connected region and spits out the number of such regions in the image.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages