how can I change the color of portion of image where intensity is below threshold

์กฐํšŒ ์ˆ˜: 2 (์ตœ๊ทผ 30์ผ)
Apra Gupta
Apra Gupta 2023๋…„ 2์›” 3์ผ
๋‹ต๋ณ€: Image Analyst 2023๋…„ 2์›” 3์ผ
I have a grayscale image. I want to know the intensity of all pixels.
The pixel values in the color image will be replaced with a predefined color S (Purple) if the corresponding pixels in the grayscale image are less than the threshold value T as shown in the following equation,
๐‘‚(๐‘ฅ, ๐‘ฆ) = { ๐‘† ๐‘–๐‘“ ๐ผ๐‘ก (๐‘ฅ, ๐‘ฆ) > ๐‘‡
๐ผ๐‘ฃ (๐‘ฅ, ๐‘ฆ) ๐‘œ๐‘กโ„Ž๐‘’๐‘Ÿ๐‘ค๐‘–๐‘ ๐‘’
where ๐‘‚(๐‘ฅ, ๐‘ฆ) is the output intensity value at (๐‘ฅ, ๐‘ฆ),
๐ผ๐‘ก (๐‘ฅ, ๐‘ฆ) is the thermal intensity value at (๐‘ฅ, ๐‘ฆ),
๐ผ๐‘ฃ (๐‘ฅ, ๐‘ฆ) is the visible intensity value at (๐‘ฅ, ๐‘ฆ),
๐‘† is the predefined intensity value of color image, ๐‘‡ (80) is the threshold value of thermal image.
  ๋Œ“๊ธ€ ์ˆ˜: 1
DGM
DGM 2023๋…„ 2์›” 3์ผ
Two things:
  • In order to provide an example, we need two images. We need a single-channel image representing temperature, and then we need a pseudocolor image which will be edited.
  • The equation you pasted states the opposite of your description. It states that the image regions which exceed the threshold are to be replaced.
So, do you have example images? What is the threshold and threshold behavior? What is the replacement color?
It may seem trivial that I would ask for the replacement color, but depending on the relationship between the replacement color and the colormap used by the pseudocolor image, the task may be simplified.

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

๋‹ต๋ณ€ (1๊ฐœ)

Image Analyst
Image Analyst 2023๋…„ 2์›” 3์ผ
mask = grayImage < 80;
S = [68, 14, 98]; % Purple color.
outputImage = imoverlay(grayImage, mask, S);

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Image Thresholding์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

์ œํ’ˆ

Community Treasure Hunt

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

Start Hunting!

Translated by