实验目的

1、实现PCA算法的人脸重构,即用20,40,60,80,...,160个投影来重构图像的效果。

2、实现PCA算法的人脸识别,给出不少于三个人脸数据库上 10,20,30,...,160维的人脸识别识别率,并打印出识别率变化曲线图。

3、用PCA用来进行人脸图像降维,实现3个不同数据集多个子集(或多个类)的二维和三维空间实现数据的可视化,不同类用不同颜色表示。

4、比较PCA、2DPCA、B2PCA在各个人脸数据集上的最高识别率,比较重构图像的差异。

实验步骤:

一,基于PCA算法的人脸重构与人脸识别,以及数据可视化

1,(条件:基于AR数据集的前120人,每人取前三张图像作为训练数据,后七张作为识别数据)

原图

不同维度下的重构效果(AR001-1.tif)

维度

正确率

20

62.70%

40

68.52%

60

71.33%

80

74.27%

100

74.53%

120

75.20%

140

75.41%

160

75.89%

取用不同数量特征值和正确率        基于此情况下人脸识别识别率曲线

数据可视化

             二维空间                       三维空间

2,(条件:基于orl数据集的前40人,每人取前三张图像作为训练数据,后七张作为识别数据)

原图

不同维度下重构效果(orl1_1.bmp)

维度

正确率

20

78.92%

40

83.57%

60

85.00%

80

85.71%

100

86.42%

120

86.07%

140

86.07%

160

86.07%

取用不同数量特征值和正确率        基于此情况下人脸识别识别率曲线          

数据可视化

二维空间                       三维空间

3,(条件:基于Yale数据集的前15人,每人取前三张图像作为训练数据,后七张作为识别数据)

原图

不同维度下重构效果(subject01_1.bmp)

维度

正确率

20

87.73%

40

86.77%

60

86.77%

80

86.77%

100

86.77%

120

86.77%

140

86.77%

160

86.77%

取用不同数量特征值和正确率         基于此情况下人脸识别识别率曲线

数据可视化

             二维空间                       三维空间

二,PCA,2DPCA,B2DPCA重构图像与识别率差异

条件:在ORL数据集上的重构效果(40个人,取前六张训练,后四张识别的情况下展示重构效果)

重构效果:

原图

PCA:

2DPCA:

B2DPCA

识别正确率(orl数据集,40个人,前六张训练,后四张识别):

PCA:

最高正确率为96.3%

2DPCA:

最高正确率为97.5%

B2DPCA:

最高正确率为97.5%

尝试不同训练图像与识别图像比例后结果如下:

训练情况

训练3,识别7

训练4,识别6

训练5,识别5

训练6,识别4

训练7,识别3

PCA

86.4%

89.6%

90.0%

96.3%

96.7%

2DPCA

93.2%

93.3%

93.5%

97.5%

97.5%

B2DPCA

93.2%

93.3%

93.5%

97.5%

97.5%

从表中可以知道,2DPCA和B2DPCA在ORL训练集上的最高正确率基本相同,高于PCA的正确率,同时随着训练数据的增加,PCA与它们识别正确率的差距逐渐减小。

进一步发现,在训练图像6张,识别图像四张的情况下,PCA,2DPCA,B2DPCA识别时间如下:

PCA

2DPCA

B2DPCA

4.09s

1.59s

1.22s

可以看出,2DPCA和B2DPCA虽然在正确率上差别不大,但B2DPCA却比2DPCA更加节省时间,二者所耗时间均远远小于传统PCA算法。

代码:

PCA:

%1,测试与训练图像的录入(附加计时以查看效率)
tic
reshaped_faces=[];
%训练图像读取(以orl为例)
for i=1:40for j=1:10 a=imread(strcat('C:\Users\18023\Desktop\粤海小清华\homework\计导文件\人脸数据库\ORL56_46\orl',num2str(i),'_',num2str(j),'.bmp'));     b = reshape(a,2576,1); %将每一张人脸拉成列向量b=double(b); %uint-8转换为double类型,避免人脸展示时全灰的影响       reshaped_faces=[reshaped_faces, b];  %储存每一列转化后的列向量到矩阵reshaped_faces中end
end%用每个人前六张作为训练图,后四张作为测试图
%初始化测试集集矩阵
test_data_index = [];
%初始化训练集矩阵
train_data_index = [];  
for k=0:(size(reshaped_faces,2)/j)-1train_data_index= [train_data_index j*k+1:j*k+3];%建立一个用于查找所需训练图像的目录test_data_index= [test_data_index j*k+4:j*(k+1)];%同理,是测试图像的目录
end
train_data = reshaped_faces(:,train_data_index);%根据index读取矩阵 reshaped_faces的数据添加到矩阵train_data中
test_data = reshaped_faces(:, test_data_index);%根据index1读取矩阵 reshaped_faces的数据添加到矩阵test_data中% 2-特征向量矩阵(all_eigen_face)求得过程
% 求平均脸
mean_face = mean(train_data,2);%用mean函数求训练集矩阵的平均值,2是对每一行求平均,最后得到一个和原先尺寸一样的一个人脸,每个像素是平均颜色
% 中心化
normalizeddata= (train_data - mean_face);%得到中心化人脸(此处减去一列等于traindata每一列都减去这一列) 
%PCA特征值分解的矩阵为去中心化的矩阵乘其转置矩阵
cov= normalizeddata * normalizeddata';
%特征值分解
[eigen_vectors, eigenvalues] = eig(cov);
% 从对角矩阵获取特征值
eigen_values = diag(eigenvalues);
% 对特征值按索引进行从大到小排序
[sorted_eigen_values, index] = sort(eigen_values, 'descend'); %此处建立index获取特征值的位置,以便寻找对应的特征向量
%按照特征值的大小排列特征向量
sorted_eigen_vectors = eigen_vectors(:, index);
all_eigen_faces = sorted_eigen_vectors;%2重构过程
single_face = normalizeddata(:,1);%代码中取第一张脸进行重构
index = 1;
figure;
for dim=[20,40,60,80,100,120,140,160]eigen_faces = all_eigen_faces(:,1:dim);%降维与再次重构rebuild_face = eigen_faces * (eigen_faces' * single_face) + mean_face;subplot(2,4, index); index = index + 1;fig = imshow(mat2gray(reshape(rebuild_face, [56, 46])));title(sprintf("维度=%d", dim));    if (dim == 160)waitfor(fig);end
end% 3.人脸识别
index = 1;       
k = length(10:10:160);  %选取适当间隔
Y = zeros(1, k); 
% 遍历每个维度
for i = 1:kd = 10 * i;  % 通过i确定当前维度% 取出相应数量特征向量eigen_faces = all_eigen_faces(:, 1:d);% 测试、训练数据降维projected_train_data = eigen_faces' * (train_data - mean_face);projected_test_data = eigen_faces' * (test_data - mean_face);% 测试前准备过程correct_predict_number = 0;test_face_number = size(projected_test_data, 2);% 读取测试数据与初始化for each_test_face_index = 1:test_face_numbereach_test_face = projected_test_data(:, each_test_face_index);% 初始化最小距离min_distance = inf;predicted_label = -1;%在欧氏距离下与每一个降维后的数据进行比较for each_train_face_index = 1:size(projected_train_data, 2)% 计算距离distance = norm(each_test_face - projected_train_data(:, each_train_face_index));% 如果当前距离小于之前的最小距离,则更新最小距离和标签(1NN,取最近的一个)if distance < min_distancemin_distance = distance;predicted_label = floor((train_data_index(1, each_train_face_index) - 1) / j) + 1;endend% 获取该数据真实的标签real_label = floor((test_data_index(1, each_test_face_index) - 1) / j) + 1;% 判断预测结果是否正确if predicted_label == real_labelcorrect_predict_number = correct_predict_number + 1; % 如果预测正确,增加正确数endend % 计算正确率correct_rate = correct_predict_number / test_face_number;% 将当前维度对应的正确率存入YY(i) = correct_rate;  % 使用索引i来存储正确率,确保Y与d一致% 输出当前实验结果fprintf("维度=%d,总测试样本:%d,正确数:%d,正确率:%1f\n", d, test_face_number, correct_predict_number, correct_rate);
end
toc% 4,制作折线图使正确率随维度变化可视化
figure;
plot(10:10:160, Y, '-o');  % x轴为维度数,y轴为正确率
xlabel('维度数');
ylabel('正确率');
title('人脸识别正确率与维度变化');
waitfor(fig);%5,散点图绘制
for t=[2 3]eigen_faces=all_eigen_faces(:,1:t);projected_test_data=eigen_faces'*(test_data - mean_face);color=[];for x=1:size(test_data,2)color=[color floor((x-1)/19*2)];endif (t == 2)waitfor(scatter(projected_test_data(1, :), projected_test_data(2, :), [], color));elsewaitfor(scatter3(projected_test_data(1, :), projected_test_data(2, :), projected_test_data(3, :), [], color));endend

2DPCA

%1,测试与训练图像的录入
tic
reshaped_faces=[];
%训练图像读取(以orl为例)
for i=1:40for j=1:10%a=imread(strcat('C:\Users\18023\Desktop\粤海小清华\homework\计导文件\人脸数据库\ORL56_46\orl',num2str(i),'_',num2str(j),'.bmp'));     b = reshape(a,2576,1); b=double(b);       reshaped_faces=[reshaped_faces, b]; end
end%用每个人前六张作为训练图,后四张作为测试图
%定义测试集集矩阵
test_data_index = [];
%定义训练集矩阵
train_data_index = [];  
for k=0:(size(reshaped_faces,2)/j)-1train_data_index= [train_data_index j*k+1:j*k+6];%建立一个用于查找所需训练图像的目录test_data_index= [test_data_index j*k+7:j*(k+1)];%同理,是测试图像的目录
end
train_data = reshaped_faces(:,train_data_index);%读取矩阵 reshaped_faces的数据添加到矩阵train_data中
test_data = reshaped_faces(:, test_data_index);%读取矩阵 reshaped_faces的数据添加到矩阵test_data中
mean_face = mean(train_data,2);%2,2DPCA矩阵求取
%对于训练矩阵重新还原成二维叠加的状态
train_matrices = cell(size(train_data, 2), 1);
for i = 1:size(train_data, 2)train_matrices{i} = reshape(train_data(:, i), [56, 46]);
end
%所有训练图像矩阵的均值
mean_face_matrix = zeros(56, 46);
for i = 1:length(train_matrices)mean_face_matrix = mean_face_matrix + train_matrices{i};
end
mean_face_matrix = mean_face_matrix / length(train_matrices);% 初始化2DPCA协方差矩阵
cov_2dpca = zeros(46, 46);  
% 计算2DPCA的协方差矩阵
for i = 1:length(train_matrices)centered_matrix = train_matrices{i} - mean_face_matrix;%每一个二维数据进行去中心化cov_contribution = centered_matrix' * centered_matrix;%求取其协方差矩阵cov_2dpca = cov_2dpca + cov_contribution;%每一个二维数据的协方差矩阵,都加到最后求解的矩阵上
end
cov_2dpca = cov_2dpca / length(train_matrices);%除以所有参与的二维矩阵数,求得均值
%cov_2dpca即为最终进行协方差分解的矩阵
%特征值分解与按照特征值从大到小排列
[eigen_vectors, eigenvalues] = eig(cov_2dpca);
eigen_values = diag(eigenvalues);
[sorted_eigen_values, index] = sort(eigen_values, 'descend');
sorted_eigen_vectors = eigen_vectors(:, index);
all_eigen_faces = sorted_eigen_vectors;figure
% 3,计算重构过程,展示第一张训练图像的重构
for idx = 1:4dim = idx * 10;eigen_faces = all_eigen_faces(:, 1:dim);  % 选择前dim个特征向量% 计算投影系数test_image = train_matrices{1};  % 获取第一张训练图像centered_image = test_image - mean_face_matrix;  % 中心化图像projection = centered_image * eigen_faces;  % 投影到特征空间% 重构图像rebuild_face = mean_face_matrix + (projection * eigen_faces');  % 重构% 显示重构结果subplot(1, 4, idx);imshow(mat2gray(rebuild_face));  % 显示重构图像title(sprintf('维度=%d', dim));
end% 4.人脸识别
index = 1;       
k = length(10:10:40);
Y = zeros(1, k);
% 将测试图像转换为矩阵形式
test_matrices = cell(size(test_data, 2), 1);
for i = 1:size(test_data, 2)test_matrices{i} = reshape(test_data(:, i), [56, 46]);
end
% 遍历每个维度
for i = 1:kd = 10* i;% 取出相应数量特征向量projection_vectors = all_eigen_faces(:, 1:d);% 计算训练和测试图像的特征train_features = zeros(size(train_data, 2), 56*d);test_features = zeros(size(test_data, 2), 56*d);% 对每张训练图像进行投影for j = 1:length(train_matrices)% 计算投影projected = train_matrices{j} * projection_vectors; % 56×d% 将投影结果展平为特征向量train_features(j, :) = projected(:)';end% 对每张测试图像进行投影for j = 1:length(test_matrices)projected = test_matrices{j} * projection_vectors;test_features(j, :) = projected(:)';end% 测试前准备过程correct_predict_number = 0;test_face_number = size(test_features, 1);% 遍历每一个待测试人脸for each_test_face_index = 1:test_face_numbereach_test_face = test_features(each_test_face_index, :)'; % 读取测试用的脸特征% 初始化最小距离min_distance = inf;predicted_label = -1;% 对比每一张训练脸for each_train_face_index = 1:size(train_features, 1)% 计算距离distance = norm(each_test_face - train_features(each_train_face_index, :)');% 如果当前距离小于之前的最小距离,则更新最小距离和标签if distance < min_distancemin_distance = distance;predicted_label = floor((train_data_index(1, each_train_face_index) - 1) / j) + 1;endend% 获取实际标签real_label = floor((test_data_index(1, each_test_face_index) - 1) / j) + 1;% 判断预测结果是否正确if predicted_label == real_labelcorrect_predict_number = correct_predict_number + 1;endend% 计算正确率correct_rate = correct_predict_number / test_face_number;Y(i) = correct_rate;fprintf("维度=%d,总测试样本:%d,正确数:%d,正确率:%1f\n", d, test_face_number, correct_predict_number, correct_rate);
end
toc% 制作折线图使正确率随维度变化可视化
figure;
plot(10:10:40, Y, '-o');  % x轴为维度数,y轴为正确率
xlabel('维度数');
ylabel('正确率');
title('人脸识别正确率与维度变化');

B2DPCA

%1,测试与训练图像的录入
tic
reshaped_faces=[];
for i=1:40for j=1:10 a=imread(strcat('C:\Users\18023\Desktop\粤海小清华\homework\计导文件\人脸数据库\ORL56_46\orl',num2str(i),'_',num2str(j),'.bmp'));     b = reshape(a,2576,1); b=double(b);     reshaped_faces=[reshaped_faces, b];  end
end%用每个人前六张作为训练图,后四张作为测试图
%定义测试集集矩阵
test_data_index = [];
%定义训练集矩阵
train_data_index = [];  
for k=0:(size(reshaped_faces,2)/j)-1train_data_index= [train_data_index j*k+1:j*k+6];%建立一个用于查找所需训练图像的目录test_data_index= [test_data_index j*k+7:j*(k+1)];%同理,是测试图像的目录
end
train_data = reshaped_faces(:,train_data_index);%读取矩阵 reshaped_faces的数据添加到矩阵train_data中
test_data = reshaped_faces(:, test_data_index);%读取矩阵 reshaped_faces的数据添加到矩阵test_data中
mean_face = mean(train_data,2);%2,协方差矩阵求取
%对于训练矩阵重新还原成二维叠加的状态
train_matrices = cell(size(train_data, 2), 1);
for i = 1:size(train_data, 2)train_matrices{i} = reshape(train_data(:, i), [56, 46]);
end%求所有训练图像矩阵的均值
mean_face_matrix = zeros(56, 46);
for i = 1:length(train_matrices)mean_face_matrix = mean_face_matrix + train_matrices{i};
end
mean_face_matrix = mean_face_matrix / length(train_matrices);% 行和列方向特征值分解
%行方向
cov_2dpca_col = zeros(46, 46);
for i = 1:length(train_matrices)centered_matrix = train_matrices{i} - mean_face_matrix;%求得每一个二维数据去中心化的结果cov_contribution = centered_matrix' * centered_matrix;%行方向协方差矩阵求解,用转置乘以原矩阵cov_2dpca_col = cov_2dpca_col + cov_contribution;
end
cov_2dpca_col = cov_2dpca_col / length(train_matrices);
%列方向
cov_2dpca_row = zeros(56, 56);
for i = 1:length(train_matrices)centered_matrix = train_matrices{i} - mean_face_matrix;%求得每一个二维数据去中心化的结果cov_contribution = centered_matrix * centered_matrix';%列方向协方差矩阵求解,用原矩阵乘以其转置cov_2dpca_row = cov_2dpca_row + cov_contribution;
end
cov_2dpca_row = cov_2dpca_row / length(train_matrices);% 列方向特征向量求取
[eigen_vectors_col, eigenvalues_col] = eig(cov_2dpca_col);
eigen_values_col = diag(eigenvalues_col);
[sorted_eigen_values_col, index_col] = sort(eigen_values_col, 'descend');
sorted_eigen_vectors_col = eigen_vectors_col(:, index_col);% 行方向特征向量求取
[eigen_vectors_row, eigenvalues_row] = eig(cov_2dpca_row);
eigen_values_row = diag(eigenvalues_row);
[sorted_eigen_values_row, index_row] = sort(eigen_values_row, 'descend');
sorted_eigen_vectors_row = eigen_vectors_row(:, index_row);%3,人脸重构查看效果
figure;
for idx = 1:8dim_col = idx * 5;  % 列方向降维dim_row = idx * 5;  % 行方向降维% 行和列方向特征向量选取eigen_faces_col = sorted_eigen_vectors_col(:, 1:dim_col);eigen_faces_row = sorted_eigen_vectors_row(:, 1:dim_row);% 获取第一张训练图像并重构test_image = train_matrices{1};centered_image = test_image - mean_face_matrix;% B2DPCA投影和重构projection = eigen_faces_row' * centered_image * eigen_faces_col;rebuild_face = mean_face_matrix + eigen_faces_row * projection * eigen_faces_col';% 显示重构结果subplot(2, 4, idx);imshow(mat2gray(rebuild_face));title(sprintf('维度=%d×%d', dim_row, dim_col));
end%4,人脸识别部分
index = 1;       
k = length(10:10:40);
Y = zeros(1, k);% 将测试图像转换为矩阵形式
test_matrices = cell(size(test_data, 2), 1);
for i = 1:size(test_data, 2)test_matrices{i} = reshape(test_data(:, i), [56, 46]);
end% 遍历每个维度
for i = 1:kd = 10 * i;  % 每个方向的维度% 取出特征向量projection_vectors_col = sorted_eigen_vectors_col(:, 1:d);projection_vectors_row = sorted_eigen_vectors_row(:, 1:d);% 计算训练和测试图像的特征train_features = zeros(size(train_data, 2), d * d);test_features = zeros(size(test_data, 2), d * d);% 对每张训练图像进行双向投影for j = 1:length(train_matrices)centered_matrix = train_matrices{j} - mean_face_matrix;projected = projection_vectors_row' * centered_matrix * projection_vectors_col;train_features(j, :) = projected(:)';end% 对每张测试图像进行双向投影for j = 1:length(test_matrices)centered_matrix = test_matrices{j} - mean_face_matrix;projected = projection_vectors_row' * centered_matrix * projection_vectors_col;test_features(j, :) = projected(:)';end% 测试前准备过程correct_predict_number = 0;test_face_number = size(test_features, 1);% 遍历每一个待测试人脸for each_test_face_index = 1:test_face_numbereach_test_face = test_features(each_test_face_index, :)'; % 读取测试用的脸特征% 初始化最小距离min_distance = inf;predicted_label = -1;% 对比每一张训练脸for each_train_face_index = 1:size(train_features, 1)% 计算距离distance = norm(each_test_face - train_features(each_train_face_index, :)');% 如果当前距离小于之前的最小距离,则更新最小距离和标签if distance < min_distancemin_distance = distance;predicted_label = floor((train_data_index(1, each_train_face_index) - 1) / j) + 1;endend% 获取实际标签real_label = floor((test_data_index(1, each_test_face_index) - 1) / j) + 1;% 判断预测结果是否正确if predicted_label == real_labelcorrect_predict_number = correct_predict_number + 1;endend% 计算正确率correct_rate = correct_predict_number / test_face_number;Y(i) = correct_rate;fprintf("维度=%d,总测试样本:%d,正确数:%d,正确率:%1f\n", d, test_face_number, correct_predict_number, correct_rate);
end
toc% 制作折线图使正确率随维度变化可视化
figure;
plot(10:10:40, Y, '-o');  % x轴为维度数,y轴为正确率
xlabel('维度数');
ylabel('正确率');
title('人脸识别正确率与维度变化');

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

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

编程中的英语

case this are mixed case version case在这里表示大小写&#xff1f;为什么case可以表示大小写的含义&#xff1f; “case”在这里的含义 在句子“This are mixed case version”中&#xff0c;“case”确实表示“大小写”&#xff0c;用于描述字母的形式&#xff08;大写字母…

LabVIEW开发关节轴承试验机

LabVIEW通过NI硬件&#xff08;CompactRIO 实时控制器、FPGA 模块等&#xff09;与模块化软件设计的结合&#xff0c;实现试验参数采集、多工况控制、数据存储的并行处理&#xff0c;体现LabVIEW 在工业自动化中对多任务并发场景的高效支持能力。 ​ 应用场景 关节轴承试验机…

【Linux庖丁解牛】— 动静态库的制作和使用!

1. 什么是库库是写好的现有的&#xff0c;成熟的&#xff0c;可以复⽤的代码。现实中每个程序都要依赖很多基础的底层库&#xff0c;不可能 每个⼈的代码都从零开始&#xff0c;因此库的存在意义⾮同寻常。 本质上来说库是⼀种可执⾏代码的⼆进制形式&#xff0c;可以被操作系统…

Hadoop集群启动 (ZooKeeper、HDFS、YARN、Hbase)

一、启动ZooKeeper集群 sh /opt/modules/zookeeper-3.4.14/bin/zkServer.sh start[hadoopcentos01 ~]$ sh /opt/modules/zookeeper-3.4.14/bin/zkServer.sh start ZooKeeper JMX enabled by default Using config: /opt/modules/zookeeper-3.4.14/bin/../conf/zoo.cfg Startin…

