[Image enhancement] Gray-scale image enhancement based on matlab area similarity transformation function and dragonfly algorithm [including Matlab source code 089]

1. Introduction

Image enhancement is a necessary and indispensable technology to increase the quality of digital images. The main task is to generate the intensity value of each pixel in a new image using a conversion function to receive the intensity value of each pixel in the input image. The proposed transfer function study is called the Regional Similarity Transfer Function (RSTF), which considers that the density distribution is similar between adjacent pixels. Dragonfly Algorithm (DA) is an intuitive optimization technique, which is the preferred engineering application, and has been used to optimize the parameter values ​​of the proposed transfer function.

Second, the source code

 
% Using the Regional Similarity Transformation Function and Dragonfly Algorithm. 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%THIS IS A DEMO FOR NOVEL IMAGE ENHANCEMENT USING GRAV脻TAT脻ONAL SEARCH ALGORITHM 
clc;
clear all;
close all;
 
%READ IMAGE
i=imread('test5.bmp');
i=imresize(i,1);  
 
%--------------------------------------------------------------------------
%GLOBAL MEAN
frekans=zeros(256,1);
 
% It records by counting how many times each pixel value is.
 
for k=1:size(i,1)
    for l=1:size(i,2)
 
        value=i(k,l);
       frekans(value+1)=frekans(value+1)+1; 
 
    end
end
deger=max(frekans);
for k=1:256
    if deger==frekans(k)
        D=k;
    end
end
D=double(D/255);
image = im2double(i);
global_mean = D;
%--------------------------------------------------------------------------
% LOCAL MEAN
Bmean = mean_n(image);
%--------------------------------------------------------------------------
%SIMILARITY
[S]=similarity(i);
B=double(S);
%--------------------------
C = std_n(image,Bmean);
im_size = size(image);
%-------------------------------------------------------------------------
%OPTIMIZATION PARAMETERS
N=15; % Agent number;
Max_iteration=15;
%-------------------------------------------------------------------------
%CALL FUNCTION 
 
[parameters Fbest BestChart MeanChart] = GSA_enhancement2(image,global_mean,B,C,im_size, N, Max_iteration);
 
enh = trans(i,image, B, C, global_mean, parameters(1),parameters(2),parameters(3),parameters(4) );
 
figure;
subplot(121)
imshow(image);
title('原图')
subplot(122)
imshow(enh);
   title('GSA增强后的灰度图')

Insert picture description here

Four, remarks

Complete code or writing add QQ2449341593 past review
>>>>>>
[Matlab 024] [Image processing 1] Image compression of Matlab image processing tutorial series
[Matlab 025] [Image processing 2] Matlab image processing tutorial series Image segmentation (1)
[Matlab 026 issue] [Image processing 3] Image segmentation of Matlab image processing tutorial series (2)
[Matlab 029] [Image processing 4] Matlab fingerprint recognition
[Matlab 030] [Image processing 5] Bank Card number recognition matlab source code
[Matlab 074] [Image processing 6] [Image clustering] Based on FCM and improved FCM brain CT image clustering processing
[Matlab 075] [Image processing 7] [Image evaluation] Based on CCF algorithm Image quality evaluation
[Matlab 076] [Image processing 8] [Image enhancement] CLAHE algorithm based on local contrast enhancement-histogram enhancement
[Matlab 077] [Image processing 9] [Image fusion] Image fusion based on Frequency Partition
[ Matlab Issue 078] [Image Processing 10] [Image Evaluation] Image quality evaluation based on svm without reference
[Image Edge Detection] Matlab source code of ellipse edge detection based on least square method [Matlab Issue 079] [Image Processing 11]
[Image Encryption] Image encryption and decryption based on chaotic system matlab source code with GUI [Matlab 080 period] [Image processing 12]
[Image processing] Based on DWT+DCT+PBFO to improve image watermark hiding and extraction matlab source code with GUI [Matlab 081 period] [Image processing 13]
[Image registration] Image registration matlab source code based on sift algorithm [Matlab 082] [Image processing 14]
[Image fusion] Image fusion matlab source code based on CBF algorithm [Matlab 083] [Image processing 15]
[Image segmentation] Image segmentation matlab source code based on random walk algorithm [Matlab 084] [Image processing 16]
[Image filtering] Image two-dimensional bilateral Gaussian filtering [Matlab 085] [Image processing 17]
[Image denoising] Based on adaptive morphology Image denoising [Matlab 086 issue] [Image processing 18]
[Image enhancement] DEHAZENET and HWD based underwater scattering image enhancement [Matlab 087] [Image processing 19]
[Image enhancement] PSO optimization ACE image enhancement matlab Source code [Matlab Issue 088] [Image Processing 20]
[Image Enhancement] Grayscale image enhancement based on region similarity transformation function and dragonfly algorithm [Matlab Issue 089] [Image processing 21]

Guess you like

Origin blog.csdn.net/TIQCmatlab/article/details/113028222