classdef PtCloudClassificationDatastore < matlab.io.Datastore
% PtCloudClassificationDatastore Datastore with point clouds
% and associated categorical labels.
%
% ds = PtCloudClassificationDatastore(foldername) constructs a datastore
% that represents point clouds and associated categories for your dataset.
% The input, foldername, is a string or char array
% which represents the name of the folder that stores trining or test point cloud data.
properties
MiniBatchSize = 1;
end
properties(Dependent)
Files
end
properties(Access = private)
FileDatastore
end
methods
function this = PtCloudClassificationDatastore(datapath)
% Please put the training and test data folder in your current
% directly.
if nargin==0
return;
end
this.FileDatastore = fileDatastore(datapath,'ReadFcn',@extractTrainingData, ...
'IncludeSubfolders',true,'FileExtensions',{'.ply','.pcd'});
end
function tf = hasdata(this)
tf = hasdata(this.FileDatastore);
end
function [data,info] = read(this)
if ~hasdata(this)
error('Reached end of data. Reset datastore.');
end
% Preallocate output.
batchSize = this.MiniBatchSize;
data = cell(batchSize,2);
info = struct(...
'Filename',cell(batchSize,1),...
'FileSize',cell(batchSize,1));
% Read mini-batch size worth of data. The size of data can be
% less than the specified batch size.
idx = 0;
while hasdata(this.FileDatastore)
idx = idx + 1;
[data(idx,:),info(idx)] = read(this.FileDatastore);
if idx == batchSize
break;
end
end
data = data(1:idx,:);
info = info(1:idx);
end
function reset(this)
reset(this.FileDatastore);
end
function files = get.Files(this)
files = this.FileDatastore.Files;
end
function set.Files(this,files)
this.FileDatastore.Files = files;
end
end
methods(Access=protected)
function newds = copyElement(this)
newds = PtCloudClassificationDatastore();
newds.FileDatastore = copy(this.FileDatastore);
newds.MiniBatchSize = this.MiniBatchSize;
% Shuffle files and corresponding labels
numObservations = numel(newds.Files);
idx = randperm(numObservations);
newds.Files = newds.Files(idx);
end
end
end
function dataOut = extractTrainingData(fname)
pointData = readbin(fname);
% The label information was obtained using the folder name
idx=strfind(fname,'\');
name=fname(idx(end-1)+1:idx(end)-1);
dataOut = {pointCloud(pointData),categorical(cellstr(name))};
end
function pointData = readbin(fname)
% readbin Read point in the trainig or test files.
pointData = pcread(fname);
pointData =pointData.Location;
end
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
matlab-使用matlab实现基于PointNet++网络的点云数据分类仿真分析 (635个子文件)
PtCloudClassificationDatastore.m 3KB
pointnetClassifier.m 1KB
pointnetEncoder.m 1KB
modelGradients.m 1KB
initializeSharedMLP.m 1KB
augmentPointCloud.m 957B
dataTransform.m 896B
perceptron.m 820B
dataPrep.m 742B
selectPoints.m 695B
preprocessPointCloud.m 493B
initializeTrainingProgressPlot.m 481B
batchData.m 394B
initializeClassificationMLP.m 367B
initializeTransform.m 343B
prepareForPrediction.m 321B
oneHotEncode.m 271B
sharedMLP.m 249B
aggreateConfusionMetric.m 205B
randReplicateFiles.m 128B
initializeWeightsHe.m 116B
initializeWeightsGaussian.m 80B
Microwave.ply 2.23MB
Display.ply 1.25MB
Chair.ply 1.18MB
Microwave_67.ply 72KB
Microwave_98.ply 72KB
Microwave_26.ply 72KB
Microwave_33.ply 72KB
Microwave_28.ply 72KB
Microwave_88.ply 71KB
Microwave_30.ply 71KB
Microwave_45.ply 71KB
Chair_154.ply 71KB
Microwave_9.ply 71KB
Microwave_64.ply 71KB
Microwave_32.ply 70KB
Microwave_26.ply 70KB
Microwave_1.ply 70KB
Microwave_31.ply 70KB
Microwave_87.ply 70KB
Microwave_12.ply 70KB
Microwave_6.ply 70KB
Microwave_42.ply 70KB
Microwave_69.ply 70KB
Microwave_50.ply 70KB
Microwave_83.ply 70KB
Chair_49.ply 70KB
Microwave_25.ply 70KB
Microwave_47.ply 70KB
Microwave_6.ply 70KB
Chair_2.ply 70KB
Chair_92.ply 70KB
Chair_21.ply 70KB
Chair_44.ply 70KB
Chair_116.ply 70KB
Chair_158.ply 70KB
Chair_83.ply 70KB
Chair_150.ply 70KB
Chair_32.ply 70KB
Chair_102.ply 70KB
Chair_87.ply 70KB
Chair_33.ply 70KB
Display_86.ply 70KB
Microwave_52.ply 70KB
Chair_43.ply 70KB
Microwave_30.ply 70KB
Chair_23.ply 70KB
Chair_105.ply 70KB
Chair_70.ply 70KB
Chair_125.ply 70KB
Chair_86.ply 70KB
Chair_3.ply 70KB
Chair_97.ply 70KB
Chair_106.ply 70KB
Chair_62.ply 70KB
Chair_148.ply 70KB
Chair_126.ply 70KB
Chair_140.ply 70KB
Chair_136.ply 70KB
Microwave_10.ply 70KB
Chair_71.ply 70KB
Microwave_61.ply 70KB
Chair_69.ply 70KB
Chair_133.ply 69KB
Chair_131.ply 69KB
Chair_123.ply 69KB
Chair_132.ply 69KB
Chair_53.ply 69KB
Chair_14.ply 69KB
Chair_90.ply 69KB
Chair_43.ply 69KB
Chair_51.ply 69KB
Chair_100.ply 69KB
Microwave_21.ply 69KB
Chair_17.ply 69KB
Chair_91.ply 69KB
Chair_114.ply 69KB
Chair_79.ply 69KB
Chair_16.ply 69KB
共 635 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
- 郝胖胖2023-11-19感谢资源主的分享,这个资源对我来说很有用,内容描述详尽,值得借鉴。
mYlEaVeiSmVp
- 粉丝: 1887
- 资源: 19万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功