Borrar filtros
Borrar filtros

Extract color map from png apply to grayscale image

5 visualizaciones (últimos 30 días)
M
M el 19 de Feb. de 2024
Editada: M el 4 de Mzo. de 2024
How can I apply a color map as close as possible to the one in given color image to a grayscale image which is of the same subject, but from a different angle and of different size?
None of the built-in color maps seemed to be close.
I thought maybe trying to 'extract' a color map from the color image might work and tried using @DGM's solution at https://www.mathworks.com/matlabcentral/answers/1839998-how-to-convert-a-gray-scale-image-of-thermal-camera-to-colored-one#answer_1087853, but I'd like to get the color range to match the coloring of the color image as much as possible. It doesn't need to use this method, it was just something I tried.

Respuesta aceptada

Walter Roberson
Walter Roberson el 19 de Feb. de 2024
Use rgb2ind() on the colored image, and take the second output as being the color map.
[~, cmap] = rgb2ind(TheColoredImage);
image(TheGrayImage); colormap(cmap)

Más respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by