```java
package org.open3d.examples;import org.open3d.*;import static org.open3d.global.Open3D.*;/** * Example 4: ICP Registration * * Demonstrates registering two point clouds using Iterative Closest Point (ICP). */public class Example4_ICPRegistration {public static void main(String[] args) {if (args.length < 2) { System.out.println("Usage: Example4_ICPRegistration <source.ply> <target.ply>");System.out.println(" Registers the source point cloud to the target using ICP.");return;} String sourceFile = args[0];String targetFile = args[1];System.out.println("=== Open3D JavaCPP - ICP Registration ===");System.out.println("Source: " + sourceFile);System.out.println("Target: " + targetFile);// Read source and target point cloudsPointCloud source = new PointCloud();PointCloud target = new PointCloud();boolean s1 = ReadPointCloud(sourceFile, source);boolean s2 = ReadPointCloud(targetFile, target);if (!s1 || !s2) { System.err.println("Failed to read point clouds.");return;} System.out.println("\n--- Source: has points = " + source.HasPoints());System.out.println("--- Target: has points = " + target.HasPoints());// Estimate normals (needed for point-to-plane ICP)KDTreeSearchParamKNN searchParam = new KDTreeSearchParamKNN(30);source.EstimateNormals(searchParam, true);target.EstimateNormals(searchParam, true);System.out.println("Normals estimated for both clouds.");double maxCorrespondenceDistance = 0.05;// Evaluate initial alignmentSystem.out.println("\n--- Evaluate Initial Alignment ---");RegistrationResult evalResult = EvaluateRegistration(source, target, maxCorrespondenceDistance);System.out.printf("Initial Fitness: %.6f%n", evalResult.fitness_());System.out.printf("Initial Inlier RMSE: %.6f%n", evalResult.inlier_rmse_());// Point-to-point ICPSystem.out.println("\n--- Point-to-Point ICP ---");TransformationEstimationPointToPoint estimationP2P = new TransformationEstimationPointToPoint(false);ICPConvergenceCriteria criteria = new ICPConvergenceCriteria(1e-6, 1e-6, 30);RegistrationResult resultP2P = RegistrationICP( source, target, maxCorrespondenceDistance,new double[]{1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}, // identity 4x4estimationP2P, criteria);System.out.printf("P2P Fitness: %.6f%n", resultP2P.fitness_());System.out.printf("P2P Inlier RMSE: %.6f%n", resultP2P.inlier_rmse_());// Point-to-plane ICPSystem.out.println("\n--- Point-to-Plane ICP ---");TransformationEstimationPointToPlane estimationP2L = new TransformationEstimationPointToPlane();RegistrationResult resultP2L = RegistrationICP( source, target, maxCorrespondenceDistance,new double[]{1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}, estimationP2L, criteria);System.out.printf("P2L Fitness: %.6f%n", resultP2L.fitness_());System.out.printf("P2L Inlier RMSE: %.6f%n", resultP2L.inlier_rmse_());System.out.println("\n=== Done ===");}}```