Permalink
Browse files

working on readme, fitCubes

  • Loading branch information...
jackdawjackdaw committed Mar 7, 2012
1 parent 0d55d22 commit 6fe3fedf3061f84fb7685d0147c04b6dd713d4cc
Showing with 26 additions and 17 deletions.
  1. +22 −12 README.md
  2. +4 −5 fitCubes.py
View
@@ -6,23 +6,36 @@ working with openPCL for point cloud segmentation
depends
-------
* openPCL
-* boost (for filesystem libs)
+* boost (for file-system libs)
+
+setup
+-------
+* pull/clone
+* mkdir ./build; cd ./build
+* cmake ..
+* make
+* there's currently no install script, bins will be in ./build/src/
-workflow:
+work flow:
------
1) obtain point clouds from camera / projector system input file.
-
-2) segment full point cloud into separate clouds each one representing
- a cube
- cluster_extract.cpp will read a pcd file and do this arguments are: inputfile outputpath
- cloud cluster can output an approximate centroid using the pcl::compute3DCentroid (currently just to stdout)
+2) inspect constants.h, the values cubeLongSide and cubeShortSide are used throughout the analysis, they should be roughly correct or fit_planes will struggle.
+
+3) using cluster (Args: <cloud_file.pcd> <outpath>) segment the full point cloud into separate clouds each one representing
+ a cube. Each cloud is output as a pcd file, pcd_viewer is really useful for debugging. Clusters are indexed in the order they're pulled out of the original data set. This index is carried through for the rest of the analysis.
-3) run fitCubes on clusters
+4) run fitCubes.py, Args: <path_to_clusters> <path_to_output>. This will default to using fit_planes to extract the centroids and angles. Several ascii data files are created in the output path:
+- centroids_fit.dat: each line is cluster_index, centroid.x, centroid.y, centroid.z, angle.
+ angles are reported mod PI/2 (since we're dealing with cubes)
+- fitCubes-guesslist.txt, lists clusters which only had a single face, so the normals had to be guessed, centroid may be ok, but angle is likely to be off. Each line is: cluster_id, path_to_cluster_pcd_file
+- fitCubes-nanlist.txt, lists clusters which totally failed, it's worth using pcd-viewer to check these out. Each line is: cluster_id, path_to_cluster_pcd_file
+- fitCubes-recon-failed.txt, more failed clusters, these failed because the cluster sizes are too small for planar model fitting, each line: cluster_id, path_to_cluster_pcd_file
+- fitCubes-unknown.txt, clusters which failed for who knows why? each line: cluster_id, path_to_cluster_pcd_file, return val
-4) profit
+5) run wireFinder, Args <path_to_centroids_fit.dat> <outpath> will output wirelist.txt a file which lists which clusters belong to which wires, each line: wire_id cluster_id
file summary:
------
@@ -42,6 +55,3 @@ registered test cube and the transformation matrix (in ascii)
make_test_cubes -> creates a set of test (partial) cubes and applies rotations around the y axis,
useful to test fit_planes and icpcubes
-
-
-
View
@@ -14,21 +14,20 @@
runBinICP= os.path.join(".", "build" , "src", "icpcubes")
runBinFitPlanes = os.path.join(".", "build", "src", "fit_planes")
-if (len(sys.argv) < 4):
+if (len(sys.argv) < 3):
print "# attempts to extract centroids and angles from all files in <inpath>"
print "# output is written to <outpath>"
- print "# binflag: 1 -> icp"
- print "# : else -> fitplanes"
- print "# run with: <inpath> <outpath> <binFlag>"
+ print "# run with: <inpath> <outpath>"
sys.exit(-1)
inpath = sys.argv[1]
outpath = sys.argv[2]
usingFitPlanes = 0
+useICP = 0 ## turn this on to use icp fitting
-if(sys.argv[3] == "1"):
+if(useICP == "1"):
runBin = runBinICP
print "# using icp " + runBin
else:

0 comments on commit 6fe3fed

Please sign in to comment.