Borrar filtros
Borrar filtros

Can we find the transparency of an overlay on an image ?

1 visualización (últimos 30 días)
Mr.X
Mr.X el 17 de Ag. de 2017
Editada: Walter Roberson el 5 de Oct. de 2017
If I have an image with a transparent overlay on it, can we find the percentage of transparency from the alpha channel of the image?
  6 comentarios
Mr.X
Mr.X el 5 de Oct. de 2017
Yes I have a partly transparent red line etched on the image and I need to find the transparency of the line alone. Not the image transparency
Walter Roberson
Walter Roberson el 5 de Oct. de 2017
Editada: Walter Roberson el 5 de Oct. de 2017
Could you post a sample image?
Will the line always be straight? Is the line in a known position or does it need to be detected?

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 17 de Ag. de 2017
Yes.
if isinteger(YourAlphaData)
tAD = im2double(YourAlphaData);
else
tAD = YourAlphaData;
end
percent_transparent = 100 * (1 - tAD);

Categorías

Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by