【图像检测-显著性检测】基于蚁群算法优化图像视觉显着性检测附matlab代码

简介: 【图像检测-显著性检测】基于蚁群算法优化图像视觉显着性检测附matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法  神经网络预测雷达通信 无线传感器

信号处理图像处理路径规划元胞自动机无人机

⛄ 内容介绍

边缘信息是图像最基本的特征,所包含的也是图像中用于识别的有用信息。为人们描述或识别目标以及解释图像提供了有价值的和重要的信息。边缘检测一直是计算机视觉和图像处理领域的经典研究课题之一。其目的是去发现图像中关于形状和反射或透射比的信息,是图像处理、图像分析、模式识别、计算机视觉以及人类视觉的基本步骤之一,其结果的正确性和可靠性将直接影响到机器视觉系统对客观世界的理解。由于目标边缘、图像纹理甚至噪声都可能成为有意义的边缘,因此很难找到一种普适性的边缘检测算法,现有诸多边缘检测的方法各有其特点,同时也都存在着各自的局限性和不足之处,因此图像的边缘检测这个领域还有待于进一步的改进和发展。

⛄ 部分代码

function saliency_EL_2010_main

%

% This is a demo program of the paper L. Ma, J. Tian, and W. Yu,

% "Visual saliency detection in image using ant colony optimisation and local phase coherence,"

% Electronics Letters, Vol. 46, Jul. 2010, pp. 1066-1068.

clear all; close all; clc;


% Load test image

img_in = double(imread('rice.png'));


% Perform saliency detection

mask = func_saliency_aco_phase(img_in);

figure;

subplot(121)

imshow(img_in,[]);

title('原图')

subplot(122)

imshow(mask );

title('蚁群增强后的图')

% Write the output saliency map

imwrite(uint8(mask),'test_saliency_map.bmp','bmp');

           temp_col = (ant_search_range_col .* temp)';

           [ii, jj, vv] = find(temp_col);

           ant_next_col = vv;


           ant_current_path_val(:,nMoveStep+1) = img_1D((ant_next_row-1).*ncol+ant_next_col);

           ant_current_path_row(:,nMoveStep+1) = ant_next_row;

           ant_current_path_col(:,nMoveStep+1) = ant_next_col;


           ant_current_row = ant_next_row;

           ant_current_col = ant_next_col;                

           ant_current_val = img_1D((ant_current_row-1).*ncol+ant_current_col);


           rr = ant_current_row;

           cc = ant_current_col;

           delta_p_1D((rr-1).*ncol+cc,1) = 1;

           delta_p = func_LexicoOrder_2D(delta_p_1D, nrow, ncol);

       end % end of nMoveStep


       p = (1-phi).*p + delta_p.*v.*(v>mean(v(:)));          

       p_1D = func_2D_LexicoOrder(p);

       delta_p = zeros(size(img));

       delta_p_1D = func_2D_LexicoOrder(delta_p);


end % end of nIteration


% Perform normalization to be range [0,255];

p = p./(sum(sum(p)));

p = (p-min(p(:)))./(max(p(:))-min(p(:))).*255;


%-------------------------------------------------------------------------

%------------------------------Inner Function ----------------------------

%-------------------------------------------------------------------------

% Convert data from 2D format to 1D format

function result = func_2D_LexicoOrder(x)

temp = x';

result = temp(:);


%-------------------------------------------------------------------------

%------------------------------Inner Function ----------------------------

%-------------------------------------------------------------------------

% Convert data from 1D format to 2D format

function result = func_LexicoOrder_2D(x, nRow, nColumn)

result = reshape(x, nColumn, nRow)';


%-------------------------------------------------------------------------

%------------------------------Inner Function ----------------------------

%-------------------------------------------------------------------------

% Calculate local phase coherence at each pixel position

function phaseCongruency = func_phasecong(im)                    


sze = size(im);


if nargin < 2

   nscale          = 3;     % Number of wavelet scales.

end

if nargin < 3

   norient         = 6;     % Number of filter orientations.

end

if nargin < 4

   minWaveLength   = 3;     % Wavelength of smallest scale filter.

end

if nargin < 5

   mult            = 2;     % Scaling factor between successive filters.

end

if nargin < 6

   sigmaOnf        = 0.55;  % Ratio of the standard deviation of the

                            % Gaussian describing the log Gabor filter's transfer function

    % in the frequency domain to the filter center frequency.

