user3753314
user3753314

Reputation: 63

convert image to matrix with specific values MATLAB

I have the image linked below I need to turn convert into a binary matrix. I need the green beads to be one value (0) and the silver beads another (1). I've tried converting it to black and white using various scalars, but the shadows create problems. Either the shadows need to be associated with the surrounding color or they need to become invisible such as below:

If shadows = 0, green = 1, silver =2

1 2 1 1 
0 1 2 2 
2 0 0 1

Would become

1 2 1 1 
1 2 2
2 1 

http://i1373.photobucket.com/albums/ag390/jmangler1/7-11GreenBB250_zpsb583a772.png

Upvotes: 1

Views: 113

Answers (1)

jpjacobs
jpjacobs

Reputation: 9549

Take a look at Image segmentation with matlab

They also have a nice app for playing around with different techniques.

Upvotes: 1

Related Questions