Since you didn’t inform the original matrix, I’ll assume this:
% matriz original:
matrix_cinza = rand(64, 64);
And visualizing:
% imagem original
% Sendo: cat(3, VERMELHO, VERDE, AZUL)
% Mas, como é escala de cinza os três canais são iguais.
imagem_cinza = cat(3, matrix_cinza, matrix_cinza, matrix_cinza);
To highlight the black elements you can create a matriz_destaca
and change the value of those that are black to 1. In this case, the values below 0.1 were considered black, but you can change to the desired level in matrix_destaca < 0.1
.
matrix_destaca = matrix_cinza;
matrix_destaca(matrix_destaca < 0.1) = 1;
Then, you can generate the highlighted image only the green layer image:
imagem_destacada = cat(3, matrix_cinza, matrix_destaca, matrix_cinza);
image(imagem_destacada);
Which results in: