Example: tourism industry

PCL Tutorial: - The Point Cloud Library By Example

PCL Tutorial: The Point Cloud Library By ExampleJeff DelmericoVision and Perceptual Machines Lab106 Davis HallUB North 11, 2013 Jeff DelmericoFebruary 11, 20131/38 Point CloudsDefinitionA Point Cloud is a data structure used to represent a collection ofmulti-dimensional points and is commonly used to representthree-dimensional a 3D Point Cloud , the points usually represent the X, Y, and Zgeometric coordinates of an underlying sampled surface. Whencolor information is present, the Point Cloud becomes DelmericoFebruary 11, 2013 Introduction2/38 Where do Point clouds come from?IRGB-D camerasIStereo camerasI3D laser scannersITime-of-flight camerasISythetically from software( Blender)Jeff DelmericoFebruary 11, 2013 Introduction3/38 Point Cloud LibraryIPCL is a large scale, open project for 2D/3D image and pointcloud processing (in C++, w/ new python bindings).

Point Cloud Library I PCL is a large scale, open project for 2D/3D image and point cloud processing (in C++, w/ new python bindings). I The PCL framework contains numerous state-of-the art algorithms including ltering, feature estimation, surface reconstruction, registration, model tting and segmentation.

Tags:

  Cloud, Points, Point cloud

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of PCL Tutorial: - The Point Cloud Library By Example

1 PCL Tutorial: The Point Cloud Library By ExampleJeff DelmericoVision and Perceptual Machines Lab106 Davis HallUB North 11, 2013 Jeff DelmericoFebruary 11, 20131/38 Point CloudsDefinitionA Point Cloud is a data structure used to represent a collection ofmulti-dimensional points and is commonly used to representthree-dimensional a 3D Point Cloud , the points usually represent the X, Y, and Zgeometric coordinates of an underlying sampled surface. Whencolor information is present, the Point Cloud becomes DelmericoFebruary 11, 2013 Introduction2/38 Where do Point clouds come from?IRGB-D camerasIStereo camerasI3D laser scannersITime-of-flight camerasISythetically from software( Blender)Jeff DelmericoFebruary 11, 2013 Introduction3/38 Point Cloud LibraryIPCL is a large scale, open project for 2D/3D image and pointcloud processing (in C++, w/ new python bindings).

2 IThe PCL framework contains numerous state-of-the artalgorithms including filtering, feature estimation, surfacereconstruction, registration, model fitting and is cross-platform, and has been successfully compiled anddeployed on Linux, MacOS, Windows, and DelmericoFebruary 11, 2013 Introduction4/38 Getting PCLIF irst, download PCL for your system from: you want to try the python bindings (currently for only asubset of the full PCL functionality), go here: provides the 3D processing pipeline for ROS, so you canalso get the perceptionpcl stack and still use PCL depends on Boost, Eigen, FLANN, and DelmericoFebruary 11, 2013 Using PCL5/38 Basic StructuresThe basic data type in PCL is a PointCloud.

3 A PointCloud is atemplated C++ class which contains the following data fields:Iwidth (int)- secifies the width of the Point Cloud dataset inthe number of total number of points in the Cloud (equal with thenumber of elements in points ) for unorganized datasetsIthe width (total number of points in a row) of an organizedpoint Cloud datasetIheight (int)- Specifies the height of the Point Cloud datasetin the number of to1for unorganized Point cloudsIthe height (total number of rows) of an organized Point clouddatasetIpoints (std::vector PointT )- Contains the data arraywhere all the points of type PointT are DelmericoFebruary 11, 2013 Using PCL6/38 Basic StructuresIisdense (bool)- Specifies if all the data inpointsis finite(true), or whether the XYZ values of certain points mightcontain Inf/NaN values (false).

4 Isensororigin(Eigen::Vector4f)- Specifies the sensoracquisition pose (origin/translation). This member is usuallyoptional, and not used by the majority of the algorithms (Eigen::Quaternionf)- Specifies thesensor acquisition pose (orientation). This member is usuallyoptional, and not used by the majority of the algorithms DelmericoFebruary 11, 2013 Using PCL7/38 Point TypesIPointXYZ- float x, y, zIPointXYZI- float x, y, z, intensityIPointXYZRGB- float x, y, z, rgbIPointXYZRGBA- float x, y, z, uint32t rgbaINormal- float normal[3], curvatureIPointNormal- float x, y, z, normal[3], curvatureIHistogram- float histogram[N]IAnd many, many, more.

