Research on image fusion algorithm based on shear transformation and average brightness with matlab code

?About the author: A Matlab simulation developer who loves scientific research. He cultivates his mind and improves his technology simultaneously.

For complete code, paper reproduction, journal cooperation, paper tutoring and scientific research simulation cooperation, please send a private message.

Personal homepage: Matlab Research Studio

Personal credo: Investigate things to gain knowledge.

For more complete Matlab code and simulation customization content, click

Intelligent optimization algorithm Neural network prediction Radar communication Wireless sensor Power system

Signal processing Image processing Path planning Cellular automaton Drone

Content introduction

Image fusion is an important research direction in the field of computer vision, aiming to fuse multiple images into an image with more information and visual effects. This article will introduce an image fusion algorithm based on shear transformation and average brightness, and elaborate on its algorithm steps.

The goal of the image fusion algorithm is to reasonably fuse the useful information in multiple images to produce a better image. The steps of this algorithm mainly include: image preprocessing, shearing transformation, brightness adjustment and image synthesis.

First, image preprocessing is performed. This step is mainly to perform some basic processing on the image to be fused, such as resizing the image, removing noise, etc. The purpose of preprocessing is to improve the processing effect of subsequent steps.

Next is the shear transformation. The purpose of this step is to cut the images to be fused so that their edges align. Shear transformation can be achieved by finding common feature points between two images and performing corresponding transformations. The advantage of this is that it can reduce the distortion of the fused image and improve the fusion effect.

Then there is the brightness adjustment. After shear transformation, since there may be differences in the brightness of the images, the brightness of the images needs to be adjusted to make their brightness more consistent. Commonly used brightness adjustment methods include histogram equalization and grayscale stretching. Through brightness adjustment, you can make the fused image more natural and realistic.

The last step is image synthesis. After the previous steps, the shear transformed and brightness adjusted images can be fused. Commonly used image fusion methods include weighted average method and multi-resolution fusion method. The weighted average method is to weight and average the images to be fused according to a certain weight to obtain the final fused image. The multi-resolution fusion method decomposes the image into different resolution levels, then fuses each level, and finally reconstructs it. These methods can be selected according to actual needs to obtain the best fusion effect.

In summary, the image fusion algorithm based on shear transformation and average brightness is an effective image fusion method. By shearing, transforming, and brightness adjusting the image, and using appropriate image synthesis methods, a fused image with more information and visual effects can be obtained. This algorithm has broad application prospects in the field of computer vision and can be used in image enhancement, target detection, etc., and has important research and practical value.

Part of the code