React Hooks全面解析:从基础到高级的实用指南

React Hooks全面解析&#xff1a;从基础到高级的实用指南 React Hooks自2018年16.8版本引入以来&#xff0c;彻底改变了React组件的开发方式。** Hooks使函数组件获得了与类组件同等的表达能力&#xff0c;同时简化了代码结构&#xff0c;提升了可维护性**。本文将系统介绍Rea…

LINUX75 LAMP

LAMP 环境 yum NetworkManager systemctl status firewalld setenforce 0 Last login: Fri Jul 4 19:21:47 2025 from 192.168.235.1 [rootweb ~]# cd /usr/local/apache2/conf/ [rootweb conf]# ls extra httpd.conf httpd.conf.bak magic mime.types original [root…

cloudflare配合github搭建免费开源影视LibreTV一个独享视频网站 详细教程

一、项目简介 LibreTV 是一个开源的 IPTV/影视聚合前端项目&#xff0c;支持 M3U 播放列表、EPG 电子节目单等。它本身是纯前端项目&#xff0c;非常适合用 GitHub Pages Cloudflare 免费托管。 二、准备工作 GitHub 账号 注册并登录 GitHub Cloudflare 账号 注册并登录 …

Linux/Unix进程概念及基本操作(PID、内存布局、虚拟内存、环境变量、fork、exit、wait、exec、system)

