How to color an image

3 views (last 30 days)
Vladut Neagovici
Vladut Neagovici on 1 Jul 2022
Answered: Simon Chan on 1 Jul 2022
I have this photo and I have to color every hexagon from her with a different color.

Answers (2)

SlipperyGnome on 1 Jul 2022
You can go through this link to create coloured hexagons using patch-
You can also see here to understand how to find the boundaries of each hexagon in the image-
Hope this helps.

Simon Chan
Simon Chan on 1 Jul 2022
Try the following:
I = imread('');
BW = imbinarize(rgb2gray(I));
[L,n] = bwlabel(BW);
J1 = label2rgb(L);
J2 = imoverlay(J1,~BW,'black'); % Make sure the background is black color

Community Treasure Hunt

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

Start Hunting!

Translated by