diff --git a/2d/include/pcl/2d/impl/kernel.hpp b/2d/include/pcl/2d/impl/kernel.hpp index d85de7e6913..d8a2791fa20 100644 --- a/2d/include/pcl/2d/impl/kernel.hpp +++ b/2d/include/pcl/2d/impl/kernel.hpp @@ -122,7 +122,6 @@ void pcl::kernel::loGKernel(pcl::PointCloud& kernel) { float sum = 0; - float temp = 0; kernel.resize(kernel_size_ * kernel_size_); kernel.height = kernel_size_; kernel.width = kernel_size_; @@ -133,7 +132,7 @@ pcl::kernel::loGKernel(pcl::PointCloud& kernel) for (int j = 0; j < kernel_size_; j++) { int iks = (i - kernel_size_ / 2); int jks = (j - kernel_size_ / 2); - temp = float(double(iks * iks + jks * jks) / sigma_sqr); + float temp = float(double(iks * iks + jks * jks) / sigma_sqr); kernel(j, i).intensity = (1.0f - temp) * std::exp(-temp); sum += kernel(j, i).intensity; } diff --git a/2d/include/pcl/2d/impl/keypoint.hpp b/2d/include/pcl/2d/impl/keypoint.hpp index fd8235d7d34..8dc8bf01612 100644 --- a/2d/include/pcl/2d/impl/keypoint.hpp +++ b/2d/include/pcl/2d/impl/keypoint.hpp @@ -193,17 +193,15 @@ pcl::keypoint::hessianBlob(ImageType& output, hessianBlob(cornerness[i], input, scale, false); scale *= scaling_factor; } - bool non_max_flag = false; - float scale_max, local_max; for (std::size_t i = 0; i < height; i++) { for (std::size_t j = 0; j < width; j++) { - scale_max = std::numeric_limits::min(); + float scale_max = std::numeric_limits::min(); /*default output in case of no blob at the current point is 0*/ output[i][j] = 0; for (int k = 0; k < num_scales; k++) { /*check if the current point (k,i,j) is a maximum in the defined search radius*/ - non_max_flag = false; - local_max = cornerness[k][i][j]; + bool non_max_flag = false; + const float local_max = cornerness[k][i][j]; for (int n = -local_search_radius; n <= local_search_radius; n++) { if (n + k < 0 || n + k >= num_scales) continue; @@ -231,7 +229,7 @@ pcl::keypoint::hessianBlob(ImageType& output, scale_max = cornerness[k][i][j]; /*output indicates the scale at which the blob is found at the current * location in the image*/ - output[i][i] = start_scale * pow(scaling_factor, k); + output[i][j] = start_scale * pow(scaling_factor, k); } } }