进程 文章目录 进程I 进程基本概念1、进程和程序2、进程号和父进程号3、进程内存布局4、虚拟内存管理&#xff08;1&#xff09;程序的两种局部性&#xff08;2&#xff09;虚拟内存的规划&#xff08;3&#xff09;虚拟内存的优点 5、栈和栈帧6、命令行参数argc和argv7、环境变…

0基础学Python系列【25】 单元测试入门教程

大家好,欢迎来到Python学习的第三站!🎉 这部分会涉及一些Python的进阶技术,虽然不一定是必需的,但学会这些,你会觉得编程更得心应手。 本章要学什么? Python调试器(pdb)装饰器lambda函数代码性能分析单元测试入门 —— 今天讲这里听起来有点多?别担心,我们慢慢来,…

iOS常见内存错误码

一、经典十六进制错误码0xDEADBEEF&#xff08;EXC_BAD_ACCESS&#xff09; 含义&#xff1a;野指针访问&#xff08;访问已释放的内存地址&#xff09;。 记忆点&#xff1a;“DEAD BEEF” 可理解为 “死亡牛肉”&#xff0c;象征指针指向的内存已 “死亡”。 触发场景&#x…

CSS01:CSS的快速入门及优势

CSS快速入门 style 练习格式&#xff1a; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><title>CSS</title><!-- 规范,<style>可以编写css代码,每一个声明最好用分号结尾语法&#xff1a;…

