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

조회 수: 3 (최근 30일)
just a random image I found on google. Is it possible to make the black parts (crack) darker and the background (concrete) lighter?

답변 (3개)

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

Iain
Iain 2014년 8월 21일
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
Iain
Iain 2014년 8월 22일
Adjusted_Contrast = (Image - meanlevel) * scale;
Adjusted_Image = meanlevel + Adjusted_Contrast;
You need to change data types & values of mean level & scale, as you need.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2014년 8월 22일
You can use imadjust() or just pass in the range you want to see into imshow().

카테고리

Help CenterFile Exchange에서 Display Image에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by