MATLAB【九】————ICP算法实现
1.ICP推导与求解
https://zhuanlan.zhihu.com/p/35893884
2.算法实现:
% 程序说明:输入data_source和data_target两个点云,找寻将data_source映射到data_targe的旋转和平移参数
clear;
close all;
clc;
%% 参数配置
kd = 1;
inlier_ratio = 0.999;
Tolerance = 0.05;
step_Tolerance = 0.01;
max_iteration =100;
show = 1;%% 生成数据
data_source=pcread('C:\Users\Administrator\Desktop\vescl\ply\adis800_pc_wave.ply');
data_target = pcread('C:\Users\Administrator\Desktop\vescl\result1\scene3_dis500_ref400\sparse_point_cloud.ply');
% data_source=pcread('C:\Users\Administrator\Desktop\vescl\ply\adis500_pc_egg.ply');
% data_target = pcread('C:\Users\Administrator\Desktop\vescl\result1\scene4_dis500_ref400\sparse_point_cloud.ply');
% data_source=pcread('C:\Users\Administrator\Desktop\vescl\ply\adis500_pc_step.ply');
% data_target = pcread('C:\Users\Administrator\Desktop\vescl\result1\scene2_dis500_ref400\sparse_point_cloud.ply');
% data_source=pcread('C:\Users\Administrator\Desktop\vescl\ply\adis500_pc_plane.ply');
% data_target = pcread('C:\Users\Administrator\Desktop\vescl\result1\scene1_dis500_ref400\sparse_point_cloud.ply');data_source=data_source.Location';
data_target=data_target.Location';
% 绘制原始点与旋转后的点图像
figure;
scatter3(data_source(1,:),data_source(2,:),data_source(3,:),'b.');
hold on;
scatter3(data_target(1,:),data_target(2,:),data_target(3,:),'r.');
hold off;
daspect([1 1 1]);%% 开始ICP
T_final=eye(4,4); %旋转矩阵初始值
iteration=0;
Rf=T_final(1:3,1:3);
Tf=T_final(1:3,4);
data_source=Rf*data_source+Tf*ones(1,size(data_source,2)); %初次更新点集(代表粗配准结果)
err=1;
data_source_old = data_source;
%% 迭代优化
while(1)iteration=iteration+1;if kd == 1%利用Kd-tree找出对应点集kd_tree = KDTreeSearcher(data_target','BucketSize',10);[index, dist] = knnsearch(kd_tree, data_source');else%利用欧式距离找出对应点集k=size(data_source,2);for i = 1:kdata_q1(1,:) = data_target(1,:) - data_source(1,i); % 两个点集中的点x坐标之差data_q1(2,:) = data_target(2,:) - data_source(2,i); % 两个点集中的点y坐标之差data_q1(3,:) = data_target(3,:) - data_source(3,i); % 两个点集中的点z坐标之差distance = sqrt(data_q1(1,:).^2 + data_q1(2,:).^2 + data_q1(3,:).^2); % 欧氏距离[dist(i), index(i)] = min(distance); % 找到距离最小的那个点endenddisp(['误差err=',num2str(mean(dist))]);disp(['迭代次数ieration=',num2str(iteration)]);err_rec(iteration) = mean(dist);% 按距离排序,只取前面占比为inlierratio内的点以应对外点[~, idx] = sort(dist);inlier_num = round(size(data_source,2)*inlier_ratio);idx = idx(1:inlier_num);data_source_temp = data_source(:,idx);dist = dist(idx);index = index(idx);data_mid = data_target(:,index);% 去中心化后SVD分解求解旋转矩阵与平移向量[R_new, t_new] = rigidTransform3D(data_source_temp', data_mid');% 计算累计的旋转矩阵与平移向量Rf = R_new * Rf;Tf = R_new * Tf + t_new;% 更新点集
% data_source=R_new*data_source+t_new*ones(1,size(data_source,2));data_source=Rf*data_source_old+Tf*ones(1,size(data_source_old,2));% 显示中间结果if show == 1h = figure(2);scatter3(data_source(1,:),data_source(2,:),data_source(3,:),'b.');hold on;scatter3(data_target(1,:),data_target(2,:),data_target(3,:),'r.');hold off;daspect([1 1 1]);pause(0.1);drawnowendif err < Tolerancedisp('————————————————————————————');disp('情况1:优化结果已经达到目标,结束优化');breakendif iteration > 1 && err_rec(iteration-1) - err_rec(iteration) < step_Tolerancedisp('————————————————————————————');disp('情况2:迭代每一步带来的优化到极限值,结束优化');breakendif iteration>=max_iterationdisp('————————————————————————————');disp('情况3:迭代已经达到最大次数,结束优化');breakend
end%% 计算最后结果的误差
if kd == 1%利用Kd-tree找出对应点集kd_tree = KDTreeSearcher(data_target','BucketSize',10);[index, dist] = knnsearch(kd_tree, data_source');
else%利用欧式距离找出对应点集k=size(data_source,2);for i = 1:kdata_q1(1,:) = data_target(1,:) - data_source(1,i); % 两个点集中的点x坐标之差data_q1(2,:) = data_target(2,:) - data_source(2,i); % 两个点集中的点y坐标之差data_q1(3,:) = data_target(3,:) - data_source(3,i); % 两个点集中的点z坐标之差distance = sqrt(data_q1(1,:).^2 + data_q1(2,:).^2 + data_q1(3,:).^2); % 欧氏距离[dist(i), index(i)] = min(distance); % 找到距离最小的那个点end
end
disp(['最终误差err=',num2str(mean(dist))]);
err_rec(iteration+1) = mean(dist);%% 迭代优化过程中误差变化曲线
figure;
plot(0:iteration,err_rec);
grid on% 最后点云匹配的结果
figure;
scatter3(data_source(1,:),data_source(2,:),data_source(3,:),'b.');
hold on;
scatter3(data_target(1,:),data_target(2,:),data_target(3,:),'r.');
hold off;
daspect([1 1 1]);% disp('旋转矩阵的真值:');
% disp(T0); %旋转矩阵真值
disp('计算出的旋转矩阵:');
T_final = [Rf,Tf];
T_final=[T_final;0,0,0,1];
disp(T_final);%% 计算两个点集p,q的刚性变换参数,p和q的大小要一致
function [R, t] = rigidTransform3D(p, q)
n = cast(size(p, 1), 'like', p);
m = cast(size(q, 1), 'like', q);
% 去中心化
pmean = sum(p,1)/n;
p2 = bsxfun(@minus, p, pmean);
qmean = sum(q,1)/m;
q2 = bsxfun(@minus, q, qmean);
% 对协方差矩阵进行SVD分解
C = p2'*q2;
[U,~,V] = svd(C);
R = V*diag([1 1 sign(det(U*V'))])*U';
t = qmean' - R*pmean';
end%% 对点云进行旋转与平移
function [data_q,T] = rotate(data,theta_x, theta_y, theta_z, t)
theta_x = theta_x/180*pi;
rot_x = [1 0 0;0 cos(theta_x) sin(theta_x);0 -sin(theta_x) cos(theta_x)];
theta_y = theta_y/180*pi;
rot_y = [cos(theta_y) 0 -sin(theta_y);0 1 0;sin(theta_y) 0 cos(theta_y)];
theta_z = theta_z/180*pi;
rot_z = [cos(theta_z) sin(theta_z) 0;-sin(theta_z) cos(theta_z) 0;0 0 1];
% 变换矩阵
T = rot_x*rot_y*rot_z;
T = [T,t'];
T=[T;0,0,0,1];
%化为齐次坐标
rows=size(data,2);
rows_one=ones(1,rows);
data=[data;rows_one];
%返回三维坐标
data_q=T*data;
data_q=data_q(1:3,:);
end
3.点云拟合
clear ;
close all;
clc;% for dis_index=1:1:4
% if (dis_index==1)
% dis=300;
% elseif (dis_index==2)
% dis=500;
% elseif (dis_index==3)
% dis=800;
% elseif (dis_index==4)
% dis=1000;
% end
dis=300;
multip =1/4;height_low=400+64;
width_low=640+135;
% %***************************** plane ****************************************************
ty_plane=-height_low:1:height_low-1;
tx_plane=-width_low:1:width_low-1;
[x_plane,y_plane]=meshgrid(tx_plane,ty_plane);%形成格点矩阵
z_plane=0*(10*sin(pi*x_plane/(20))+10*cos(pi*y_plane/(20)));z_plane=imresize(z_plane,multip);[z_plane_row,z_plane_col] = find(z_plane>=-20);
len_z_plane =length(z_plane_row);
depth_z_plane = zeros(len_z_plane,1);
for index_plane = 1:len_z_planez_plane_x =z_plane_row(index_plane,:);z_plane_y =z_plane_col(index_plane,:); depth_z_plane(index_plane) = z_plane(z_plane_x,z_plane_y)+dis;
endfigure(1)
point_plane = [z_plane_row,z_plane_col,depth_z_plane];
pc_plane = pointCloud(point_plane);
pcshow(pc_plane);tic
pcwrite(pc_plane,['adis',num2str(dis),'_pc_plane.ply'],'PLYFormat','ascii');
% pcwrite(pc_plane,['adis',num2str(dis),'_pc_plane.ply'],'PLYFormat','ascii');
toc
% %***************************** step ****************************************************z_step(2*height_low,2*width_low) = 0;
for x_step=0:(2*width_low)for y_step=0:(2*height_low)if ((y_step>190)&&(y_step<400)&&(x_step>150)&&(x_step<395))z_step(y_step,x_step) = 4;elseif ((y_step>400)&&(y_step<610)&&(x_step>150)&&(x_step<395))z_step(y_step,x_step) = 1;elseif ((y_step>190)&&(y_step<400)&&(x_step>395)&&(x_step<640))z_step(y_step,x_step) = 3;elseif ((y_step>400)&&(y_step<610)&&(x_step>395)&&(x_step<640))z_step(y_step,x_step) = 2; elseif ((y_step>190)&&(y_step<400)&&(x_step>640)&&(x_step<885))z_step(y_step,x_step) = 2; elseif ((y_step>400)&&(y_step<610)&&(x_step>640)&&(x_step<885))z_step(y_step,x_step) = 3; elseif ((y_step>190)&&(y_step<400)&&(x_step>885)&&(x_step<1130))z_step(y_step,x_step) = 1;elseif ((y_step>400)&&(y_step<610)&&(x_step>885)&&(x_step<1130))z_step(y_step,x_step) = 4; elseif ((y_step<190)&&(y_step>610)&&(x_step<150)&&(x_step>1130))z_step(y_step,x_step) = 1;endend
end
z_step=imresize(z_step,multip);
% [rows_step,cols_step]=size(z_step);[z_step_row,z_step_col] = find(z_step>=-20);
len_z_step =length(z_step_row);
depth_z_step = zeros(len_z_step,1);
for index_step = 1:len_z_stepz_step_x =z_step_row(index_step,:);z_step_y =z_step_col(index_step,:); depth_z_step(index_step) = z_step(z_step_x,z_step_y)+dis;
endfigure(2)
point_step = [z_step_row,z_step_col,depth_z_step];
pc_step = pointCloud(point_step);
pcshow(pc_step);tic
pcwrite(pc_step,['adis',num2str(dis),'_pc_step.ply'],'PLYFormat','ascii');
toc
% %***************************** wave *********************************************
ty_single=-height_low:1:height_low-1;
tx_single=-width_low:1:width_low-1;
[x_single,y_single]=meshgrid(tx_single,ty_single);%形成格点矩阵
z_single=10*sin(pi*x_single/(20));%+10*cos(pi*y_wave/(20));z_single=imresize(z_single,multip);[z_single_row,z_single_col] = find(z_single>=-20);
len_z_single =length(z_single_row);
depth_z_single = zeros(len_z_single,1);
for index_single = 1:len_z_singlez_single_x =z_single_row(index_single,:);z_single_y =z_single_col(index_single,:); depth_z_single(index_single) = z_single(z_single_x,z_single_y)+dis;
endfigure(3)
point_wave = [z_single_row,z_single_col,depth_z_single];
pc_wave = pointCloud(point_wave);
pcshow(pc_wave);tic
pcwrite(pc_wave,['adis',num2str(dis),'_pc_wave.ply'],'PLYFormat','ascii');
toc
% %***************************** egg *********************************************
ty_wave=-height_low:1:height_low-1;
tx_wave=-width_low:1:width_low-1;
[x_wave,y_wave]=meshgrid(tx_wave,ty_wave);%形成格点矩阵
z_egg=5*sin(pi*x_wave/(20))+5*cos(pi*y_wave/(20));z_egg=imresize(z_egg,multip);[z_wave_row,z_wave_col] = find(z_egg>=-20);
len_z_wave =length(z_wave_row);
depth_z_wave = zeros(len_z_wave,1);
for index_wave = 1:len_z_wavez_wave_x =z_wave_row(index_wave,:);z_wave_y =z_wave_col(index_wave,:); depth_z_wave(index_wave) = z_egg(z_wave_x,z_wave_y)+dis;
endfigure(4)
point_plate =[z_wave_row,z_wave_col,depth_z_wave];
pc_egg = pointCloud(point_plate);
pcshow(pc_egg);tic
pcwrite(pc_egg,['adis',num2str(dis),'_pc_egg.ply'],'PLYFormat','ascii');
toc
% %***************************** triangular profiler ****************************************************
% end
4.点云拟合函数
function [data_target]=scene_to_ply_downsample_function(scene,height,width,distance,multiplier)% clear;
% close all;
% clc;% dis=300;
% multip =1/2;
% height_low=400;
% width_low=640;
dis=distance;
multip =multiplier;
height_low=height;
width_low=width;
% %***************************** plane ****************************************************
tx_plane=-height_low:1:height_low-1;
ty_plane=-width_low:1:width_low-1;
[x_plane,y_plane]=meshgrid(tx_plane,ty_plane);%形成格点矩阵
z_plane=0*(10*sin(pi*x_plane/(20))+10*cos(pi*y_plane/(20)));z_plane=imresize(z_plane,multip);[z_plane_row,z_plane_col] = find(z_plane>=-20);
len_z_plane =length(z_plane_row);
depth_z_plane = zeros(len_z_plane,1);
for index_plane = 1:len_z_planez_plane_x =z_plane_row(index_plane,:);z_plane_y =z_plane_col(index_plane,:); depth_z_plane(index_plane) = z_plane(z_plane_x,z_plane_y)+dis;
endfigure(11)
point_plane = [z_plane_row,z_plane_col,depth_z_plane];
pc_plane = pointCloud(point_plane);
pcshow(pc_plane);% tic
% pcwrite(pc_plane,['adis',num2str(dis),'_pc_plane.ply'],'PLYFormat','ascii');
% % pcwrite(pc_plane,['adis',num2str(dis),'_pc_plane.ply'],'PLYFormat','ascii');
% toc
% %***************************** step ****************************************************z_step(2*height_low,2*width_low) = 0;
for x_step=0:(2*width_low)for y_step=0:(2*height_low)if ((y_step>190)&&(y_step<400)&&(x_step>150)&&(x_step<395))z_step(y_step,x_step) = 4;elseif ((y_step>400)&&(y_step<610)&&(x_step>150)&&(x_step<395))z_step(y_step,x_step) = 1;elseif ((y_step>190)&&(y_step<400)&&(x_step>395)&&(x_step<640))z_step(y_step,x_step) = 3;elseif ((y_step>400)&&(y_step<610)&&(x_step>395)&&(x_step<640))z_step(y_step,x_step) = 2; elseif ((y_step>190)&&(y_step<400)&&(x_step>640)&&(x_step<885))z_step(y_step,x_step) = 2; elseif ((y_step>400)&&(y_step<610)&&(x_step>640)&&(x_step<885))z_step(y_step,x_step) = 3; elseif ((y_step>190)&&(y_step<400)&&(x_step>885)&&(x_step<1130))z_step(y_step,x_step) = 1;elseif ((y_step>400)&&(y_step<610)&&(x_step>885)&&(x_step<1130))z_step(y_step,x_step) = 4; elseif ((y_step<190)&&(y_step>610)&&(x_step<150)&&(x_step>1130))z_step(y_step,x_step) = 1;endend
end
z_step=imresize(z_step,multip);
% [rows_step,cols_step]=size(z_step);[z_step_row,z_step_col] = find(z_step>=-20);
len_z_step =length(z_step_row);
depth_z_step = zeros(len_z_step,1);
for index_step = 1:len_z_stepz_step_x =z_step_row(index_step,:);z_step_y =z_step_col(index_step,:); depth_z_step(index_step) = z_step(z_step_x,z_step_y)+dis;
endfigure(22)
point_step = [z_step_row,z_step_col,depth_z_step];
pc_step = pointCloud(point_step);
pcshow(pc_step);% tic
% pcwrite(pc_step,['adis',num2str(dis),'_pc_step.ply'],'PLYFormat','ascii');
% toc
% %***************************** wave *********************************************
ty_single=-height_low:1:height_low-1;
tx_single=-width_low:1:width_low-1;
[x_single,~]=meshgrid(tx_single,ty_single);%形成格点矩阵
z_single=10*sin(pi*x_single/(20));%+10*cos(pi*y_wave/(20));
z_single=z_single';
z_single=imresize(z_single,multip);[z_single_row,z_single_col] = find(z_single>=-20);
len_z_single =length(z_single_row);
depth_z_single = zeros(len_z_single,1);
for index_single = 1:len_z_singlez_single_x =z_single_row(index_single,:);z_single_y =z_single_col(index_single,:); depth_z_single(index_single) = z_single(z_single_x,z_single_y)+dis;
endfigure(33)
point_wave = [z_single_row,z_single_col,depth_z_single];
pc_wave = pointCloud(point_wave);
pcshow(pc_wave);% tic
% pcwrite(pc_wave,['adis',num2str(dis),'_pc_wave.ply'],'PLYFormat','ascii');
% toc
% %***************************** egg *********************************************
tx_wave=-height_low:1:height_low-1;
ty_wave=-width_low:1:width_low-1;
[x_wave,y_wave]=meshgrid(tx_wave,ty_wave);%形成格点矩阵
z_egg=5*sin(pi*x_wave/(20))+5*cos(pi*y_wave/(20));z_egg=imresize(z_egg,multip);[z_wave_row,z_wave_col] = find(z_egg>=-20);
len_z_wave =length(z_wave_row);
depth_z_wave = zeros(len_z_wave,1);
for index_wave = 1:len_z_wavez_wave_x =z_wave_row(index_wave,:);z_wave_y =z_wave_col(index_wave,:); depth_z_wave(index_wave) = z_egg(z_wave_x,z_wave_y)+dis;
endfigure(44)
point_plate =[z_wave_row,z_wave_col,depth_z_wave];
pc_egg = pointCloud(point_plate);
pcshow(pc_egg);if(strcmp(scene,'scene1'))data_target=pc_plane;
elseif(strcmp(scene,'scene2'))data_target=pc_step;
elseif(strcmp(scene,'scene3'))data_target=pc_wave;
elseif(strcmp(scene,'scene4'))data_target=pc_egg;
end
% tic
% pcwrite(pc_egg,['adis',num2str(dis),'_pc_egg.ply'],'PLYFormat','ascii');
% toc
% %***************************** triangular profiler ****************************************************
end
相关文章:

Centos 7环境下源码安装PostgreSQL数据库
马上就要去实习了,工作内容是搞数据仓库方面的,用的是postgresql关系型数据库,于是自己先来了解下这种数据的用法,之后说说这个数据库和MySQL的关系和区别。 1.Postgresql简介 看了下官网上的介绍,全球最高级的开源关系…

Oracle job procedure 存储过程定时任务
Oracle job procedure 存储过程定时任务 oracle job有定时执行的功能,可以在指定的时间点或每天的某个时间点自行执行任务。 一、查询系统中的job,可以查询视图 --相关视图 select * from dba_jobs; select * from all_jobs; select * from user_jobs; -…

Hadoop运行模式 之 伪分布式运行模式
什么是伪分布式模式?它与本地运行模式以及完全分布式模式有什么区别? 伪分布式的配置信息,完全是按照完全分布式的模式去搭建的,但是它只有一台服务器,可以用于学习和测试,真正的开发中不可以使用。 目录…

【C++】【一】结构体数组
demo7:函数份文件编写 swap.h #include <iostream> using namespace std;//函数的声明 void swap(int a, int b); swap.cpp #include "swap.h"//函数的定义 void swap(int a, int b) {int temp a;a b;b temp;cout << "a " << a …

Message、Handler、Message Queue、Looper之间的关系
2019独角兽企业重金招聘Python工程师标准>>> 在单线程模型下,为了解决线程通信问题,Android设计了一个通信机制。Message Queue(消息队列), 线程间的通信可以通过Message Queue、Handler和Looper进行信息交换。下面将对它们进行逐…

在linux中只将“桌面”修改成“Desktop”而系统仍然使用中文
在安装好centos系统以后,它的Desktop,Downloads等文件夹都是中文的,桌面,下载等,这样在使用cd命令时特别不方便 解决方法一:下载一个中文输入法,安装 解决方法二: 修改il8n文件&a…

Zabbix 3.0 从入门到精通(zabbix使用详解)
第1章 zabbix监控 1.1 为什么要监控 在需要的时刻,提前提醒我们服务器出问题了 当出问题之后,可以找到问题的根源 网站/服务器 的可用性 1.1.1 网站可用性 在软件系统的高可靠性(也称为可用性,英文描述为HA,High Avail…

MacBook如何用Parallels Desktop安装windows7/8
虽然MacBook真的很好用,不过在天朝的国情下,有很多软件还是仅支持IE和windows系统下才有。所以有必要为自己的MacBook装一个windows版本的系统,之前试过用Boot Camp来建立分区和安装win7,之后自己又用Parallels Desktop安装过win8…

在IDEA 中为Maven 配置阿里云镜像源
打开IntelliJ IDEA->Settings ->Build, Execution, Deployment -> Build Tools > Maven 注意要勾选上override 自己创建一个settings.xml文件, 内容如下 <settings xmlns"http://maven.apache.org/SETTINGS/1.0.0"xmlns:xsi"http:/…

【匹配算法】渐进一致采样 PROSAC(PROgressive SAmple Consensus)
方法简介 渐进一致采样法1 (PROSAC) 是对经典的 RANSAC2 中采样的一种优化。相比经典的 RANSAC 方法均匀地从整个集合中采样,PROSAC 方法是从不断增大的最佳对应点集合中进行采样的。所以这种方法可以节省计算量,提高运行速度。 论文:https:…

阿里巴巴开源的 Blink 实时计算框架真香
Blink 开源了有一段时间了,竟然没发现有人写相关的博客,其实我已经在我的知识星球里开始写了,今天来看看 Blink 为什么香? 我们先看看 Blink 黑色版本: 对比下 Flink 版本你就知道黑色版本多好看了。 你上传 jar 包的时…

【地图API】收货地址详解2
上次讲解的方法是: 在地图中心点添加一个标注,每次拖动地图就获取地图中心点,再把标注的位置设置为地图中心点。可参考教程:http://www.cnblogs.com/milkmap/p/6126424.html 可能有开发者觉得,这个算法会有“延时”&am…

MATLAB【十三】————仿真函数记录以及matlab变成小结
part one:matlab 编程小结。 1.char 与string的区别,char使用的单引号 ‘’ ,string使用的是双引号“”。 2.一般标题中的输出一定要通过 num2str 处理,画图具体的图像细节参考:https://blog.csdn.net/Darlingqiang/ar…

IDEA HDFS客户端准备
在此之前:先进行在IDEA 中为Maven 配置阿里云镜像源 1、将资料包中的压缩包解压到一个没有中文的目录下 2、配置HADOOP_HOME环境变量 3、配置Path环境变量 4、创建一个Maven工程HDFSClientDemo 5、在pom.xml中添加依赖 <dependencies><dependency><g…

12 Java面向对象之多态
JavaSE 基础之十二12 Java面向对象之多态 ① 多态的概念及分类 多态的概念:对象的多种表现形式和能力多态的分类 1. 静态多态:在编译期间,程序就能决定调用哪个方法。方法的重载就表现出了静态多态。 2. 动态多态:在程序运行…

MATLAB【十四】————遍历三层文件夹操作
文件夹遍历 clear; clc; close all;%% crop the im into 256*256 num 0; %% num1 内缩3个像素 num 2 内缩6个像素 load(qualitydata1.mat) load(qualitydata2.mat)[data1_m,data1_n] size(qualitydata1); [data2_m,data2_n] size(qualitydata2);%% read image_name …

LoadRunner监控Linux
有的linux机器上安装rpc后会保存如下: test -z "/usr/local/sbin" || mkdir -p -- . "/usr/local/sbin"/bin/install -c rpc.rstatd /usr/local/sbin/rpc.rstatd make[2]: Nothing to be done for install-data-am. make[2]: Leaving directory…

scala while循环中断
Scala内置控制结构特地去掉了break和continue,是为了更好的适应函数化编程,推荐使用函数式的风格解决break和contine的功能,而不是一个关键字。 如何实现continue的效果 Scala内置控制结构特地也去掉了continue,是为了更好的适应…

05-04-查看补丁更新报告
《系统工程师实战培训》 -05-部署补丁管理服务器 -04-查看补丁更新报告 作者:学 无 止 境QQ交流群:454544014///安装报表工具(在100-Admin01上面安装如下工具,方便查看WSUS更新补丁报告!)Microsoft System CLR Types f…

ISP【三】———— raw读取、不同格式图片差异
part zero: 如何处理.raw格式数据,读取和转化 matlab读取raw图 (mark读取图片尺寸和位数均可设置,图片尺寸M,N,图片数据类型8bit,16bit改成uint16) clear; clc; close all; % % rotpath imread(D:\matlab\ncc_ive…

深度学习 - 相关名词概念
2019独角兽企业重金招聘Python工程师标准>>> Neural Network 神经网络 Weights 权重 Bias 偏移 Activation Function 激活函数, 用于调整每个神经的输出, 有如下几个常用的函数种类 ReLU Sigmoid Optimizer 优化器 Adam Input Layer, Hidden Layer, Output Layer 输…

HDFS的API操作
准备工作:IDEA > HDFS客户端准备 目录 文件上传 文件下载 文件夹删除 修改文件名称 查看文件详情 文件和文件夹的判断 完整代码 文件上传 注意conf.set("dfs.replication","2");的位置,位置不一样,设置的副本…

微信小程序-锚点定位+内容滑动控制导航选中
之前两篇文章分别介绍了锚点定位和滑动内容影响导航选中,这里我们就结合起来,实现这两个功能! 思路不再多说,直接上干货! WXML <view class"navigateBox"><view class"title"><ima…

MATLAB【十四】————调用深度库生成exe,批量运行三层文件夹下图片,保存结果
运行路径:D:\matlab\cmd_batch_processing 文件夹架构: clear; clc; close all;%% crop the im into 256*256oriDataPath D:\matlab\cmd_batch_processing\data\; targetPathOri D:\matlab\cmd_batch_processing\result\;report_path D:\matlab\cm…

JDK1.8学习
2019独角兽企业重金招聘Python工程师标准>>> List<OrderGoodsDetail> olist BeanMapper.mapList(list,OrderGoodsDetail.class);List<String> list2 Arrays.asList("123", "45634", "7892", "abch", "s…

HDFS的数据流
目录 HDFS写数据流程 剖析文件写入 网络拓扑-节点距离计算 机架感知(副本存储节点选择) Hadoop2.7.2 副本节点选择 HDFS读数据流程 HDFS写数据流程 剖析文件写入 1)客户端通过Distributed FileSystem模块向NameNode请求上传文件&#x…

Js----闭包
1、闭包的概念:(我找了很多,看大家的理解) A:闭包是指可以包含自由(未绑定到特定对象)变量的代码块; 这些变量不是在这个代码块内或者任何全局上下文中定义的,而是在定义代码块的环境中定义(局部…

【C++】【四】企业链表
// 企业链表.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // 链表改进版 企业常用#include <iostream> #include<stdlib.h>//链表小节点 不包含数据域 typedef struct linknode {struct linknode* next; }linknode; //链表节点 数据指…

GoldenGate的Logdump工具使用简介
Logdump工具是GoldenGate提供的一个用于查询、分析、过滤、查看和保存存储在trail文件或extract文件中的数据的工具。1、启动Logdump工具[oraclerhel6 ~]$ cd /ogg [oraclerhel6 ogg]$ ./logdumpOracle GoldenGate Log File Dump Utility for Oracle Version 12.2.0.1.1 OGGCOR…

scala惰性函数
惰性计算(尽可能延迟表达式求值)是许多函数式编程语言的特性。惰性集合在需要时提供其元素,无需预先计算它们,这带来了一些好处。首先,您可以将耗时的计算推迟到绝对需要的时候。其次,您可以创造无限个集合…