springsecurity5配置之后启动项目报错:authenticationManager cannot be null

目录 配置代码 报错信息 解决办法 配置代码 下面的配置为响应式的配置方式 //这个配置只是配置springboot admin的一个例子,具体的配置可能比较复杂 @EnableWebFluxSecurity public class SecurityConfig {private final AdminServerProperties adminServer;public Securi…

攻防世界-Rerverse-game

知识点 1.ida逆向 2.函数分析逆向 步骤 用Exeinfo打开&#xff0c;为32位exe文件。 方法一&#xff1a; 玩游戏通关&#xff0c;根据游戏规则&#xff0c;m1&#xff0c;n依次为1到8即可得到flag。 方法二&#xff1a; 用32位IDA打开 ctrlF搜索main&#xff0c;点击_main,…

openEuler 24.03 全流程实战:用 Ansible 5 分钟部署分布式 MinIO 高可用集群

目录 0 | 为什么要写这篇教程&#xff1f; 1 | 准备工作 1.1 控制节点手工下载 MinIO 1.2 SSH 互信&#xff08;可跳过&#xff0c;本教程已有互信&#xff09; 1.3 安装 Ansible & SELinux 依赖 2 | 项目目录 3 | Inventory hosts.ini 4 | 变量文件 group_vars/al…