addpath(genpath('ShearLab3D'))</code><code>?</code><code>% Read image</code><code>img1 = imread('c07_1.tif\ ');</code><code>img2 = imread('c07_2.tif');</code><code>?</code><code>% Adjust image size</code><code>figure (1);</code><code>img1 = imresize(img1,[512,512]);</code><code>imshow(img1);</code><code>title('Image1'); </code><code>figure(2);</code><code>img2 = imresize(img2,[512,512]);</code><code>imshow(img2);</code><code>title ('Image2');</code><code>oeffs_fused,shearletSystem);</code><code>?</code><code>% Display fused image</code><code>figure(3) ;</code><code>imshow(uint8(fused_image));</code><code>title('Fused Image');</code><code>?</code><code>% original Image</code><code>original1 = double(img1);</code><code>original2 = double(img2);</code><code>?</code><code>% Peak Signal-to- Noise Ratio (PSNR)</code><code>% psnr1 = psnr(fused_image, original1);</code><code>% psnr2 = psnr(fused_image, original2);</code><code>psnr1 = calculate_psnr( fused_image, original1);</code><code>psnr2 = calculate_psnr(fused_image, original2);</code><code>fprintf('PSNR for image 1: %f\\
', psnr1);</code> code><code>fprintf('PSNR for image 2: %f\\
', psnr2);</code><code>?</code><code>% Structural Similarity Index (SSIM)</code><code>ssim1 = ssim(fused_image, original1);</code><code>ssim2 = ssim(fused_image, original2);</code><code>fprintf('SSIM for image 1: %f\\
 ', ssim1);</code><code>fprintf('SSIM for image 2: %f\\
', ssim2);</code><code>?</code><code>% % Mean Squared Error (MSE)</code><code>% mse1 = immse(fused_image, original1);</code><code>% mse2 = immse(fused_image, original2);</code><code>% fprintf( 'MSE for image 1: %f\\
', mse1);</code><code>% fprintf('MSE for image 2: %f\\
', mse2);</code> <code>% </code><code>% % Mean Absolute Difference (MAD)</code><code>% mad1 = mean(abs(fused_image(:) - original1(:)));</code><code>% mad2 = mean(abs(fused_image(:) - original2(:)));</code><code>% fprintf('MAD for image 1: %f\\
', mad1);</code><code>% fprintf('MAD for image 2: %f\\
', mad2);</code><code>% </code><code>% % NCC</code><code>% ncc_value1 = NCC(fused_image, original1);</code><code>% ncc_value2 = NCC(fused_image, original2);</code><code>% fprintf('NCC for image 1: %f\ n', ncc_value1);</code><code>% fprintf('NCC for image 2: %f\\
', ncc_value2);</code><code>% </code><code> % % MAE</code><code>% mae_value1 = MAE(fused_image, original1);</code><code>% mae_value2 = MAE(fused_image, original2);</code><code>% fprintf('MAE for image 1: %f\\
', mae_value1);</code><code>% fprintf('MAE for image 2: %f\\
', mae_value2);</code><code> ?</code><code>% Compute the standard deviation</code><code>sd_fused = std(double(fused_image(:)));</code><code>fprintf('SD of fused image: % f\\
', sd_fused);</code><code>?</code><code>% Spatial Frequency</code><code>sf = mean(abs(diff(double(fused_image), 1, 1)), 'all') + mean(abs(diff(double(fused_image), 1, 2)), 'all');</code><code>fprintf('Spatial Frequency of fused image: %f\\
', sf);</code><code>?</code><code>% Average Gradient</code><code>[gradX, gradY] = gradient(double(fused_image) );</code><code>ag = mean(sqrt(gradX.^2 + gradY.^2), 'all');</code><code>fprintf('Average Gradient of fused image: %f\\
', ag);</code><code>?</code><code>% Information Entropy</code><code>ie = entropy(fused_image);</code><code> fprintf('Information Entropy of fused image: %f\\
', ie);</code><code>?</code><code>% Mutual Information</code><code>mi1 = mi( double(original1), double(fused_image));</code><code>fprintf('Mutual Information of fused image and original image 1: %f\\
', mi1);</code><code> mi2 = mi(double(original2), double(fused_image));</code><code>fprintf('Mutual Information of fused image and original image 2: %f\\
', mi2);</code><code>?</code><code>?</code><code>?</code><code>% Additional functions</code><code>function ncc = NCC(img1, img2)</code><code> img1 = img1 - mean(img1(:));</code><code> img2 = img2 - mean(img2(:));</code><code> numerator = sum(sum(img1 . * img2));</code><code> denominator = sqrt(sum(sum(img1 .^ 2)) * sum(sum(img2 .^ 2)));</code><code> ncc = numerator / denominator;</code><code>end</code><code>?</code><code>function mae = MAE(target, reference)</code><code> error = target - reference;</code><code> mae = mean(abs(error(:)));</code><code>end</code><code>?</code><code>% Define the Mutual Information function</code> <code>function h = mi(A,B)</code><code> A = round((A - min(A(:))) / (max(A(:)) - min(A(:) )) * 255);</code><code> B = round((B - min(B(:))) / (max(B(:)) - min(B(:))) * 255); </code><code> jointHistogram = accumarray([A(:) B(:)] + 1, 1) / numel(A);</code><code> jointEntropy = - sum(jointHistogram(jointHistogram > 0) .* log2(jointHistogram(jointHistogram > 0)));</code><code> entropyA = entropy(uint8(A));</code><code> entropyB = entropy(uint8(B));</code><code> h = entropyA + entropyB - jointEntropy;</code><code>end</code><code>?</code><code>function psnr_val = calculate_psnr(img1, img2)</code><code> img1 = double(img1);</code><code> img2 = double(img2);</code><code> mse = mean((img1(:) - img2(:)).^2);</code><code> if mse == 0</code><code> psnr_val = Inf;</code><code> else</code><code> maxValue = double(max(img1(:))); </code><code> psnr_val = 20 * log10(maxValue/sqrt(mse));</code><code> end</code><code>end</code><code>?

Operation results

References

[1] Xu Lingzhang. Research on infrared and low-light image fusion algorithm based on TMS320DM6467 [D]. Yunnan Normal University, 2016.

[2] Yang Jinku. Research on image fusion algorithm based on two-dimensional empirical mode decomposition [D]. Northwestern Polytechnical University [2023-10-27]. DOI: CNKI: CDMD: 1.1017.803623.

[3] Wu Lulu. Research on video watermarking algorithm based on wavelet transform domain[D]. Jiangxi University of Science and Technology, 2013.

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

Private message complete code, paper reproduction, journal cooperation, paper tutoring and scientific research simulation customization

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 applications
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 aspect
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 57030 people are learning the system