Code not written correctly in supervoxel clustering function ?

classic Classic list List threaded Threaded
1 message Options
HBR
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Code not written correctly in supervoxel clustering function ?

HBR
In the supervoxel clustering file https://github.com/PointCloudLibrary/pcl/blob/master/segmentation/include/pcl/segmentation/impl/supervoxel_clustering.hpp there is a method which computes the data distance between 2 voxels.

template <typename PointT> float
pcl::SupervoxelClustering<PointT>::voxelDataDistance(const VoxelData &v1, const VoxelData &v2) const
{
        float spatial_dist = (v1.xyz_ - v2.xyz_).norm() / seed_resolution_; //cout << v2.xyz_[1] << " " << v2.xyz_[2] << " " << v1.xyz_[1] << " " << v1.xyz_[2] << endl;
        float color_dist = (v1.rgb_ - v2.rgb_).norm() / 255.0f; //cout << v1.rgb_[0] << " " << v1.rgb_[1] << " " << v1.rgb_[2] << endl;
        float cos_angle_normal = 1.0f - std::abs(v1.normal_.dot(v2.normal_)); //cout << v1.normal_[0] << " " << v1.normal_[1] << " " << v1.normal_[2] << endl;// " " << v2.normal_[0] << " " << v2.normal_[1] << " " << v2.normal_[2] << " " << cos_angle_normal << endl;
        float texture_dist = 1.0f - std::abs(v1.texture_.dot(v2.texture_)); //cout << v1.texture_.t() << endl << v2.texture_.t() << endl << endl;
        return  cos_angle_normal * normal_importance_ + color_dist * color_importance_ + spatial_dist * spatial_importance_ + texture_dist * texture_importance_;
}

When i print the data for v1 however, I keep getting a zero. Why is this happening ?
Loading...