I got a color image and store into a variable A.
A = (22,10,10) (22,10,10) (39,40,50)(89,11,14) (23,11,11) (99,10,10)(89,11,14) (69,10,10) (99,10,10)
x=1 when loop horizontally I wish to register the first color I seem and label it into x.
when loop same color then label it into same label.
when new color is seem then register the color and label into x+1.
I wish to get a table like
color label (22,10,10) 1(39,40,50) 2(89,11,14) 3(23,11,11) 4 (99,10,10) 5(69,10,10) 6
so result finally get is
B= 1 1 2 3 4 5 3 6 5
How to get the label table and how to get the result?
Best Answer