Various color mapping, resizing and changing resolution, gamma correction, contrast, inverting colors Matlab code implementation…

?About the author: A Matlab simulation developer who loves scientific research. He cultivates his mind and improves his technology simultaneously. For cooperation on MATLAB projects, please send a private message.

Personal homepage: Matlab Research Studio

Personal credo: Investigate things to gain knowledge.

Content introduction

In the field of digital image processing, we often need to perform various processing operations on images to obtain the visual effects we require. Some common operations include color mapping, resizing and changing resolution, gamma correction, contrast adjustment, and color inversion. This article will delve into the principles, applications, and effects of these operations.

First, let’s understand color mapping. Color mapping is the process of mapping an image from one color space to another. Common color spaces include RGB (red, green, blue), CMYK (cyan, yellow, magenta, black), and HSV (hue, saturation, brightness). Through color mapping, we can change the hue, saturation and brightness of the image to achieve different visual effects. For example, converting a color image to a black and white image is a color mapping operation.

Next, we’ll discuss resizing and changing resolution. Resizing refers to changing the dimensions of an image, usually by increasing or decreasing the number of pixels in the image. This can be used to resize the image on different display devices, or to create thumbnails. Changing the resolution refers to changing the pixel density of the image, which is the number of pixels per inch. By increasing or decreasing pixel density, we can change the clarity and level of detail in an image.

Gamma correction is an operation used to adjust the brightness and contrast of an image. It is based on the way the human eye perceives brightness and changes the overall brightness of the image by adjusting the brightness curve of the image. Gamma correction can be used to increase the contrast of an image, making it more vivid and clear.

Contrast adjustment is an operation that changes the difference between brightness levels in an image. By increasing or decreasing the difference between brightness levels, we can change the overall contrast of the image. This is useful for highlighting details in an image or creating an artistic effect.

Finally, we’ll discuss color inversion. Color inversion is an operation that inverts the color values in an image. This means that bright pixels become darker, dark pixels become lighter, red becomes cyan, green becomes magenta, and blue becomes yellow. Color inversion can be used to create artistic effects or enhance specific areas in an image.

To summarize, various color mapping, resizing and changing resolution, gamma correction, contrast adjustment, and color inversion operations are all common operations in digital image processing. They can be used to change the appearance and visual effects of an image, making it more vivid, clear and attractive. Whether in artistic creation or scientific research, these operations play an important role. By in-depth understanding of the principles and applications of these operations, we can better utilize digital image processing technology to create stunning image works.

Part of the code

m=1;
for i=0:pi/180:2*pi
    if(p==1)
        D2(m)=sqrt((P(2,1)-d(1)*cos(i))^2 + (P(2,2)-d(1)*sin(i))^2);
        D3(m)=sqrt((P(3,1)-d(1)*cos(i))^2 + (P(3,2)-d(1)*sin(i))^2);
        e2(m)=abs(D2(m)-d(2));
        e3(m)=abs(D3(m)-d(3));
        subplot(3,1,1);
        plot(m,D2(m),'k.');
        hold on
        grid on
        xlabel('angle in degrees')
        ylabel('distance')
        title('variation in distance with angle')
        subplot(3,1,2);
        plot(m,D3(m),'b.');
        xlabel('angle in degrees')
        ylabel('distance')
        title('variation in distance with angle')
        hold on
        grid on
    elseif(p==2)
        D1(m)=sqrt((P(1,1)-d(1)*cos(i))^2 + (P(1,2)-d(1)*sin(i))^2);
        D3(m)=sqrt((P(3,1)-d(1)*cos(i))^2 + (P(3,2)-d(1)*sin(i))^2);
        e1(m)=abs(D1(m)-d(1));
        e3(m)=abs(D3(m)-d(3));
        subplot(3,1,1);
        plot(m,D1(m),'k.');
        hold on
        grid on
        xlabel('angle in degrees')
        ylabel('distance')
        title('variation in distance with angle')
        subplot(3,1,2);
        plot(m,D3(m),'b.');
        hold on
        grid on
        xlabel('angle in degrees')
        ylabel('distance')
        title('variation in distance with angle')
    else
        D1(m)=sqrt((P(1,1)-d(1)*cos(i))^2 + (P(1,2)-d(1)*sin(i))^2);
        D2(m)=sqrt((P(2,1)-d(1)*cos(i))^2 + (P(2,2)-d(1)*sin(i))^2);
        e1(m)=abs(D1(m)-d(1));
        e2(m)=abs(D2(m)-d(2));
        subplot(3,1,1);
        plot(m,D1(m),'k.');
        hold on
        grid on
        xlabel('angle in degrees')
        ylabel('distance')
        title('variation in distance with angle')
        subplot(3,1,2);
        plot(m,D2(m),'b.');
        hold on
        grid on
        xlabel('angle in degrees')
        ylabel('distance')
        title('variation in distance with angle')
    end