end

if nargin < 7

   dThetaOnSigma   = 1.7;   % Ratio of angular interval between filter orientations

    % and the standard deviation of the angular Gaussian

    % function used to construct filters in the

                            % freq. plane.

end

if nargin < 8

   k               = 3.0;   % No of standard deviations of the noise energy beyond the

    % mean at which we set the noise threshold point.

    % standard deviation to its maximum effect

                            % on Energy.

end

if nargin < 9

   cutOff          = 0.4;   % The fractional measure of frequency spread

                            % below which phase congruency values get penalized.

end

 

g               = 10;    % Controls the sharpness of the transition in the sigmoid

                        % function used to weight phase congruency for frequency

                        % spread.

epsilon         = .0001; % Used to prevent division by zero.



thetaSigma = pi/norient/dThetaOnSigma;  % Calculate the standard deviation of the

                                       % angular Gaussian function used to

                                       % construct filters in the freq. plane.


imagefft = fft2(im);                    % Fourier transform of image

sze = size(imagefft);

rows = sze(1);

%-------------------------------------------------------------------------

%------------------------------Inner Function ----------------------------

%-------------------------------------------------------------------------

function a = submat(big,i,cols)


a = big(:,((i-1)*cols+1):(i*cols));


⛄ 运行结果

⛄ 参考文献

[1]张景虎. 基于蚁群算法的图像边缘检测研究[D]. 陕西师范大学, 2009.

[1] Kaur P ,  Gupta E N . Image Segmentation using Ant Colony Optimization and to Improved the Selection of Poor Segmentation.

❤️ 关注我领取海量matlab电子书和数学建模资料
❤️部分理论引用网络文献,若有侵权联系博主删除


相关文章
|
机器学习/深度学习 算法 机器人
使用哈里斯角Harris和SIFT算法来实现局部特征匹配(Matlab代码实现)
使用哈里斯角Harris和SIFT算法来实现局部特征匹配(Matlab代码实现)
650 8
|
机器学习/深度学习 算法 自动驾驶
基于导向滤波的暗通道去雾算法在灰度与彩色图像可见度复原中的研究(Matlab代码实现)
基于导向滤波的暗通道去雾算法在灰度与彩色图像可见度复原中的研究(Matlab代码实现)
854 8
|
机器学习/深度学习 算法 机器人
【水下图像增强融合算法】基于融合的水下图像与视频增强研究(Matlab代码实现)
【水下图像增强融合算法】基于融合的水下图像与视频增强研究(Matlab代码实现)
1221 0
|
算法 定位技术 计算机视觉
【水下图像增强】基于波长补偿与去雾的水下图像增强研究(Matlab代码实现)
【水下图像增强】基于波长补偿与去雾的水下图像增强研究(Matlab代码实现)
1383 0
|
算法 机器人 计算机视觉
【图像处理】水下图像增强的颜色平衡与融合技术研究(Matlab代码实现)
【图像处理】水下图像增强的颜色平衡与融合技术研究(Matlab代码实现)
474 0
|
新能源 Java Go
【EI复现】参与调峰的储能系统配置方案及经济性分析(Matlab代码实现)
【EI复现】参与调峰的储能系统配置方案及经济性分析(Matlab代码实现)
493 0
|
机器学习/深度学习 数据采集 存储
概率神经网络的分类预测--基于PNN的变压器故障诊断(Matlab代码实现)
概率神经网络的分类预测--基于PNN的变压器故障诊断(Matlab代码实现)
1829 92
|
机器学习/深度学习 编解码 算法
基于OFDM技术的水下声学通信多径信道图像传输研究(Matlab代码实现)
基于OFDM技术的水下声学通信多径信道图像传输研究(Matlab代码实现)
591 8
|
机器学习/深度学习 数据采集 测试技术
基于CEEMDAN-VMD-BiLSTM的多变量输入单步时序预测研究(Matlab代码实现)
基于CEEMDAN-VMD-BiLSTM的多变量输入单步时序预测研究(Matlab代码实现)
510 8
|
编解码 运维 算法
【分布式能源选址与定容】光伏、储能双层优化配置接入配电网研究(Matlab代码实现)
【分布式能源选址与定容】光伏、储能双层优化配置接入配电网研究(Matlab代码实现)
1087 12

热门文章

最新文章