Coder Social home page Coder Social logo

m0glan / pcljava Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 11.0 260.05 MB

A port of the Point Cloud Library (PCL) using Java Native Interface (JNI).

License: MIT License

CMake 2.30% C++ 57.85% Java 39.85%
point-cloud pcl-library pcl jni-wrapper maven

pcljava's Introduction

Point-Cloud Library Java

Tag

The goal of this project is to make Point-Cloud Library (PCL) data-structures and algorithms available in Java projects via the Java Native Interface (JNI). Currently supported operating systems are Windows and Linux (64bit architecture only).

Setup

Point-Cloud Library version 1.11.1 as well as all of its dependencies need to be installed in order to use pcljava; these dependencies do NOT come packed with the artifacts associated with this project.

  • An all-in-one PCL installer exists for Windows; once the installation is complete, the following directories must be added to the PATH environment variable:
    • C:\Program Files\PCL 1.11.1\bin
    • C:\Program Files\PCL 1.11.1\3rdParty\VTK\bin
    • C:\Program Files\CMake\bin
    • C:\Program Files\PCL 1.11.1\3rdParty\Boost\lib
    • C:\Program Files\PCL 1.11.1\3rdParty\FLANN\bin
    • C:\Program Files\PCL 1.11.1\3rdParty\Qhull\bin
    • C:\Program Files\OpenNI2\Redist
  • On Linux PCL can be built from source using this guide.

Usage

Project configuration

To include the pcljava library in your project, your pom.xml must have the following configuration:

<repositories>
  <repository>
    <id>github-pcljava</id>
    <name>Point-Cloud Library JNI Port Packages</name>
    <url>https://maven.pkg.github.com/vmoglan/pcljava</url>
  </repository>
</repositories>
<dependency>
  <groupId>com.github.vmoglan</groupId>
  <artifactId>pcljava</artifactId>
  <version><!-- e.g. 0.0.1-SNAPSHOT --></version>
</dependency> 

In addition to that, the pom.xml file must be configured to unpack the native dependencies โ€” see the <profiles> section in this example.

The native pcljava library must also be loaded in your project as such:

class Main {
	static {	
		System.loadLibrary("pcljava");
	}
}

Examples

  • Instantiating a class for which memory is allocated in native code (i.e. a class extending NativeObject):
PointCloud3d cloud = new PointCloud3d(); // creating Java instance
cloud.create(); // allocating memory in the native code

// perform operations on cloud

cloud.dispose(); // freeing the memory allocated in the native code
  • Estimating the normal vectors of a three-dimensional point-cloud:
PointCloud3dReaderPly reader = new PointCloud3dReaderPly();
PointCloud3d cloud = reader.read("/path/to/cloud.ply");

NormalEstimation normalEstimation = new NormalEstimation(cloud, 0.03f);
NormalCloud normals = normalEstimation.compute();
		
cloud.dispose();
normals.dispose();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.