Splitting an image into matrix based on color?

1 次查看(过去 30 天)
Hi i have an low res image and i want to extract the color information from this into a cell-matrix.
I already know the 8 colours contained in this image. It is stored in an 8x3 array,
0 0 0; //black
255 0 0; //red
240 220 0; 50 0 255; etc
now all i want to do is search the image for these colours (including small variations), and if a match is found put this region in a matching cell array.
So if in the image 0,0 to 10,25 consists of colour black then in the matrix the first element will be a cell with dimension {10 x 25 x 1} where 10 and 25 are the dimensions and the 1 dimension holds the colour information.
The value of this cell will be 1 since black is uindex 1 in the predefined colour array.
How do i convert this logic into code? Thanks for helping,

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by