how to fill the empty space inside an image generated by matlab function "scatter"
My image is a 2D surface of a protein, and I use matlab function "scatter" to display the image, so there are some white empty spaces in it.
I want to fill them with colors,but the question is that the points have different colors, some are red and some are orange(point color is decided by its RGB value).
So I wanna assign the color of the white space similar to their corresponding neighbors. the original work i did is to extract the edge of the polygon first,which helps me detect if the point is inside the polygon or not, because I am not assigning colors to white spaces that are outside the polygon.
And then simply scan the whole image pixels one by one to check if the pixel is the white, if so, I just assign the neighbor color to it,like what i said, I have to check if the pixel is inside the polygon or not every time.
But the speed is really slow, and the result is not good enough,could anybody give me some idea on it ?
I have the 2D sc开发者_Go百科atter points image and also the 3D structure.Each point in 2D can find one counterpart in 3D, I don't know if this information would help.
After an erosion with a disk kernel(7x7) such as
and then a bilateral filter:PS: if you have the 3D points structure, upload it somewhere and post a link
精彩评论