《数字图像处理(MATLAB版)》相关算法代码及其分析(1)

news2024/9/26 5:23:24

目录

1 自适应中值滤波算法

1.1 函数定义

1.2 输入参数检查

1.3 初始化

1.4 自适应中值滤波过程

1.5 处理剩余未处理的像素

1.6 总结

2 计算输入数组的平均值

2.1 函数定义

2.2 注释

2.3 输入验证

2.4 计算平均值

2.5 总结

3 基于高斯模型的贝叶斯分类器

3.1 函数定义

3.2 输入校验和初始化

3.3 参数处理

3.4 计算协方差矩阵的行列式和逆矩阵

3.5 评估决策函数

3.6 分类决策

3.7 总结

4 将4连通边界转换为8连通边界

4.1 函数输入和输出

4.2 代码分析

4.3 关键函数和操作

4.4 总结


1 自适应中值滤波算法

function f = adpmedian(g, Smax)
%ADPMEDIAN Perform adaptive median filtering.
%   F = ADPMEDIAN(G, SMAX) performs adaptive median filtering of
%   image G.  The median filter starts at size 3-by-3 and iterates up
%   to size SMAX-by-SMAX. SMAX must be an odd integer greater than 1.

%   Copyright 2002-2004 R. C. Gonzalez, R. E. Woods, & S. L. Eddins
%   Digital Image Processing Using MATLAB, Prentice-Hall, 2004
%   $Revision: 1.5 $  $Date: 2003/11/21 14:19:05 $

% SMAX must be an odd, positive integer greater than 1.
if (Smax <= 1) | (Smax/2 == round(Smax/2)) | (Smax ~= round(Smax))
   error('SMAX must be an odd integer > 1.')
end
[M, N] = size(g);

% Initial setup.
f = g;
f(:) = 0;
alreadyProcessed = false(size(g));

% Begin filtering.
for k = 3:2:Smax
   zmin = ordfilt2(g, 1, ones(k, k), 'symmetric');
   zmax = ordfilt2(g, k * k, ones(k, k), 'symmetric');
   zmed = medfilt2(g, [k k], 'symmetric');
   
   processUsingLevelB = (zmed > zmin) & (zmax > zmed) & ...
       ~alreadyProcessed; 
   zB = (g > zmin) & (zmax > g);
   outputZxy  = processUsingLevelB & zB;
   outputZmed = processUsingLevelB & ~zB;
   f(outputZxy) = g(outputZxy);
   f(outputZmed) = zmed(outputZmed);
   
   alreadyProcessed = alreadyProcessed | processUsingLevelB;
   if all(alreadyProcessed(:))
      break;
   end
end

% Output zmed for any remaining unprocessed pixels. Note that this
% zmed was computed using a window of size Smax-by-Smax, which is
% the final value of k in the loop.
f(~alreadyProcessed) = zmed(~alreadyProcessed);

这段代码实现了一种自适应中值滤波算法,用于图像处理中的噪声去除。自适应中值滤波是一种非线性滤波技术,特别适合去除所谓的“胡椒盐”噪声,同时尽量保留图像的边缘和细节。与传统的中值滤波不同,自适应中值滤波可以根据局部区域的特征动态调整滤波器的大小。

下面是对该函数的详细分析:

1.1 函数定义

function f = adpmedian(g, Smax)
  • g是输入的待处理图像。
  • Smax是滤波器窗口的最大尺寸,必须是大于1的奇数。
  • 函数返回经过自适应中值滤波处理后的图像f

1.2 输入参数检查

if (Smax <= 1) | (Smax/2 == round(Smax/2)) | (Smax ~= round(Smax))
   error('SMAX must be an odd integer > 1.')
end

这部分代码确保Smax是一个大于1的奇数。如果不是,则抛出错误。

1.3 初始化

[M, N] = size(g);
f = g;
f(:) = 0;
alreadyProcessed = false(size(g));
  • 获取输入图像g的尺寸。
  • 创建输出图像f,并将其所有像素值初始化为0。
  • 创建一个与输入图像同尺寸的逻辑矩阵alreadyProcessed,用于标记每个像素是否已被处理,初始时全部设置为false

1.4 自适应中值滤波过程

for k = 3:2:Smax
   ...
end

