3D Object Recognition Using Global Descriptor (Ensemble of Shape Functions) via PCL
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp
- Área
- computer-vision
Línea de trabajo
Comience con el código proporcionado de main(), traverseDirectory() y calculateESFDescriptor(), y luego reproduzca el comportamiento con un directorio que contenga varios archivos .pcd. Siga la iteración del directorio y el procesamiento de descriptores para determinar dónde se detiene la ejecución; el trabajo estará terminado cuando se haya identificado la causa y el programa procese todos los archivos elegibles, con su comportamiento verificado en el escenario proporcionado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I am developing a system for 3D object recognition using the point cloud library. I want to apply an ESF descriptor to a data set that I have stored locally. I am giving the folder containing data to the program as an argument. I am attaching the code for reference.
#include <pcl/io/pcd_io.h>
#include <pcl/features/esf.h>
#include <pcl/visualization/histogram_visualizer.h>
#include <pcl/visualization/pcl_plotter.h>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/console/print.h>
#include <boost/filesystem.hpp>
#include <boost/range/iterator_range.hpp>
#include <flann/flann.h>
#include <fstream>
typedef std::pair<std::string, std::vector<float> > esf_model;
void calculateESFDescriptor(const boost::filesystem::path &path){
pcl::console::print_highlight ("Executing function: calculateESFDescriptor() \n");
// const boost::filesystem::path &path = base_dir/it->path().filename();
// Cloud for storing the object.
pcl::PointCloud<pcl::PointXYZ>::Ptr object(new pcl::PointCloud<pcl::PointXYZ>);
// Object for storing the ESF descriptor.
pcl::PointCloud<pcl::ESFSignature640>::Ptr descriptor(new pcl::PointCloud<pcl::ESFSignature640>);
// Note: you should have performed preprocessing to cluster out the object
// from the cloud, and save it to this individual file.
// Read a PCD file from disk.
if (pcl::io::loadPCDFile<pcl::PointXYZ>(path.string(), *object) != 0)
{
pcl::console::print_highlight ("Unable to read .pcd file from the directory\n");
// return -1;
}
// ESF estimation object.
pcl::ESFEstimation<pcl::PointXYZ, pcl::ESFSignature640> esf;
esf.setInputCloud(object);
esf.compute(*descriptor);
// Writing esf description file to disk
std::string output_file_name = path.string().substr(0, path.string().find_last_of('.')) + "_esf.pcd";
pcl::io::savePCDFileASCII (output_file_name, *descriptor);
std::cerr << "Saved data points to " << output_file_name << std::endl;
// return (0);
}
/** \brief Load a set of ESF features that will act as the model (training data)
* \param argc the number of arguments (pass from main ())
* \param argv the actual command line arguments (pass from main ())
* \param extension the file extension containing the ESF features
*/
void traverseDirectory(const boost::filesystem::path &base_dir, const std::string &extension){
pcl::console::print_highlight ("Executing function: traverseDirectory() \n");
if (!boost::filesystem::exists(base_dir) && !boost::filesystem::is_directory(base_dir)){
pcl::console::print_highlight ("Quitting as the directory does not exists.\n");
return;
}
int i = 0;
for (boost::filesystem::directory_iterator it (base_dir); it != boost::filesystem::directory_iterator (); ++it)
{
if (boost::filesystem::is_directory(it->status()))
{
std::stringstream ss;
ss << it->path ();
pcl::console::print_highlight ("Loading %s \n", ss.str().c_str());
traverseDirectory(it->path(), extension);
}
// Calculate ESF Descriptor for each file
if (boost::filesystem::is_regular_file(it->status()) && boost::filesystem::extension(it->path())==extension)
{
calculateESFDescriptor(base_dir/it->path().filename());
pcl::console::print_highlight ("Loop execution: %d\n", i++);
}
// continue;
}
}
int main(int argc, char** argv)
{
if (argc < 2)
{
PCL_ERROR ("Need at least two parameters! Syntax is: %s [model_directory] [options]\n", argv[0]);
return (-1);
}
std::string extension(".pcd");
transform(extension.begin(), extension.end(), extension.begin(), (int(*)(int))tolower);
// std::vector<esf_model> models;
// Traversing directory to find all .pcd files and applying esf descriptor to each file
traverseDirectory(argv[1], extension);
return (0);
}
The problem is that the function calculateESFDescriptor() runs only once and then the program shuts down without any error, whereas I have multiple .pcd files in the directory and the function should execute for all the files in the directory. I want to calculate the ESF descriptor for all the files to compare them with user-given input at a later stage to calculate the accuracy. I cannot debug where I am making the mistake due to which the program cannot execute for all the files in the directory. The program runs for the whole directory when I comment out the following line. calculateESFDescriptor(base_dir/it->path().filename());
The question is if it is possible to compute descriptor for the whole directory at once or do I have to give each file as input and run the program for each file separately?
- Lenguaje dominante
- C++
- Estrellas
- 11.2k
- Forks
- 4.7k
- Merge medio
- 5 d 8 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PointCloudLibrary/pcl
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
PointCloudLibrary/pcl#6509 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
kind: bug status: triage
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
PointCloudLibrary/pcl#6395 ·
Los mantenedores suelen responder en 4 días
-
[sample_consensus] Migrated the SSE and AVX implementations of countWithinDistance to RISC-V RVV 1.0Abiertokind: request status: triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
PointCloudLibrary/pcl#6385 · 1 reacción ·
Los mantenedores suelen responder en 4 días
-
2 tests failPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
PointCloudLibrary/pcl#6373 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 4 días
-
kind: question kind: request
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
PointCloudLibrary/pcl#6370 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
Todos los issues de PointCloudLibrary/pcl
Issues similares
-
launch-client --save-creds creates creds/<account>/ with mode 755, not 700Posiblemente ocupada @metis-sprock la tomó hoy. Abiertobacklog bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
EchoTools/nevr-runtime#1471 ·
Los mantenedores suelen responder en 1 día
-
.NET ep:WebGPU platform:web
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microsoft/onnxruntime#33755 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
grumpycoders/pcsx-redux#2530 ·
-
A-tools P-medium S-ready-to-start studio task
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Status: Needs confirmation Status: Needs triage Type: Code Quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día