m=m + 1;
end

Run results

Various color mapping, resizing and changing resolution, gamma correction, contrast, invert Color conversion Matlab code implementation_layout optimization

References

[1] Kang Yanni, Huang Huan, Zhu Yuyan, et al. SIFT-based super-resolution image registration and MATLAB implementation [J]. Computer Knowledge and Technology: Academic Edition, 2009, 5(10):3.DOI:10.3969/ j.issn.1009-3044.2009.28.079.

[2] Zhao Hongyan, Tang Wanyou, Tan Huan. Research on the edge detection effect of images with different resolutions based on MATLAB [J]. Packaging Engineering, 2009(11):4.DOI:CNKI:SUN:BZGC.0.2009-11 -028.

Some theories are quoted from online literature. If there is any infringement, please contact the blogger to delete it
Follow me to receive massive matlab e-books and mathematical modeling materials

Complete private message code and data acquisition and paper simulation simulation

1 Improvements and applications of various intelligent optimization algorithms
Production scheduling, economic scheduling, assembly line scheduling, charging optimization, workshop scheduling, departure optimization, reservoir scheduling, three-dimensional packing, logistics location selection, cargo space optimization, bus scheduling optimization, charging pile layout optimization, workshop layout optimization, Container ship stowage optimization, water pump combination optimization, medical resource allocation optimization, facility layout optimization, visible area base station and drone site selection optimization
2 Machine learning and deep learning
Convolutional neural network (CNN), LSTM, support vector machine (SVM), least squares support vector machine (LSSVM), extreme learning machine (ELM), kernel extreme learning machine (KELM), BP, RBF, width Learning, DBN, RF, RBF, DELM, XGBOOST, TCN realize wind power prediction, photovoltaic prediction, battery life prediction, radiation source identification, traffic flow prediction, load prediction, stock price prediction, PM2.5 concentration prediction, battery health status prediction, water body Optical parameter inversion, NLOS signal identification, accurate subway parking prediction, transformer fault diagnosis
2. Image processing
Image recognition, image segmentation, image detection, image hiding, image registration, image splicing, image fusion, image enhancement, image compressed sensing
3 Path planning
Traveling salesman problem (TSP), vehicle routing problem (VRP, MVRP, CVRP, VRPTW, etc.), UAV three-dimensional path planning, UAV collaboration, UAV formation, robot path planning, raster map path planning , multimodal transportation problems, vehicle collaborative UAV path planning, antenna linear array distribution optimization, workshop layout optimization
4 UAV application
UAV path planning, UAV control, UAV formation, UAV collaboration, UAV task allocation, and online optimization of UAV safe communication trajectories
5 Wireless sensor positioning and layout
Sensor deployment optimization, communication protocol optimization, routing optimization, target positioning optimization, Dv-Hop positioning optimization, Leach protocol optimization, WSN coverage optimization, multicast optimization, RSSI positioning optimization
6 Signal processing
Signal recognition, signal encryption, signal denoising, signal enhancement, radar signal processing, signal watermark embedding and extraction, EMG signal, EEG signal, signal timing optimization
7 Power system aspects
Microgrid optimization, reactive power optimization, distribution network reconstruction, energy storage configuration
8 cellular automata
Traffic flow, crowd evacuation, virus spread, crystal growth
9 Radar
Kalman filter tracking, track correlation, track fusion

The knowledge points of the article match the official knowledge files, and you can further learn related knowledge. Algorithm skill tree Home page Overview 56093 people are learning the system