通过从3x3开始,以步长为2(保证窗口尺寸始终为奇数),直至达到Smax的大小,进行迭代滤波。

在每次迭代中:

  1. 计算当前窗口尺寸下的最小值、最大值和中值滤波结果

    • zmin是窗口内的最小值。
    • zmax是窗口内的最大值。
    • zmed是窗口内的中值。
  2. 确定哪些像素需要使用Level B处理

    • 如果zmed > zminzmax > zmed,则当前像素的中值不是极端值,可以进行Level B处理。
  3. 确定具体的处理方式

    • 如果当前像素值g处于zminzmax之间,则保留原像素值。
    • 否则,使用中值zmed替换当前像素值。
  4. 更新已处理标记

    • 将经过处理的像素标记为true
  5. 提前终止

    • 如果所有像素都已处理,则提前结束循环。

1.5 处理剩余未处理的像素

f(~alreadyProcessed) = zmed(~alreadyProcessed);

对于那些在迭代过程中未被处理的像素,使用最后一次迭代计算的中值zmed进行填充。

1.6 总结

这段代码通过动态调整滤波窗口的大小,为每个像素选择一个合适的局部区域进行中值滤波,从而有效地去除噪声,尤其是在噪声密度变化较大的情况下,能够比传统的中值滤波器获得更好的效果。

2 计算输入数组的平均值

function av = average(A)
%AVERAGE Computes the average value of an array.
%   AV = AVERAGE(A) computes the average value of input array, A,
%   which must be a 1-D or 2-D array.  

%   Sample M-file used in Chapter 2.
%   Copyright 2002-2004 R. C. Gonzalez, R. E. Woods, & S. L. Eddins
%   Digital Image Processing Using MATLAB, Prentice-Hall, 2004
%   $Revision: 1.2 $  $Date: 2003/03/27 21:23:21 $

% Check the validity of the input. (Keep in mind that
% a 1-D array is a special case of a 2-D array.)
if ndims(A) > 2
   error('The dimensions of the input cannot exceed 2.')
end

% Compute the average
av = sum(A(:))/length(A(:));

这段代码定义了一个名为 average 的函数,其目的是计算输入数组 A 的平均值。这个函数可以处理一维(1-D)或二维(2-D)数组。以下是对该代码的详细分析:

2.1 函数定义

function av = average(A)

这一行定义了一个名为 average 的函数,它接收一个参数 A,并返回一个值 avA 是输入数组,而 av 将是计算出的平均值。

2.2 注释

代码中的注释提供了关于函数的基本信息,包括:

  • 函数的作用:计算数组的平均值。
  • 输入要求:输入 A 必须是一维或二维数组。
  • 版权信息和参考书籍。

2.3 输入验证

if ndims(A) > 2
   error('The dimensions of the input cannot exceed 2.')
end

这部分代码检查输入数组 A 的维度。如果 A 的维度超过2(即不是一维或二维数组),函数将抛出一个错误信息,提示用户输入的维度不能超过2。这是通过 ndims 函数来实现的,它返回数组的维度数。如果条件成立(维度大于2),则通过 error 函数显示错误信息。

2.4 计算平均值

av = sum(A(:))/length(A(:));

这行代码是函数的核心,用于计算输入数组的平均值。它首先将数组 A 转换为一个列向量 A(:)。这种转换确保了无论 A 的原始形状如何,计算都能正确进行。然后,使用 sum 函数计算所有元素的总和,再通过 length 函数获取元素的总数(即数组的长度)。最后,将总和除以长度得到平均值,并将结果赋值给 av

2.5 总结

这个 average 函数是一个简单而有效的工具,用于计算一维或二维数组的平均值。它首先验证输入数组的维度,然后计算并返回平均值。通过将数组转换为列向量并使用 sumlength 函数,这段代码以高效且容易理解的方式实现了其功能。

3 基于高斯模型的贝叶斯分类器

