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

3 ビュー (過去 30 日間)
Duncan
Duncan 2014 年 8 月 21 日
コメント済み: Iain 2014 年 8 月 22 日
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 件のコメント
Duncan
Duncan 2014 年 8 月 21 日
do you have any links or info about doing this?
thanks
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 Center および File ExchangeDisplay Image についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by