필터 지우기
필터 지우기

How can I assign a particular color to all the pixels having temperature above a certain value in a thermal image?

조회 수: 1 (최근 30일)
I have a thermal image in .csv format. What I want to do is highlight the areas having temperature above a certain value. I am looking for a way to assign a particular color to all pixels having temperature above my reference and display the final result.

채택된 답변

Walter Roberson
Walter Roberson 2016년 2월 19일
Create a colormap that has that highlight color as the last row. image() or imagesc() the data. caxis() with the threshold as the upper bound. Any value beyond that bound will map to the last color in the table.
For example,
cmap = colormap(copper(128));
cmap(end,:) = [0 1 1]; %highlight color
image(YourData)
colormap(cmap)
caxis([0 87.23])
everything from 87.23 onwards would be mapped to the top color
  댓글 수: 4
Walter Roberson
Walter Roberson 2016년 2월 20일
No, this is a technique that only works for assigning a special color for high values or low values.
If you want to color according to range of temperatures, use histc() or histcounts() to generate a group number (a positive integer) for each location, and use the group number as the color information. The group number will then be an index into your colormap. For example,
[~, groupnum] = histc( YourData, [-inf, -50, -37, -1, 22, 158, inf]);
image(groupnum)
colormap(hsv(6))
The first color would be everything < -50, the second color would be -50 <= x < -37, the third color would be -37 <= x < -1, the fourth color would be -1 <= x < 22, the fifth color would be 22 <= x < 158, the sixth color would be 158 <= x. (Technically, with histc there would also be a 7th color if any of the data was itself inf)

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by