I have the following image, in which every pixel is the result of another segmentation algorithm. There are 3 classes here, but in theory there could be more.
I would like to remove the noise, meaning I want to get nice straight lines, and clean areas.
I thought about doing something similar to knn, meaning:
Each pixel will get the most popular vote by its neighbors (at some radius)
I could program this easily with for loops, but was wondering if anything like this can be done with numpy?
If there is a better way to do this, I would love to hear it.