function d = bayesgauss(X, CA, MA, P)
%BAYESGAUSS Bayes classifier for Gaussian patterns.
%   D = BAYESGAUSS(X, CA, MA, P) computes the Bayes decision
%   functions of the n-dimensional patterns in the rows of X. 
%   CA is an array of size n-by-n-by-W containing W covariance
%   matrices of size n-by-n, where W is the number of classes.
%   MA is an array of size n-by-W, whose columns are the corres-
%   ponding mean vectors. A cov. matrix and a mean vector must be 
%   specified for each class, even is some are equal.  X is of size 
%   K-by-n, where K is the number of patterns to be classified. P is 
%   a 1-by-W array, containing the probabilities of occurrence of 
%   each class.  If P is not included in the argument, the classes 
%   are assumed to be equally likely.  
%
%   D, is a column vector of length K. Its ith element is the class
%   number assigned to the ith vector in X during classification.  

%   Copyright 2002-2004 R. C. Gonzalez, R. E. Woods, & S. L. Eddins
%   Digital Image Processing Using MATLAB, Prentice-Hall, 2004
%   $Revision: 1.8 $  $Date: 2004/01/18 01:34:28 $

d = [ ]; % Initialize d.
error(nargchk(3, 4, nargin)) % Verify correct no. of inputs.
n = size(CA, 1);             % Dimension of patterns.

% Protect against the possibility that the class number is
% included as an (n+1)th element of the vectors.
X = double(X(:, 1:n)); 
W = size(CA, 3); % Number of pattern classes.
K = size(X, 1);  % Number of patterns to classify.
if nargin == 3
   P(1:W) = 1/W; % Classes assumed equally likely.
else
   if sum(P) ~= 1 
      error('Elements of P must sum to 1.'); 
   end
end
% Compute the determinants.
for J = 1:W 
   DM(J) = det(CA(:, :, J)); 
end
% Compute inverses, using right division (IM/CA), where IM =
% eye(size(CA, 1)) is the n-by-n identity matrix. Re-use CA.
IM = eye(size(CA,1)); 
for J = 1:W 
   CA(:, :, J) = IM/CA(:, :, J); 
end
    
% Evaluate the decision functions. Note the use of 
% function mahalanobis discussed in Section 12.2.
MA = MA'; % Organize the mean vectors as rows.
for J = 1:W
   C = CA(:,:,J);
   M = MA(J,:);
   k1 = log(P(J));
   k2 = 0.5*log(DM(J));
   L(1:K,1) = k1;
   DET(1:K,1) = k2;
   if P(J) == 0;
      D(1:K, J) = -inf;
   else
      D(:, J) = L - DET - 0.5*mahalanobis(X, C, M);
   end
end

