Color image--pseudo-color processing gray-scale image to pseudo-color images

Source: Internet
Author: User
Tags scale image

Study Dip 68th Day
Reprint please indicate the source of this article:Http://blog.csdn.net/tonyshengtan , out of respect for the work of the author, reprint please indicate the source! Article code is hosted, Welcome to co-development:Https://github.com/Tony-Tan/DIPpro

The opening crap.

Looked at Gonzalez's book, found that the color image processing only used a chapter to introduce, the reason for analysis, and later found, as if other introduction is not much, to arrive at a conclusion, Gonzalez this book can only as a programmatic introduction, it basically covers the basic knowledge of image processing, But if you want to use some direction as a job, you need to continue to find more professional books and open source projects to learn. Or as I complained before, every time I read a book before you will become super powerful, but every time after reading a book will feel like a fool, need more books to learn, so cycle, this life will not be happy. Steal a picture, share with you

Principle

When it comes to pseudo-color images, the corresponding is True color, the following describes the difference and nature.
We know that the wavelength range of the light can be observed is limited, only then a small segment, in other words, there is a large segment of light, only a small part of the color, the other is grayscale, but human vision has a feature is, can only distinguish more than 20 kinds of grayscale, that is, the acquisition of Grayscale image resolution super high, There are 1000 gray levels, but unfortunately, people can only see more than 20, that is, the information lost 50 times times, but the human vision of the color of the resolution is quite strong, can distinguish thousands of kinds of color.
In terms of acquisition, pseudo color and True color, the original image is grayscale image
Source of grayscale Images:

    1. Single-channel cameras or other sensors (such as those used in CT) capture gray-scale images, which include electromagnetic waves with frequencies higher than the visible frequency of single-channel acquisition, visible light, and electromagnetic waves below the visible frequency.

      The red box in the picture is not visible light, there is no color, so they must be a grayscale image, need to be pseudo-color processing.
    2. The use of multi-channel acquisition equipment collected by the non-visible light, this image is sometimes a single channel, is 1 said, also may be multi-channel, as satellite is possible, infrared, visible light, there are other non-visible light acquisition equipment, such multi-channel grayscale image sometimes need to be pseudo-color processing.

Source of True Color graphs:
Multi-channel acquisition equipment, more for the camera to capture visible light, so that the multi-channel true color image.

Algorithm analysis

For single-channel gray-scale conversion to pseudo-color image of the method is to map a grayscale to a color, and mapping is not unique, can be set according to the needs of their own, the following code used by the algorithm I think out, using the HSV color space, The saturation and brightness are set to 1.0, and hue uses shades of 0 to 255 to map to 0° to 270 °:

Code
void Gray2color (double*src, rgb* DST,intWidthintHeightintType) {hsv* temp= (HSV*)malloc (sizeof (HSV)*width*height); for(intI=0; i<width*height; i++) {double gray_value=src[i];if(type==highvalue_equ_red) TEMP[I].C1=HSVMAX-GRAY2HSV*gray_value;Else if(type==lowvalue_equ_red) TEMP[I].C1=GRAY2HSV*gray_value; Temp[i].c2=1.0; temp[i].c3=1.0;    } hsv2rgb (temp, DST, width, height); Free (temp);}
Effect analysis

Grayscale Progressive graphs:



MacBook Pro X-ray scanning diagram



Satellite topographic map:



Nebula:



Summarize

Pseudo-color plot township relative gray-scale image can recognize more details, and the resolution is stronger. and the conversion mode is flexible, you can design the conversion function, or self-made mapping table.
Cond...

Color image--pseudo-color processing gray-scale image to pseudo-color images

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.