Is there a a function/code which can make the darker bits darker and the lighter bits lighter?

4 visualizaciones (últimos 30 días)
just a random image I found on google. Is it possible to make the black parts (crack) darker and the background (concrete) lighter?

Respuestas (3)

Matz Johansson Bergström
Matz Johansson Bergström el 21 de Ag. de 2014
If you have the image processing toolbox you can use imcontrast. http://www.mathworks.se/help/images/ref/imcontrast.html

Iain
Iain el 21 de Ag. de 2014
Yup.
Calculate the difference from the image's mid level (128 probably, but this depends on how you're dealing with the image), and multiply it by a number greater than 1. Add that difference back to the mid level.
  2 comentarios
Iain
Iain el 22 de Ag. de 2014
Adjusted_Contrast = (Image - meanlevel) * scale;
Adjusted_Image = meanlevel + Adjusted_Contrast;
You need to change data types & values of mean level & scale, as you need.

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 22 de Ag. de 2014
You can use imadjust() or just pass in the range you want to see into imshow().

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by