最左匹配原则

导读&#xff1a; 首先创建一张 test 表&#xff0c;并插入一些数据&#xff1a; CREATE TABLE test ( id int(11) NOT NULL AUTO_INCREMENT COMMENT 主键, a int(11) NOT NULL, b int(11) NOT NULL, c int(11) NOT NULL, d int(11) NOT NULL, PRIMARY KEY (id), KEY idx_abc …

MySQL 8.0 OCP 1Z0-908 题目解析(17)

题目65 Choose two. Which two are characteristics of snapshot-based backups? □ A) The frozen file system can be cloned to another virtual machine immediately into active service. □ B) There is no need for InnoDB tables to perform its own recovery when re…

Level2_12小球与挡板(移动+反弹)

一、前引 #已经学习完了: #1.数据结构&#xff1a;集合、元组、字典 #2.函数 #3.类和对象 #4.继承与多态 #1.规划编程项目: #&#xff08;1&#xff09;你想做什么什么样功能的项目&#xff1f; # 接小球游戏,碰到挡板时自动反弹 #&#xff08;2&#xff09;功能有哪些&#x…

win11 2025开机禁用微软账号登录,改本地用户登录,品牌预装机福音

今天开箱了品牌商出厂系统一台华为笔记本&#xff0c;开机提示连接wifi并需要登录微软账号&#xff0c;其中过程实在缓慢&#xff0c;而且老是提示自动更新&#xff0c;速度太慢了&#xff0c;等的花都谢了&#xff0c;进到桌面大概得要30-40分钟&#xff0c;还不如本地用户登录…

【嵌入式ARM汇编基础】-ELF文件格式内部结构详解(三)

ELF文件格式内部结构详解(三) 文章目录 ELF文件格式内部结构详解(三)12、动态部分和动态加载13、依赖加载(需要)14、程序重定位14.1 静态重定位14.2 动态重定位14.3 全局偏移表 (GOT)14.4 过程链接表 (PLT)12、动态部分和动态加载 ELF 文件格式中的 .dynamic 部分用于指…

HTML知识复习2

文章目录 HTML5简介什么是HTML5HTML5优势 新增语义化标签新增布局标签新增状态标签新增列表标签新增文本标签 新增表单功能表单控件新增属性input新增属性值 新增多媒体标签视频标签音频标签 HTML5兼容性处理 HTML5简介 什么是HTML5 HTML5 是新一代的 HTML 标准&#xff0c;2…