change color of specific location in image

조회 수: 2 (최근 30일)
chess
chess 2014년 8월 7일
댓글: Image Analyst 2016년 7월 3일
Hi assume I have an image, is there anyway to say to Matlab that I want the center pixels to be blue the corner to be yellow meaning that apply colormap to specific location?

답변 (1개)

Walter Roberson
Walter Roberson 2016년 7월 3일
There is no way to apply a colormap to a particular location only. In any one image, if you want two locations to have different colors, then the two locations must be given different values.
What you can do is create two images on top of each other, setting the AlphaData property of the top image to 0 in the place where you want the bottom image to show through.
In R2014a and earlier, colormaps are figure properties, so you would not simply be able to use different colormaps for the two images: you would need to convert one of the images to RGB, such as by using the File Exchange contribution freezeColors .
In R2014b and later, colormaps are axes properties, so you would not simply be able to use different colormaps for the two images in the same axes. However, you can use two different axes that are in the same Position to have them "stack up"
  댓글 수: 1
Image Analyst
Image Analyst 2016년 7월 3일
Or simply use an RGB image, instead of a colormap on an indexed image.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by