5 Plus you can define new types to suityour DelmericoFebruary 11, 2013 Using PCL8/38 Building PCL ProjectsPCL relies onCMakeas a build tool. CMake just requires thatyou place a file on your (VERSION FATALERROR)project(MYGRANDPROJECT)findpa ckage(PCL REQUIRED COMPONENTS common io)includedirectories($PCLINCLUDEDIRS)li nkdirectories($PCLLIBRARYDIRS)adddefinit ions($PCLDEFINITIONS)addexecutable(pcdwr itetest )targetlinklibraries(pcdwritetest $PCLCOMMONLIBRARIES$PCLIOLIBRARIES)Jeff DelmericoFebruary 11, 2013 Using PCL9/38 Building PCL ProjectsGenerating the Makefile & Building the Project$cd /PATH/TO/MY/GRAND/PROJECT$ mkdir build$ cd build$ cmake.

6 $ makeJeff DelmericoFebruary 11, 2013 Using PCL10/38 PCD File FormatA simple file format for storing multi-dimensional Point data. Itconsists of a text header (with the fields below), followed by thedata in ASCII (w/ points on separate lines) or binary (a memorycopy of thepointsvector of the PC).IVERSION - the PCD file version (usually .7)IFIELDS - the name of each dimension/field that a Point can have ( FIELDSx y z )ISIZE - the size of each dimension in bytes ( a float is 4)ITYPE - the type of each dimension as a char (I= signed,U= unsigned,F=float)ICOUNT - the number of elements in each dimension ( x, y, or z would onlyhave 1, but a histogram would haveN)IWIDTH - the width of the Point cloudIHEIGHT - the height of the Point cloudIVIEWPOINT - an acquisition viewpoint for the points .

7 Translation (tx ty tz) +quaternion (qw qx qy qz)IPOINTS - the total number of points in the cloudIDATA - the data type that the Point Cloud data is stored in (asciiorbinary)Jeff DelmericoFebruary 11, 2013I/O11/38 PCD Example #.PCD - Point Cloud Data file formatVERSION .7 FIELDS x y z rgbSIZE 4 4 4 4 TYPE F F F FCOUNT 1 1 1 1 WIDTH 213 HEIGHT 1 VIEWPOINT 0 0 0 1 0 0 0 points 213 DATA 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + DelmericoFebruary 11, 2013I/O12/38 Writing PCD #i n c l u d e<p c l / i o / p c di o . h>#i n c l u d e<p c l / p o i n tt y p e s.

8 H>i n tm a i n (i n ta r g c ,c h a r a r g v ){p c l : : P o i n t C l o u d<p c l : : PointXYZ>c l o u d ;// F i l l in the Cloud datac l o u d . w i d t h= 5 0 ;c l o u d . h e i g h t= 1 ;c l o u d . i sd e n s e =f a l s e;c l o u d . p o i n t s . r e s i z e ( c l o u d . w i d t h c l o u d . h e i g h t ) ;f o r( s i z eti = 0 ; i<c l o u d . p o i n t s . s i z e( ) ; ++i ){c l o u d . p o i n t s [ i ] . x = 1 0 2 4 r a n d ( ) / (RANDMAX + 1 . 0 f ) ;c l o u d . p o i n t s [ i ] . y = 1 0 2 4 r a n d ( ) / (RANDMAX + 1 . 0 f ) ;c l o u d.}}

9 P o i n t s [ i ] . z = 1 0 2 4 r a n d ( ) / (RANDMAX + 1 . 0 f ) ;}p c l : : i o : : s a v e P C D F i l e A S C I I ( t e s tp c d . p c d , c l o u d ) ;r e t u r n( 0 ) ;}Jeff DelmericoFebruary 11, 2013I/O13/38 Reading PCD #i n c l u d e<p c l / i o / p c di o . h>#i n c l u d e<p c l / p o i n tt y p e s . h>i n tm a i n (i n ta r g c ,c h a r a r g v ){p c l : : P o i n t C l o u d<p c l : : PointXYZ>: : P t r c l o u d (newp c l : : P o i n t C l o u d<p c l : : PointXYZ>);// Load the f i l ei f( p c l : : i o : : l o a d P C D F i l e<p c l : : PointXYZ>( t e s tp c d.))

10 P c d , c l o u d ) == 1){PCLERROR ( C o u l d n tr e a df i l et e s tp c d . p c d\n ) ;r e t u r n( 1 ) ;}// Do some p r o c e s s i n g on the Cloud herer e t u r n( 0 ) ;}Jeff DelmericoFebruary 11, 2013I/O14/38 Getting Point Clouds from #i n c l u d e<p c l / i o / o p e n n ig r a b b e r . h>#i n c l u d e<p c l / v i s u a l i z a t i o n / c l o u dv i e w e r . h>c l a s sS i m p l e O p e n N I V i e w e r{p u b l i c:S i m p l e O p e n N I V i e w e r ( ) : v i e w e r ( PCLOpenNIV i e w e r ){}v o i dc l o u dc b(c o n s tp c l : : P o i n t C l o u d<p c l : : PointXYZRGBA>: : C o n s t P t r &c l o u d ){i f( !}


Related search queries