Apply a function to a traced portion of an image only.

1 view (last 30 days)
Hi There,
So I have a 3d bmp file which consists of an image of a face: A.bmp.
The image has a circular face with a white background. I have a piece of code that takes chunks of the image and shuffles them around - however I have been trying to apply this selectively to the face and not the background.
I thought a tracing function could work well, and there is one for 3d matrix files, being bwconncomp - this gives you a connectivity value, image size, number of objects and a pixel list, though I'm not really sure about the usefulness of these values for what I am trying to do. I was hoping to get co-ordinates for the face so I could use those to apply the shuffle function.
I tried converting the image to 2d matrix with rbg2gray, but this looses a lot of boundaries and you end up with a very strange shuffled image.
So my question is: is there a way to use bwconncomp to get the co-ordinates of the face, or alternatively convert the image so that it is compatible with the 2d tracing functions?
Thank you.

Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!