% Find the coordinates of the maximum value in each row. These maxima
% maxima give the class of each pattern:
[i, j] = find(D==repmat(max(D')',1,size(D,2)));
% Re-use X. It now contains the max value along each column.
X = [i j]; 
% Eliminate multiple classifications of the same patterns. Since
% the class assignment when two or more decision functions give
% the same value is arbitrary, we need to keep only one.
X = sortrows(X);
[b, m] = unique(X(:,1));
X = X(m, :);
% X is now sorted, with the 2nd column giving the class of the
% pattern no. in the 1st col.;  i.e., X(j, 1) refers to the jth
% input pattern, and X(j, 2) is its the class number.

% Output the result of classification. d is a col. vector with
% length equal to the total no. of inout patterns. The elements of 
% d are the classes into which the patterns were classified.
d = X(:,2);

这段代码实现了基于高斯模型的贝叶斯分类器。贝叶斯分类器是一种利用概率模型进行分类的方法,它在统计决策理论中占有重要地位。该代码的目的是对输入的样本集(X)进行分类,根据每个样本属于不同类别的概率,将样本分配到最可能的类别中。

下面是对这段代码的详细分析:

3.1 函数定义

function d = bayesgauss(X, CA, MA, P)

这个函数名为bayesgauss,接收四个参数:

  • X:待分类的样本集,大小为K-by-n,其中K是样本数量,n是特征维度。
  • CA:协方差矩阵数组,大小为n-by-n-by-WW是类别数。每个类别都有一个n-by-n的协方差矩阵。
  • MA:均值向量数组,大小为n-by-W,每列代表一个类别的均值向量。
  • P:类别出现的概率数组,大小为1-by-W。如果没有提供此参数,则假设所有类别出现的概率相等。

3.2 输入校验和初始化

error(nargchk(3, 4, nargin)) % Verify correct no. of inputs.

检查输入参数的数量是否正确,必须是3个或4个。

d = [ ]; % Initialize d.

初始化输出向量d为空,后续将填充这个向量以表示每个样本的分类结果。

3.3 参数处理

n = size(CA, 1);             % Dimension of patterns.
X = double(X(:, 1:n)); 
W = size(CA, 3); % Number of pattern classes.
K = size(X, 1);  % Number of patterns to classify.

获取样本特征维度n、类别数W、待分类样本数K。并确保X是双精度类型。

if nargin == 3
   P(1:W) = 1/W; % Classes assumed equally likely.
else
   if sum(P) ~= 1 
      error('Elements of P must sum to 1.'); 
   end
end

如果没有提供P参数,则假设所有类别出现的概率相等。如果提供了P,则检查其元素之和是否为1。

3.4 计算协方差矩阵的行列式和逆矩阵

for J = 1:W 
   DM(J) = det(CA(:, :, J)); 
end
IM = eye(size(CA,1)); 
for J = 1:W 
   CA(:, :, J) = IM/CA(:, :, J); 
end

对于每个类别,计算其协方差矩阵的行列式(DM)和逆矩阵(更新CA存储逆矩阵)。

3.5 评估决策函数

MA = MA'; % Organize the mean vectors as rows.
for J = 1:W
   ...
   D(:, J) = L - DET - 0.5*mahalanobis(X, C, M);
end

转置均值向量数组MA使其行表示均值向量。对于每个类别,计算决策函数的值,这里使用了马氏距离(mahalanobis函数)。

3.6 分类决策

[i, j] = find(D==repmat(max(D')',1,size(D,2)));
X = [i j];
X = sortrows(X);
[b, m] = unique(X(:,1));
X = X(m, :);
d = X(:,2);

找出每个样本在所有类别中决策函数值最大的类别,即为该样本的分类结果。处理可能的多重分类情况,保证每个样本只被分到一个类别中。最后,d向量包含了所有样本的分类结果。

3.7 总结

这段代码实现了一个基于高斯模型的贝叶斯分类器,通过计算每个样本属于不同类别的概率,并将样本分配到最可能的类别中。它涵盖了从参数检验、协方差矩阵处理、决策函数评估到最终的分类决策等多个步骤。

4 将4连通边界转换为8连通边界

function rc_new = bound2eight(rc)
%BOUND2EIGHT Convert 4-connected boundary to 8-connected boundary.
%   RC_NEW = BOUND2EIGHT(RC) converts a four-connected boundary to an
%   eight-connected boundary.  RC is a P-by-2 matrix, each row of
%   which contains the row and column coordinates of a boundary
%   pixel.  RC must be a closed boundary; in other words, the last
%   row of RC must equal the first row of RC.  BOUND2EIGHT removes
%   boundary pixels that are necessary for four-connectedness but not
%   necessary for eight-connectedness.  RC_NEW is a Q-by-2 matrix,
%   where Q <= P. 

%   Copyright 2002-2004 R. C. Gonzalez, R. E. Woods, & S. L. Eddins
%   Digital Image Processing Using MATLAB, Prentice-Hall, 2004
%   $Revision: 1.6 $  $Date: 2003/11/21 14:19:38 $

if ~isempty(rc) & ~isequal(rc(1, :), rc(end, :))
   error('Expected input boundary to be closed.');
end

if size(rc, 1) <= 3
   % Degenerate case.
   rc_new = rc;
   return;
end

% Remove last row, which equals the first row.
rc_new = rc(1:end - 1, :);

% Remove the middle pixel in four-connected right-angle turns.  We
% can do this in a vectorized fashion, but we can't do it all at
% once. Similar to the way the 'thin' algorithm works in bwmorph,
% we'll remove first the middle pixels in four-connected turns where
% the row and column are both even; then the middle pixels in the all
% the remaining four-connected turns where the row is even and the
% column is odd; then again where the row is odd and the column is
% even; and finally where both the row and column are odd.

remove_locations = compute_remove_locations(rc_new);
field1 = remove_locations & (rem(rc_new(:, 1), 2) == 0) & ...
         (rem(rc_new(:, 2), 2) == 0);
rc_new(field1, :) = [];

remove_locations = compute_remove_locations(rc_new);
field2 = remove_locations & (rem(rc_new(:, 1), 2) == 0) & ...
         (rem(rc_new(:, 2), 2) == 1);
rc_new(field2, :) = [];

remove_locations = compute_remove_locations(rc_new);
field3 = remove_locations & (rem(rc_new(:, 1), 2) == 1) & ...
         (rem(rc_new(:, 2), 2) == 0);
rc_new(field3, :) = [];

remove_locations = compute_remove_locations(rc_new);
field4 = remove_locations & (rem(rc_new(:, 1), 2) == 1) & ...
         (rem(rc_new(:, 2), 2) == 1);
rc_new(field4, :) = [];

% Make the output boundary closed again.
rc_new = [rc_new; rc_new(1, :)];

%-------------------------------------------------------------------%
function remove = compute_remove_locations(rc)

% Circular diff.
d = [rc(2:end, :); rc(1, :)] - rc;

% Dot product of each row of d with the subsequent row of d,
% performed in circular fashion.
d1 = [d(2:end, :); d(1, :)];
dotprod = sum(d .* d1, 2);

% Locations of N, S, E, and W transitions followed by
% a right-angle turn.
remove = ~all(d, 2) & (dotprod == 0);

% But we really want to remove the middle pixel of the turn.
remove = [remove(end, :); remove(1:end - 1, :)];

if ~any(remove)
   done = 1;
else
   idx = find(remove);
   rc(idx(1), :) = [];
end

这段代码定义了一个名为bound2eight的函数,其目的是将4连通边界转换为8连通边界。在数字图像处理中,连通性是用来描述图像区域中像素点之间连接方式的概念。4连通边界意味着每个边界像素与其上下左右的像素相连,而8连通边界还允许与对角线方向的像素相连。这种转换通常用于简化边界表示或改进图像分析算法的性能。

4.1 函数输入和输出

  • 输入rc,一个P-by-2矩阵,其中每一行包含一个边界像素的行和列坐标。
  • 输出rc_new,一个Q-by-2矩阵,表示转换后的8连通边界,其中Q <= P。

4.2 代码分析

  1. 检查闭合边界

    • 首先,函数检查输入的边界是否闭合。闭合边界意味着边界的起点和终点是同一个像素,即rc的第一行与最后一行相等。如果不满足这一条件,则抛出错误。
  2. 处理退化情况

    • 如果输入边界非常小(小于或等于3个像素),则没有必要进行转换,直接返回原始边界。
  3. 移除冗余像素

    • 由于4连通边界转换为8连通边界时某些像素可能变得不必要(特别是在直角转弯的地方),这段代码通过迭代移除这些冗余像素来简化边界。这一过程分为四个步骤,分别处理行坐标和列坐标都是偶数、行坐标偶数列坐标奇数、行坐标奇数列坐标偶数、以及行列坐标都是奇数的情况。
  4. 计算移除位置

    • compute_remove_locations函数用于计算需要移除的像素位置。它通过计算边界向量的差分和这些差分向量之间的点积来识别直角转弯的位置。如果两个连续的差分向量的点积为0且至少有一个维度的差分为0,则表明这是一个直角转弯。
  5. 重新闭合边界

    • 在移除了所有不必要的像素后,为了保持边界的闭合性,将边界的起点再次添加到边界数组的末尾。

4.3 关键函数和操作

  • 向量化操作:代码中大量使用了向量化操作来提高效率,例如rem(rc_new(:, 1), 2) == 0用于筛选行坐标为偶数的像素。
  • 差分和点积:通过计算差分和点积来识别需要移除的像素位置是这个算法的关键,这种方法有效地识别了边界上的直角转弯。
  • 逻辑索引:使用逻辑数组作为索引来批量移除数组中的元素,这是MATLAB中处理此类问题的常用技巧。

4.4 总结

这段代码定义了一个名为bound2eight的MATLAB函数,旨在将4连通边界转换为8连通边界,用于数字图像处理中边界简化的目的。它通过先验证输入边界的闭合性,然后逐步移除不必要的像素(特别是在直角转弯处),最终确保输出的8连通边界仍然闭合。该函数利用向量化操作、差分和点积计算等技术高效地识别并移除冗余像素,从而优化边界表示,适用于需要边界简化以提高图像分析性能的场景。总的来说,bound2eight函数通过一系列精心设计的步骤将4连通边界转换为8连通边界,这在图像处理和分析中是一个常见且有用的操作。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1486429.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【搭建 Hbase 集群】

搭建 Hbase 集群 一、准备工作二、三台服务器之间的 SSH 免密登录1.修改hosts文件添加DNS映射2.在每台服务器上生成 SSH 密钥对3.将公共密钥&#xff08;通常为 ~/.ssh/id_rsa.pub&#xff09;复制到目标服务器上4.从本地使用 SSH 命令无需密码连接到目标服务器 二、安装JDK1.执…

Linux/Docker 修改系统时区

目录 1. Linux 系统1.1 通过 timedatectl 命令操作1.2 直接修改 /etc/localtime 文件 2. Docker 容器中的 Linux 操作环境&#xff1a; CentOS / AlmaOSMySQL Docker 镜像 1. Linux 系统 1.1 通过 timedatectl 命令操作 使用 timedatectl list-timezones 命令列出可用的时区…

Learning from Unlabeled 3D Environments forVision-and-Language Navigation

这篇论文是关于高级指令的 摘要 在视觉和语言导航 (VLN) 中&#xff0c;实体代理需要按照自然语言指令在真实的 3D 环境中进行导航。现有 VLN 方法的一个主要瓶颈是缺乏足够的训练数据&#xff0c;导致对未见过的环境的泛化效果不理想。虽然 VLN 数据通常是手动收集的&#x…

2024年 前端JavaScript Web APIs 第一天 笔记

1.1 -声明变量const优先 1.2 -DOM树和DOM对象 1.3 -获取DOIM元素 1.4 -DOM修改元素内容以及年会抽奖 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8" /><meta http-equiv"X-UA-Compatible" content&quo…

初识面相对象深入理解、构造方法--学习JavaEE的day12

day12 一、初识面相对象深入理解 需求&#xff1a; 创建人类的对象&#xff0c;并操作对象 分析&#xff1a; 人类 - Person 属性&#xff1a;name、sex、age 方法&#xff1a;eat、sleep 场景&#xff1a;创建多个对象&#xff0c;去操作对象 public class Person {//成员变…

9、taocms代码审计

一、XSS 1、DOM型xss 限制 无复现 payload: aa)alert(1)( 触发的参数&#xff1a;name代码 根据路由找到对应的文件&#xff0c;在api.php里接受全局变量action&#xff0c;最终赋值给$m,判断 如果$m不在数组就结束&#xff0c;新建方法复制给$model。检查类的方法是否存…

2024 年广东省职业院校技能大赛(高职组)“云计算应用”赛项样题 2

#需要资源或有问题的&#xff0c;可私博主&#xff01;&#xff01;&#xff01; #需要资源或有问题的&#xff0c;可私博主&#xff01;&#xff01;&#xff01; #需要资源或有问题的&#xff0c;可私博主&#xff01;&#xff01;&#xff01; 某企业根据自身业务需求&#…

【全局异常处理记录】⭐️通过自定义全局处理器有效统一各种异常并记录

目录 前言 方案 示例 测试 总结 前言 朋友们大家好啊&#xff0c;随着项目的进行&#xff0c;接口也是越来越多了&#xff0c;每个接口无论调用成功与否&#xff0c;都要有相应的应对措施&#xff0c;总不能出错的时候返回一堆异常信息给调用者&#xff0c;所以每个接口都…

Python算法100例-3.2 水仙花数

完整源代码项目地址&#xff0c;关注博主私信源代码后可获取 1.问题描述2.问题分析3.算法设计4.确定程序框架5.完整的程序6.问题拓展7.巧用字符串技巧 1&#xff0e;问题描述 输出所有的“水仙花数”。所谓的“水仙花数”是指一个三位数&#xff0c;其各位数字的立方和等于该…

【机器学习】有监督学习算法之:支持向量机

支持向量机 1、引言2、决策树2.1 定义2.2 原理2.3 实现方式2.4 算法公式2.5 代码示例 3、总结 1、引言 小屌丝&#xff1a;鱼哥&#xff0c;泡澡啊。 小鱼&#xff1a;不去 小屌丝&#xff1a;… 此话当真&#xff1f; 小鱼&#xff1a;此话不假 小屌丝&#xff1a;到底去还是…

奔跑吧,前端er!前端五大方向技能罗列,webGL、AI、桌面、游戏

经常看到头条上前端们争论各种框架的优劣&#xff0c;然后相互争吵不休&#xff0c;其实技术也好&#xff0c;框架也好&#xff0c;都是服务于项目需求的&#xff0c;争论的铁子们都站在自己的项目角度来品评工具&#xff0c;肯定是公说公有理婆说婆有理啦。 技术和框架是中性的…

ArrayBlockingQueue 数组阻塞队列 源码阅读

1. 概述 数组阻塞队列 有界的阻塞数组, 容量一旦创建, 无法修改阻塞队列, 队列满的时候, 往队列put数据会被阻塞, 队列空, 取数据也会被阻塞并发安全 2. 数据结构 /** 存储队列元素的数组 */ /** 存储队列元素的数组 */ final Object[] items;/** 队首位置&#xff0c;下一…

【王道操作系统】ch1计算机系统概述-06虚拟机

文章目录 【王道操作系统】ch1计算机系统概述-06虚拟机01传统计算机02虚拟机的基本概念&#xff08;1&#xff09;第一类虚拟机管理程序&#xff08;2&#xff09; 第二类虚拟机管理程序&#xff08;3&#xff09; 两类虚拟机管理程序的对比 【王道操作系统】ch1计算机系统概述…

【Linux系统化学习】线程概念

目录 线程的概念 线程的引出 什么是线程 理解线程比进程更加的轻量化 线程的优点 现成的缺点 线程异常 线程用途 Linux进程VS线程 线程的简单现象 线程的概念 有关操作系统的书籍或者课本都会这样描述线程&#xff1a; 线程是比进程轻量化的一种执行流线程是进程内部…

[SWPUCTF 2021 新生赛]babyrce

先打开环境 分析代码&#xff0c;要给COOKIE赋值admin1 使用hackbar赋值 打开rasalghul.php 分析代码&#xff0c;使用GET传参url&#xff0c;如果url里没有/ /&#xff0c;则赋值给ip&#xff0c;然后通过shell_exec函数得到flag&#xff0c;否则&#xff0c;返回nonono。他…

备战蓝桥杯————递归反转单链表

当要求只反转单链表中的一部分时&#xff0c;递归实现确实具有一定的挑战性&#xff0c;但也是可行的。下面我将介绍一种递归实现的方法来反转单链表中的一部分。 一、反转链表 题目描述 给你单链表的头节点 head &#xff0c;请你反转链表&#xff0c;并返回反转后的链表。 示…

详解Win 7重置电脑操作步骤

文章目录 介绍Win 7 重置系统的方法&#xff1a;1.按下键盘上的Windows键和R键&#xff0c;打开运行窗口&#xff0c;输入sysprep 点击回车确定。2.之后就会出现如下界面&#xff0c;在这个新打开的窗口中双击 sysprep 程序3.选择【进入系统全新体验&#xff08;00BE) 】&#…

C++ sort排序

sort函数接受两个迭代器作为参数&#xff0c;分别表示要排序的范围的起始和结束位置。 请注意&#xff0c;sort函数默认使用小于运算符&#xff08;<&#xff09;来比较元素的顺序&#xff0c;默认从小到大排。 在这里&#xff0c;使用str.begin()和str.end()来表示整个字符…

【MDVRP多站点物流配送车辆路径规划问题(带容量限制)】基于遗传算法GA求解

课题名称&#xff1a;基于遗传算法求解带容量限制的多站点的物流配送路径问题MDVRP 版本时间&#xff1a;2023-03-12 代码获取方式&#xff1a;QQ&#xff1a;491052175 或者 私聊博主获取 模型描述&#xff1a; 15个城市中&#xff0c;其中北京&#xff0c;长沙和杭州三座…

springboot241基于SpringBoot+Vue的电商应用系统的设计与实现

基于SpringBootVue的电商应用系统的设计与实现 摘 要 现代经济快节奏发展以及不断完善升级的信息化技术&#xff0c;让传统数据信息的管理升级为软件存储&#xff0c;归纳&#xff0c;集中处理数据信息的管理方式。本电商应用系统就是在这样的大环境下诞生&#xff0c;其可以…