phoenixnn / RGBD-object-propsal

GNU General Public License v3.0
13 stars 4 forks source link

File m_pcd_clustering.out dont read pcd file as expected #2

Open zisluiz opened 4 years ago

zisluiz commented 4 years ago

Dear folks, please need some help. Im trying run the code, but when I run Superpixel2Bbox.m, a error appears in m_pcd_clustering.out call.

Line:

system(sprintf('src/segmentations/m_pcd_clustering.out %s %d %d', ...
                   pcdFile, clusterTolerance(i), pid));

Error: [pcl::PCDReader::readHeader] Could not find file '1.pcd'

Calling apart this file on terminal:

zis@Zis:~/dev/code/RGBD-object-propsal/src/segmentations$ ./m_pcd_clustering.out 1.pcd
clusterTolerance is set to 0.01
[pcl::PCDReader::readHeader] Could not find file '1.pcd'.
loaded 0 data points for image 1
Segmentation fault

1.pcd are located on folder, I tried many possibilities, tried with PCL 1.7, 1.8, 1.9, but with no success. Tried too open 1.pcd on pcl_viewer, with success, tried call m_pcd_clustering.out with another pcd file, different directories, permissions calls, but no luck.

Anyone have the source code of file m_pcd_clustering.out? I think rebuilding this file on current S.O. libraries can solve this problem, or at least, I can debug to fix what is going on. Anyone got this problem too?

zisluiz commented 4 years ago

I made some modifications in my rep https://github.com/zisluiz/RGBD-object-propsal, some dataset customizations, and I changed these code to below:

File: HierClustering.m after line 38:

pcd = pcd/100; % convert to meters

%% clustering
segMasks = [];
pCloudPcd = pointCloud(double(pcd));
clusterTolerance = clusterTolerance/100; % use meters
for i = 1 : numel(clusterTolerance)
    % euclidean clustering
    [clusters,numClusters] = pcsegdist(pCloudPcd, clusterTolerance(i));
    % save mask
    for j = 1 : numClusters
        tmp = zeros(h, w);
        idx = ind(clusters == j);
        tmp(idx) = 1;
        mask = cell(1,1);
        mask{1,1} = find(tmp);
        segMasks = cat(1, segMasks, mask);
    end
end

These method change did work, apparently get same results.