pymomentum-cpu 0.1.93.post0__cp312-cp312-macosx_14_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- include/axel/BoundingBox.h +59 -0
- include/axel/Bvh.h +708 -0
- include/axel/BvhBase.h +75 -0
- include/axel/BvhCommon.h +43 -0
- include/axel/BvhEmbree.h +87 -0
- include/axel/BvhFactory.h +34 -0
- include/axel/Checks.h +21 -0
- include/axel/DualContouring.h +79 -0
- include/axel/KdTree.h +208 -0
- include/axel/Log.h +22 -0
- include/axel/MeshToSdf.h +123 -0
- include/axel/Profile.h +64 -0
- include/axel/Ray.h +45 -0
- include/axel/SignedDistanceField.h +248 -0
- include/axel/SimdKdTree.h +515 -0
- include/axel/TriBvh.h +157 -0
- include/axel/TriBvhEmbree.h +57 -0
- include/axel/common/Constants.h +27 -0
- include/axel/common/Types.h +21 -0
- include/axel/common/VectorizationTypes.h +58 -0
- include/axel/math/BoundingBoxUtils.h +54 -0
- include/axel/math/ContinuousCollisionDetection.h +48 -0
- include/axel/math/CoplanarityCheck.h +30 -0
- include/axel/math/EdgeEdgeDistance.h +31 -0
- include/axel/math/MeshHoleFilling.h +117 -0
- include/axel/math/PointTriangleProjection.h +34 -0
- include/axel/math/PointTriangleProjectionDefinitions.h +209 -0
- include/axel/math/RayTriangleIntersection.h +36 -0
- include/momentum/character/blend_shape.h +97 -0
- include/momentum/character/blend_shape_base.h +86 -0
- include/momentum/character/blend_shape_skinning.h +96 -0
- include/momentum/character/character.h +272 -0
- include/momentum/character/character_state.h +108 -0
- include/momentum/character/character_utility.h +128 -0
- include/momentum/character/collision_geometry.h +80 -0
- include/momentum/character/collision_geometry_state.h +130 -0
- include/momentum/character/fwd.h +262 -0
- include/momentum/character/inverse_parameter_transform.h +58 -0
- include/momentum/character/joint.h +82 -0
- include/momentum/character/joint_state.h +241 -0
- include/momentum/character/linear_skinning.h +139 -0
- include/momentum/character/locator.h +94 -0
- include/momentum/character/locator_state.h +43 -0
- include/momentum/character/marker.h +48 -0
- include/momentum/character/mesh_state.h +71 -0
- include/momentum/character/parameter_limits.h +144 -0
- include/momentum/character/parameter_transform.h +207 -0
- include/momentum/character/pose_shape.h +65 -0
- include/momentum/character/skeleton.h +85 -0
- include/momentum/character/skeleton_state.h +227 -0
- include/momentum/character/skeleton_utility.h +38 -0
- include/momentum/character/skin_weights.h +67 -0
- include/momentum/character/skinned_locator.h +80 -0
- include/momentum/character/types.h +202 -0
- include/momentum/character_sequence_solver/fwd.h +200 -0
- include/momentum/character_sequence_solver/model_parameters_sequence_error_function.h +65 -0
- include/momentum/character_sequence_solver/multipose_solver.h +65 -0
- include/momentum/character_sequence_solver/multipose_solver_function.h +82 -0
- include/momentum/character_sequence_solver/sequence_error_function.h +104 -0
- include/momentum/character_sequence_solver/sequence_solver.h +155 -0
- include/momentum/character_sequence_solver/sequence_solver_function.h +158 -0
- include/momentum/character_sequence_solver/state_sequence_error_function.h +117 -0
- include/momentum/character_sequence_solver/vertex_sequence_error_function.h +123 -0
- include/momentum/character_solver/aim_error_function.h +112 -0
- include/momentum/character_solver/collision_error_function.h +92 -0
- include/momentum/character_solver/collision_error_function_stateless.h +75 -0
- include/momentum/character_solver/constraint_error_function-inl.h +324 -0
- include/momentum/character_solver/constraint_error_function.h +248 -0
- include/momentum/character_solver/distance_error_function.h +77 -0
- include/momentum/character_solver/error_function_utils.h +60 -0
- include/momentum/character_solver/fixed_axis_error_function.h +139 -0
- include/momentum/character_solver/fwd.h +943 -0
- include/momentum/character_solver/gauss_newton_solver_qr.h +64 -0
- include/momentum/character_solver/height_error_function.h +176 -0
- include/momentum/character_solver/joint_to_joint_distance_error_function.h +111 -0
- include/momentum/character_solver/limit_error_function.h +57 -0
- include/momentum/character_solver/model_parameters_error_function.h +64 -0
- include/momentum/character_solver/normal_error_function.h +73 -0
- include/momentum/character_solver/orientation_error_function.h +74 -0
- include/momentum/character_solver/plane_error_function.h +102 -0
- include/momentum/character_solver/point_triangle_vertex_error_function.h +141 -0
- include/momentum/character_solver/pose_prior_error_function.h +80 -0
- include/momentum/character_solver/position_error_function.h +75 -0
- include/momentum/character_solver/projection_error_function.h +93 -0
- include/momentum/character_solver/simd_collision_error_function.h +99 -0
- include/momentum/character_solver/simd_normal_error_function.h +157 -0
- include/momentum/character_solver/simd_plane_error_function.h +164 -0
- include/momentum/character_solver/simd_position_error_function.h +165 -0
- include/momentum/character_solver/skeleton_error_function.h +151 -0
- include/momentum/character_solver/skeleton_solver_function.h +94 -0
- include/momentum/character_solver/skinned_locator_error_function.h +166 -0
- include/momentum/character_solver/skinned_locator_triangle_error_function.h +146 -0
- include/momentum/character_solver/skinning_weight_iterator.h +80 -0
- include/momentum/character_solver/state_error_function.h +119 -0
- include/momentum/character_solver/transform_pose.h +80 -0
- include/momentum/character_solver/trust_region_qr.h +80 -0
- include/momentum/character_solver/vertex_error_function.h +155 -0
- include/momentum/character_solver/vertex_projection_error_function.h +117 -0
- include/momentum/character_solver/vertex_vertex_distance_error_function.h +147 -0
- include/momentum/common/aligned.h +155 -0
- include/momentum/common/checks.h +27 -0
- include/momentum/common/exception.h +70 -0
- include/momentum/common/filesystem.h +20 -0
- include/momentum/common/fwd.h +27 -0
- include/momentum/common/log.h +173 -0
- include/momentum/common/log_channel.h +17 -0
- include/momentum/common/memory.h +71 -0
- include/momentum/common/profile.h +79 -0
- include/momentum/common/progress_bar.h +37 -0
- include/momentum/common/string.h +52 -0
- include/momentum/diff_ik/ceres_utility.h +73 -0
- include/momentum/diff_ik/fully_differentiable_body_ik.h +58 -0
- include/momentum/diff_ik/fully_differentiable_distance_error_function.h +69 -0
- include/momentum/diff_ik/fully_differentiable_motion_error_function.h +46 -0
- include/momentum/diff_ik/fully_differentiable_orientation_error_function.h +114 -0
- include/momentum/diff_ik/fully_differentiable_pose_prior_error_function.h +76 -0
- include/momentum/diff_ik/fully_differentiable_position_error_function.h +138 -0
- include/momentum/diff_ik/fully_differentiable_projection_error_function.h +65 -0
- include/momentum/diff_ik/fully_differentiable_skeleton_error_function.h +160 -0
- include/momentum/diff_ik/fully_differentiable_state_error_function.h +54 -0
- include/momentum/diff_ik/fwd.h +385 -0
- include/momentum/diff_ik/union_error_function.h +67 -0
- include/momentum/gui/rerun/eigen_adapters.h +70 -0
- include/momentum/gui/rerun/logger.h +102 -0
- include/momentum/gui/rerun/logging_redirect.h +27 -0
- include/momentum/io/character_io.h +98 -0
- include/momentum/io/common/gsl_utils.h +50 -0
- include/momentum/io/common/stream_utils.h +65 -0
- include/momentum/io/fbx/fbx_io.h +135 -0
- include/momentum/io/fbx/fbx_memory_stream.h +70 -0
- include/momentum/io/fbx/openfbx_loader.h +62 -0
- include/momentum/io/fbx/polygon_data.h +60 -0
- include/momentum/io/file_save_options.h +107 -0
- include/momentum/io/gltf/gltf_builder.h +141 -0
- include/momentum/io/gltf/gltf_io.h +149 -0
- include/momentum/io/gltf/utils/accessor_utils.h +299 -0
- include/momentum/io/gltf/utils/coordinate_utils.h +60 -0
- include/momentum/io/gltf/utils/json_utils.h +102 -0
- include/momentum/io/legacy_json/legacy_json_io.h +70 -0
- include/momentum/io/marker/c3d_io.h +30 -0
- include/momentum/io/marker/conversions.h +57 -0
- include/momentum/io/marker/coordinate_system.h +30 -0
- include/momentum/io/marker/marker_io.h +56 -0
- include/momentum/io/marker/trc_io.h +27 -0
- include/momentum/io/motion/mmo_io.h +97 -0
- include/momentum/io/shape/blend_shape_io.h +82 -0
- include/momentum/io/shape/pose_shape_io.h +21 -0
- include/momentum/io/skeleton/locator_io.h +41 -0
- include/momentum/io/skeleton/mppca_io.h +26 -0
- include/momentum/io/skeleton/parameter_limits_io.h +38 -0
- include/momentum/io/skeleton/parameter_transform_io.h +80 -0
- include/momentum/io/skeleton/parameters_io.h +20 -0
- include/momentum/io/skeleton/utility.h +67 -0
- include/momentum/io/urdf/urdf_io.h +26 -0
- include/momentum/io/usd/usd_io.h +36 -0
- include/momentum/marker_tracking/app_utils.h +64 -0
- include/momentum/marker_tracking/marker_tracker.h +221 -0
- include/momentum/marker_tracking/process_markers.h +58 -0
- include/momentum/marker_tracking/tracker_utils.h +99 -0
- include/momentum/math/constants.h +82 -0
- include/momentum/math/covariance_matrix.h +84 -0
- include/momentum/math/fmt_eigen.h +23 -0
- include/momentum/math/fwd.h +132 -0
- include/momentum/math/generalized_loss.h +61 -0
- include/momentum/math/intersection.h +32 -0
- include/momentum/math/mesh.h +84 -0
- include/momentum/math/mppca.h +67 -0
- include/momentum/math/online_householder_qr.h +516 -0
- include/momentum/math/random-inl.h +404 -0
- include/momentum/math/random.h +310 -0
- include/momentum/math/simd_generalized_loss.h +40 -0
- include/momentum/math/transform.h +229 -0
- include/momentum/math/types.h +461 -0
- include/momentum/math/utility.h +324 -0
- include/momentum/rasterizer/camera.h +453 -0
- include/momentum/rasterizer/fwd.h +102 -0
- include/momentum/rasterizer/geometry.h +83 -0
- include/momentum/rasterizer/image.h +18 -0
- include/momentum/rasterizer/rasterizer.h +583 -0
- include/momentum/rasterizer/tensor.h +140 -0
- include/momentum/rasterizer/text_rasterizer.h +89 -0
- include/momentum/rasterizer/utility.h +268 -0
- include/momentum/simd/simd.h +221 -0
- include/momentum/solver/fwd.h +131 -0
- include/momentum/solver/gauss_newton_solver.h +136 -0
- include/momentum/solver/gradient_descent_solver.h +65 -0
- include/momentum/solver/solver.h +155 -0
- include/momentum/solver/solver_function.h +126 -0
- include/momentum/solver/subset_gauss_newton_solver.h +109 -0
- include/rerun/archetypes/annotation_context.hpp +157 -0
- include/rerun/archetypes/arrows2d.hpp +271 -0
- include/rerun/archetypes/arrows3d.hpp +257 -0
- include/rerun/archetypes/asset3d.hpp +262 -0
- include/rerun/archetypes/asset_video.hpp +275 -0
- include/rerun/archetypes/bar_chart.hpp +261 -0
- include/rerun/archetypes/boxes2d.hpp +293 -0
- include/rerun/archetypes/boxes3d.hpp +369 -0
- include/rerun/archetypes/capsules3d.hpp +333 -0
- include/rerun/archetypes/clear.hpp +180 -0
- include/rerun/archetypes/depth_image.hpp +425 -0
- include/rerun/archetypes/ellipsoids3d.hpp +384 -0
- include/rerun/archetypes/encoded_image.hpp +250 -0
- include/rerun/archetypes/geo_line_strings.hpp +166 -0
- include/rerun/archetypes/geo_points.hpp +177 -0
- include/rerun/archetypes/graph_edges.hpp +152 -0
- include/rerun/archetypes/graph_nodes.hpp +206 -0
- include/rerun/archetypes/image.hpp +434 -0
- include/rerun/archetypes/instance_poses3d.hpp +221 -0
- include/rerun/archetypes/line_strips2d.hpp +289 -0
- include/rerun/archetypes/line_strips3d.hpp +270 -0
- include/rerun/archetypes/mesh3d.hpp +387 -0
- include/rerun/archetypes/pinhole.hpp +385 -0
- include/rerun/archetypes/points2d.hpp +333 -0
- include/rerun/archetypes/points3d.hpp +369 -0
- include/rerun/archetypes/recording_properties.hpp +132 -0
- include/rerun/archetypes/scalar.hpp +170 -0
- include/rerun/archetypes/scalars.hpp +153 -0
- include/rerun/archetypes/segmentation_image.hpp +305 -0
- include/rerun/archetypes/series_line.hpp +274 -0
- include/rerun/archetypes/series_lines.hpp +271 -0
- include/rerun/archetypes/series_point.hpp +265 -0
- include/rerun/archetypes/series_points.hpp +251 -0
- include/rerun/archetypes/tensor.hpp +213 -0
- include/rerun/archetypes/text_document.hpp +200 -0
- include/rerun/archetypes/text_log.hpp +211 -0
- include/rerun/archetypes/transform3d.hpp +925 -0
- include/rerun/archetypes/video_frame_reference.hpp +295 -0
- include/rerun/archetypes/view_coordinates.hpp +393 -0
- include/rerun/archetypes.hpp +43 -0
- include/rerun/arrow_utils.hpp +32 -0
- include/rerun/as_components.hpp +90 -0
- include/rerun/blueprint/archetypes/background.hpp +113 -0
- include/rerun/blueprint/archetypes/container_blueprint.hpp +259 -0
- include/rerun/blueprint/archetypes/dataframe_query.hpp +178 -0
- include/rerun/blueprint/archetypes/entity_behavior.hpp +130 -0
- include/rerun/blueprint/archetypes/force_center.hpp +115 -0
- include/rerun/blueprint/archetypes/force_collision_radius.hpp +141 -0
- include/rerun/blueprint/archetypes/force_link.hpp +136 -0
- include/rerun/blueprint/archetypes/force_many_body.hpp +124 -0
- include/rerun/blueprint/archetypes/force_position.hpp +132 -0
- include/rerun/blueprint/archetypes/line_grid3d.hpp +178 -0
- include/rerun/blueprint/archetypes/map_background.hpp +104 -0
- include/rerun/blueprint/archetypes/map_zoom.hpp +103 -0
- include/rerun/blueprint/archetypes/near_clip_plane.hpp +109 -0
- include/rerun/blueprint/archetypes/panel_blueprint.hpp +95 -0
- include/rerun/blueprint/archetypes/plot_legend.hpp +118 -0
- include/rerun/blueprint/archetypes/scalar_axis.hpp +116 -0
- include/rerun/blueprint/archetypes/tensor_scalar_mapping.hpp +146 -0
- include/rerun/blueprint/archetypes/tensor_slice_selection.hpp +167 -0
- include/rerun/blueprint/archetypes/tensor_view_fit.hpp +95 -0
- include/rerun/blueprint/archetypes/view_blueprint.hpp +170 -0
- include/rerun/blueprint/archetypes/view_contents.hpp +142 -0
- include/rerun/blueprint/archetypes/viewport_blueprint.hpp +200 -0
- include/rerun/blueprint/archetypes/visible_time_ranges.hpp +116 -0
- include/rerun/blueprint/archetypes/visual_bounds2d.hpp +109 -0
- include/rerun/blueprint/archetypes/visualizer_overrides.hpp +113 -0
- include/rerun/blueprint/archetypes.hpp +29 -0
- include/rerun/blueprint/components/active_tab.hpp +82 -0
- include/rerun/blueprint/components/apply_latest_at.hpp +79 -0
- include/rerun/blueprint/components/auto_layout.hpp +77 -0
- include/rerun/blueprint/components/auto_views.hpp +77 -0
- include/rerun/blueprint/components/background_kind.hpp +66 -0
- include/rerun/blueprint/components/column_share.hpp +78 -0
- include/rerun/blueprint/components/component_column_selector.hpp +81 -0
- include/rerun/blueprint/components/container_kind.hpp +65 -0
- include/rerun/blueprint/components/corner2d.hpp +64 -0
- include/rerun/blueprint/components/enabled.hpp +77 -0
- include/rerun/blueprint/components/filter_by_range.hpp +74 -0
- include/rerun/blueprint/components/filter_is_not_null.hpp +77 -0
- include/rerun/blueprint/components/force_distance.hpp +82 -0
- include/rerun/blueprint/components/force_iterations.hpp +82 -0
- include/rerun/blueprint/components/force_strength.hpp +82 -0
- include/rerun/blueprint/components/grid_columns.hpp +78 -0
- include/rerun/blueprint/components/grid_spacing.hpp +78 -0
- include/rerun/blueprint/components/included_content.hpp +86 -0
- include/rerun/blueprint/components/lock_range_during_zoom.hpp +82 -0
- include/rerun/blueprint/components/map_provider.hpp +64 -0
- include/rerun/blueprint/components/near_clip_plane.hpp +82 -0
- include/rerun/blueprint/components/panel_state.hpp +61 -0
- include/rerun/blueprint/components/query_expression.hpp +89 -0
- include/rerun/blueprint/components/root_container.hpp +77 -0
- include/rerun/blueprint/components/row_share.hpp +78 -0
- include/rerun/blueprint/components/selected_columns.hpp +76 -0
- include/rerun/blueprint/components/tensor_dimension_index_slider.hpp +90 -0
- include/rerun/blueprint/components/timeline_name.hpp +76 -0
- include/rerun/blueprint/components/view_class.hpp +76 -0
- include/rerun/blueprint/components/view_fit.hpp +61 -0
- include/rerun/blueprint/components/view_maximized.hpp +79 -0
- include/rerun/blueprint/components/view_origin.hpp +81 -0
- include/rerun/blueprint/components/viewer_recommendation_hash.hpp +82 -0
- include/rerun/blueprint/components/visible_time_range.hpp +77 -0
- include/rerun/blueprint/components/visual_bounds2d.hpp +74 -0
- include/rerun/blueprint/components/visualizer_override.hpp +86 -0
- include/rerun/blueprint/components/zoom_level.hpp +78 -0
- include/rerun/blueprint/components.hpp +41 -0
- include/rerun/blueprint/datatypes/component_column_selector.hpp +61 -0
- include/rerun/blueprint/datatypes/filter_by_range.hpp +59 -0
- include/rerun/blueprint/datatypes/filter_is_not_null.hpp +61 -0
- include/rerun/blueprint/datatypes/selected_columns.hpp +62 -0
- include/rerun/blueprint/datatypes/tensor_dimension_index_slider.hpp +63 -0
- include/rerun/blueprint/datatypes.hpp +9 -0
- include/rerun/c/arrow_c_data_interface.h +111 -0
- include/rerun/c/compiler_utils.h +10 -0
- include/rerun/c/rerun.h +627 -0
- include/rerun/c/sdk_info.h +28 -0
- include/rerun/collection.hpp +496 -0
- include/rerun/collection_adapter.hpp +43 -0
- include/rerun/collection_adapter_builtins.hpp +138 -0
- include/rerun/compiler_utils.hpp +61 -0
- include/rerun/component_batch.hpp +163 -0
- include/rerun/component_column.hpp +111 -0
- include/rerun/component_descriptor.hpp +142 -0
- include/rerun/component_type.hpp +35 -0
- include/rerun/components/aggregation_policy.hpp +76 -0
- include/rerun/components/albedo_factor.hpp +74 -0
- include/rerun/components/annotation_context.hpp +102 -0
- include/rerun/components/axis_length.hpp +74 -0
- include/rerun/components/blob.hpp +73 -0
- include/rerun/components/class_id.hpp +71 -0
- include/rerun/components/clear_is_recursive.hpp +75 -0
- include/rerun/components/color.hpp +99 -0
- include/rerun/components/colormap.hpp +99 -0
- include/rerun/components/depth_meter.hpp +84 -0
- include/rerun/components/draw_order.hpp +79 -0
- include/rerun/components/entity_path.hpp +83 -0
- include/rerun/components/fill_mode.hpp +72 -0
- include/rerun/components/fill_ratio.hpp +79 -0
- include/rerun/components/gamma_correction.hpp +80 -0
- include/rerun/components/geo_line_string.hpp +63 -0
- include/rerun/components/graph_edge.hpp +75 -0
- include/rerun/components/graph_node.hpp +79 -0
- include/rerun/components/graph_type.hpp +57 -0
- include/rerun/components/half_size2d.hpp +91 -0
- include/rerun/components/half_size3d.hpp +95 -0
- include/rerun/components/image_buffer.hpp +86 -0
- include/rerun/components/image_format.hpp +84 -0
- include/rerun/components/image_plane_distance.hpp +77 -0
- include/rerun/components/interactive.hpp +76 -0
- include/rerun/components/keypoint_id.hpp +74 -0
- include/rerun/components/lat_lon.hpp +89 -0
- include/rerun/components/length.hpp +77 -0
- include/rerun/components/line_strip2d.hpp +73 -0
- include/rerun/components/line_strip3d.hpp +73 -0
- include/rerun/components/magnification_filter.hpp +63 -0
- include/rerun/components/marker_shape.hpp +82 -0
- include/rerun/components/marker_size.hpp +74 -0
- include/rerun/components/media_type.hpp +157 -0
- include/rerun/components/name.hpp +83 -0
- include/rerun/components/opacity.hpp +77 -0
- include/rerun/components/pinhole_projection.hpp +94 -0
- include/rerun/components/plane3d.hpp +75 -0
- include/rerun/components/pose_rotation_axis_angle.hpp +73 -0
- include/rerun/components/pose_rotation_quat.hpp +71 -0
- include/rerun/components/pose_scale3d.hpp +102 -0
- include/rerun/components/pose_transform_mat3x3.hpp +87 -0
- include/rerun/components/pose_translation3d.hpp +96 -0
- include/rerun/components/position2d.hpp +86 -0
- include/rerun/components/position3d.hpp +90 -0
- include/rerun/components/radius.hpp +98 -0
- include/rerun/components/range1d.hpp +75 -0
- include/rerun/components/resolution.hpp +88 -0
- include/rerun/components/rotation_axis_angle.hpp +72 -0
- include/rerun/components/rotation_quat.hpp +71 -0
- include/rerun/components/scalar.hpp +76 -0
- include/rerun/components/scale3d.hpp +102 -0
- include/rerun/components/series_visible.hpp +76 -0
- include/rerun/components/show_labels.hpp +79 -0
- include/rerun/components/stroke_width.hpp +74 -0
- include/rerun/components/tensor_data.hpp +94 -0
- include/rerun/components/tensor_dimension_index_selection.hpp +77 -0
- include/rerun/components/tensor_height_dimension.hpp +71 -0
- include/rerun/components/tensor_width_dimension.hpp +71 -0
- include/rerun/components/texcoord2d.hpp +101 -0
- include/rerun/components/text.hpp +83 -0
- include/rerun/components/text_log_level.hpp +110 -0
- include/rerun/components/timestamp.hpp +76 -0
- include/rerun/components/transform_mat3x3.hpp +92 -0
- include/rerun/components/transform_relation.hpp +66 -0
- include/rerun/components/translation3d.hpp +96 -0
- include/rerun/components/triangle_indices.hpp +85 -0
- include/rerun/components/value_range.hpp +78 -0
- include/rerun/components/vector2d.hpp +92 -0
- include/rerun/components/vector3d.hpp +96 -0
- include/rerun/components/video_timestamp.hpp +120 -0
- include/rerun/components/view_coordinates.hpp +346 -0
- include/rerun/components/visible.hpp +74 -0
- include/rerun/components.hpp +77 -0
- include/rerun/config.hpp +52 -0
- include/rerun/datatypes/angle.hpp +76 -0
- include/rerun/datatypes/annotation_info.hpp +76 -0
- include/rerun/datatypes/blob.hpp +67 -0
- include/rerun/datatypes/bool.hpp +57 -0
- include/rerun/datatypes/channel_datatype.hpp +87 -0
- include/rerun/datatypes/class_description.hpp +92 -0
- include/rerun/datatypes/class_description_map_elem.hpp +69 -0
- include/rerun/datatypes/class_id.hpp +62 -0
- include/rerun/datatypes/color_model.hpp +68 -0
- include/rerun/datatypes/dvec2d.hpp +76 -0
- include/rerun/datatypes/entity_path.hpp +60 -0
- include/rerun/datatypes/float32.hpp +62 -0
- include/rerun/datatypes/float64.hpp +62 -0
- include/rerun/datatypes/image_format.hpp +107 -0
- include/rerun/datatypes/keypoint_id.hpp +63 -0
- include/rerun/datatypes/keypoint_pair.hpp +65 -0
- include/rerun/datatypes/mat3x3.hpp +105 -0
- include/rerun/datatypes/mat4x4.hpp +119 -0
- include/rerun/datatypes/pixel_format.hpp +142 -0
- include/rerun/datatypes/plane3d.hpp +60 -0
- include/rerun/datatypes/quaternion.hpp +110 -0
- include/rerun/datatypes/range1d.hpp +59 -0
- include/rerun/datatypes/range2d.hpp +55 -0
- include/rerun/datatypes/rgba32.hpp +94 -0
- include/rerun/datatypes/rotation_axis_angle.hpp +67 -0
- include/rerun/datatypes/tensor_buffer.hpp +529 -0
- include/rerun/datatypes/tensor_data.hpp +100 -0
- include/rerun/datatypes/tensor_dimension_index_selection.hpp +58 -0
- include/rerun/datatypes/tensor_dimension_selection.hpp +56 -0
- include/rerun/datatypes/time_int.hpp +62 -0
- include/rerun/datatypes/time_range.hpp +55 -0
- include/rerun/datatypes/time_range_boundary.hpp +175 -0
- include/rerun/datatypes/uint16.hpp +62 -0
- include/rerun/datatypes/uint32.hpp +62 -0
- include/rerun/datatypes/uint64.hpp +62 -0
- include/rerun/datatypes/utf8.hpp +76 -0
- include/rerun/datatypes/utf8pair.hpp +62 -0
- include/rerun/datatypes/uuid.hpp +60 -0
- include/rerun/datatypes/uvec2d.hpp +76 -0
- include/rerun/datatypes/uvec3d.hpp +80 -0
- include/rerun/datatypes/uvec4d.hpp +59 -0
- include/rerun/datatypes/vec2d.hpp +76 -0
- include/rerun/datatypes/vec3d.hpp +80 -0
- include/rerun/datatypes/vec4d.hpp +84 -0
- include/rerun/datatypes/video_timestamp.hpp +67 -0
- include/rerun/datatypes/view_coordinates.hpp +87 -0
- include/rerun/datatypes/visible_time_range.hpp +57 -0
- include/rerun/datatypes.hpp +51 -0
- include/rerun/demo_utils.hpp +75 -0
- include/rerun/entity_path.hpp +20 -0
- include/rerun/error.hpp +180 -0
- include/rerun/half.hpp +10 -0
- include/rerun/image_utils.hpp +187 -0
- include/rerun/indicator_component.hpp +59 -0
- include/rerun/loggable.hpp +54 -0
- include/rerun/recording_stream.hpp +960 -0
- include/rerun/rerun_sdk_export.hpp +25 -0
- include/rerun/result.hpp +86 -0
- include/rerun/rotation3d.hpp +33 -0
- include/rerun/sdk_info.hpp +20 -0
- include/rerun/spawn.hpp +21 -0
- include/rerun/spawn_options.hpp +57 -0
- include/rerun/string_utils.hpp +16 -0
- include/rerun/third_party/cxxopts.hpp +2198 -0
- include/rerun/time_column.hpp +288 -0
- include/rerun/timeline.hpp +38 -0
- include/rerun/type_traits.hpp +40 -0
- include/rerun.hpp +86 -0
- lib/cmake/axel/axel-config.cmake +45 -0
- lib/cmake/axel/axelTargets-release.cmake +19 -0
- lib/cmake/axel/axelTargets.cmake +108 -0
- lib/cmake/momentum/FindFbxSdk.cmake +115 -0
- lib/cmake/momentum/Findre2.cmake +52 -0
- lib/cmake/momentum/momentum-config.cmake +67 -0
- lib/cmake/momentum/momentumTargets-release.cmake +259 -0
- lib/cmake/momentum/momentumTargets.cmake +385 -0
- lib/cmake/rerun_sdk/rerun_sdkConfig.cmake +70 -0
- lib/cmake/rerun_sdk/rerun_sdkConfigVersion.cmake +83 -0
- lib/cmake/rerun_sdk/rerun_sdkTargets-release.cmake +19 -0
- lib/cmake/rerun_sdk/rerun_sdkTargets.cmake +108 -0
- lib/libarrow.a +0 -0
- lib/libarrow_bundled_dependencies.a +0 -0
- lib/libaxel.a +0 -0
- lib/libmomentum_app_utils.a +0 -0
- lib/libmomentum_character.a +0 -0
- lib/libmomentum_character_sequence_solver.a +0 -0
- lib/libmomentum_character_solver.a +0 -0
- lib/libmomentum_common.a +0 -0
- lib/libmomentum_diff_ik.a +0 -0
- lib/libmomentum_io.a +0 -0
- lib/libmomentum_io_common.a +0 -0
- lib/libmomentum_io_fbx.a +0 -0
- lib/libmomentum_io_gltf.a +0 -0
- lib/libmomentum_io_legacy_json.a +0 -0
- lib/libmomentum_io_marker.a +0 -0
- lib/libmomentum_io_motion.a +0 -0
- lib/libmomentum_io_shape.a +0 -0
- lib/libmomentum_io_skeleton.a +0 -0
- lib/libmomentum_io_urdf.a +0 -0
- lib/libmomentum_marker_tracker.a +0 -0
- lib/libmomentum_math.a +0 -0
- lib/libmomentum_online_qr.a +0 -0
- lib/libmomentum_process_markers.a +0 -0
- lib/libmomentum_rerun.a +0 -0
- lib/libmomentum_simd_constraints.a +0 -0
- lib/libmomentum_simd_generalized_loss.a +0 -0
- lib/libmomentum_skeleton.a +0 -0
- lib/libmomentum_solver.a +0 -0
- lib/librerun_c__macos_arm64.a +0 -0
- lib/librerun_sdk.a +0 -0
- pymomentum/axel.cpython-312-darwin.so +0 -0
- pymomentum/backend/__init__.py +16 -0
- pymomentum/backend/skel_state_backend.py +631 -0
- pymomentum/backend/trs_backend.py +889 -0
- pymomentum/backend/utils.py +224 -0
- pymomentum/geometry.cpython-312-darwin.so +0 -0
- pymomentum/marker_tracking.cpython-312-darwin.so +0 -0
- pymomentum/quaternion.py +740 -0
- pymomentum/skel_state.py +514 -0
- pymomentum/solver.cpython-312-darwin.so +0 -0
- pymomentum/solver2.cpython-312-darwin.so +0 -0
- pymomentum/torch/character.py +868 -0
- pymomentum/torch/parameter_limits.py +494 -0
- pymomentum/torch/utility.py +20 -0
- pymomentum/trs.py +535 -0
- pymomentum_cpu-0.1.93.post0.dist-info/METADATA +126 -0
- pymomentum_cpu-0.1.93.post0.dist-info/RECORD +517 -0
- pymomentum_cpu-0.1.93.post0.dist-info/WHEEL +5 -0
- pymomentum_cpu-0.1.93.post0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <drjit/array.h>
|
|
11
|
+
#include <drjit/fwd.h>
|
|
12
|
+
#include <drjit/matrix.h>
|
|
13
|
+
|
|
14
|
+
#include <momentum/rasterizer/fwd.h>
|
|
15
|
+
#include <Eigen/Core>
|
|
16
|
+
#include <Eigen/Geometry>
|
|
17
|
+
#include <memory>
|
|
18
|
+
|
|
19
|
+
namespace momentum::rasterizer {
|
|
20
|
+
|
|
21
|
+
/// Base class for camera intrinsics models.
|
|
22
|
+
/// This abstract class defines the interface for different camera models
|
|
23
|
+
/// such as pinhole and OpenCV distortion models.
|
|
24
|
+
template <typename T>
|
|
25
|
+
class IntrinsicsModelT {
|
|
26
|
+
public:
|
|
27
|
+
/// Constructor for intrinsics model.
|
|
28
|
+
/// @param imageWidth Width of the image in pixels
|
|
29
|
+
/// @param imageHeight Height of the image in pixels
|
|
30
|
+
IntrinsicsModelT(int32_t imageWidth, int32_t imageHeight)
|
|
31
|
+
: imageWidth_(imageWidth), imageHeight_(imageHeight) {}
|
|
32
|
+
virtual ~IntrinsicsModelT() = default;
|
|
33
|
+
|
|
34
|
+
/// Get the focal length in the x direction.
|
|
35
|
+
/// @return Focal length fx in pixels
|
|
36
|
+
[[nodiscard]] virtual T fx() const = 0;
|
|
37
|
+
|
|
38
|
+
/// Get the focal length in the y direction.
|
|
39
|
+
/// @return Focal length fy in pixels
|
|
40
|
+
[[nodiscard]] virtual T fy() const = 0;
|
|
41
|
+
|
|
42
|
+
/// Project 3D points to 2D image coordinates.
|
|
43
|
+
/// @param point 3D points in camera coordinate space
|
|
44
|
+
/// @return Pair of projected 2D points and validity mask
|
|
45
|
+
[[nodiscard]] virtual std::pair<Vector3xP<T>, typename PacketType_t<T>::MaskType> project(
|
|
46
|
+
const Vector3xP<T>& point) const = 0;
|
|
47
|
+
|
|
48
|
+
/// Project a single 3D point to 2D image coordinates (Eigen version).
|
|
49
|
+
/// @param point 3D point in camera coordinate space
|
|
50
|
+
/// @return Pair of projected 2D point and validity flag
|
|
51
|
+
[[nodiscard]] virtual std::pair<Eigen::Vector3<T>, bool> project(
|
|
52
|
+
const Eigen::Vector3<T>& point) const = 0;
|
|
53
|
+
|
|
54
|
+
/// Compute the Jacobian of the projection function with respect to 3D camera coordinates.
|
|
55
|
+
/// @param point 3D point in camera coordinate space
|
|
56
|
+
/// @return Tuple of (projected point, Jacobian matrix, valid flag)
|
|
57
|
+
/// The Jacobian is a 3x3 matrix where:
|
|
58
|
+
/// - Row 0: [du/dx, du/dy, du/dz]
|
|
59
|
+
/// - Row 1: [dv/dx, dv/dy, dv/dz]
|
|
60
|
+
/// - Row 2: [0, 0, 1] (for homogeneous coordinates)
|
|
61
|
+
[[nodiscard]] virtual std::tuple<Eigen::Vector3<T>, Eigen::Matrix<T, 3, 3>, bool> projectJacobian(
|
|
62
|
+
const Eigen::Vector3<T>& point) const = 0;
|
|
63
|
+
|
|
64
|
+
/// Unproject 3D image points to 3D camera points using Newton's method.
|
|
65
|
+
/// @param imagePoint 3D point in image coordinates (u, v, z) where z is the desired depth
|
|
66
|
+
/// @param maxIterations Maximum number of Newton iterations (default: 10)
|
|
67
|
+
/// @param tolerance Convergence tolerance for the residual (default: 1e-6)
|
|
68
|
+
/// @return Pair of 3D point in camera coordinates and validity flag
|
|
69
|
+
[[nodiscard]] virtual std::pair<Eigen::Vector3<T>, bool> unproject(
|
|
70
|
+
const Eigen::Vector3<T>& imagePoint,
|
|
71
|
+
int maxIterations = 10,
|
|
72
|
+
T tolerance = T(1e-6)) const = 0;
|
|
73
|
+
|
|
74
|
+
/// Resample the intrinsics by a given factor.
|
|
75
|
+
/// @param factor Resampling factor (>1 for upsampling, <1 for downsampling)
|
|
76
|
+
/// @return New intrinsics model with resampled parameters
|
|
77
|
+
[[nodiscard]] std::shared_ptr<const IntrinsicsModelT<T>> resample(T factor) const;
|
|
78
|
+
|
|
79
|
+
/// Downsample the intrinsics by a given factor.
|
|
80
|
+
/// @param factor Downsampling factor (e.g., 2.0 halves the resolution)
|
|
81
|
+
/// @return New intrinsics model with downsampled parameters
|
|
82
|
+
[[nodiscard]] std::shared_ptr<const IntrinsicsModelT<T>> downsample(T factor) const;
|
|
83
|
+
|
|
84
|
+
/// Upsample the intrinsics by a given factor.
|
|
85
|
+
/// @param factor Upsampling factor (e.g., 2.0 doubles the resolution)
|
|
86
|
+
/// @return New intrinsics model with upsampled parameters
|
|
87
|
+
[[nodiscard]] std::shared_ptr<const IntrinsicsModelT<T>> upsample(T factor) const;
|
|
88
|
+
|
|
89
|
+
/// Resize the intrinsics to new image dimensions.
|
|
90
|
+
/// @param imageWidth New image width in pixels
|
|
91
|
+
/// @param imageHeight New image height in pixels
|
|
92
|
+
/// @return New intrinsics model with resized parameters
|
|
93
|
+
[[nodiscard]] virtual std::shared_ptr<const IntrinsicsModelT<T>> resize(
|
|
94
|
+
int32_t imageWidth,
|
|
95
|
+
int32_t imageHeight) const = 0;
|
|
96
|
+
|
|
97
|
+
/// Crop the intrinsics to a sub-region of the image.
|
|
98
|
+
/// @param top Top offset in pixels
|
|
99
|
+
/// @param left Left offset in pixels
|
|
100
|
+
/// @param newWidth New width in pixels after cropping
|
|
101
|
+
/// @param newHeight New height in pixels after cropping
|
|
102
|
+
/// @return New intrinsics model with cropped parameters
|
|
103
|
+
[[nodiscard]] virtual std::shared_ptr<const IntrinsicsModelT<T>>
|
|
104
|
+
crop(int32_t top, int32_t left, int32_t newWidth, int32_t newHeight) const = 0;
|
|
105
|
+
|
|
106
|
+
/// Get the image width.
|
|
107
|
+
/// @return Image width in pixels
|
|
108
|
+
[[nodiscard]] int32_t imageWidth() const {
|
|
109
|
+
return imageWidth_;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/// Get the image height.
|
|
113
|
+
/// @return Image height in pixels
|
|
114
|
+
[[nodiscard]] int32_t imageHeight() const {
|
|
115
|
+
return imageHeight_;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private:
|
|
119
|
+
int32_t imageWidth_ = 640;
|
|
120
|
+
int32_t imageHeight_ = 480;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/// Camera class that combines intrinsics and extrinsics for 3D rendering.
|
|
124
|
+
/// This class encapsulates both the camera's intrinsic parameters (focal length,
|
|
125
|
+
/// principal point, image dimensions) and extrinsic parameters (position and orientation).
|
|
126
|
+
template <typename T>
|
|
127
|
+
class CameraT {
|
|
128
|
+
public:
|
|
129
|
+
/// Default constructor creates a camera with identity transform.
|
|
130
|
+
CameraT();
|
|
131
|
+
|
|
132
|
+
/// Constructor with intrinsics model and optional transform.
|
|
133
|
+
/// @param intrinsicsModel Shared pointer to the camera's intrinsics model
|
|
134
|
+
/// @param eyeFromWorld Transform from world space to camera/eye space (defaults to identity)
|
|
135
|
+
explicit CameraT(
|
|
136
|
+
std::shared_ptr<const IntrinsicsModelT<T>> intrinsicsModel,
|
|
137
|
+
const Eigen::Transform<T, 3, Eigen::Affine>& eyeFromWorld =
|
|
138
|
+
Eigen::Transform<T, 3, Eigen::Affine>::Identity());
|
|
139
|
+
|
|
140
|
+
/// Get the image width from the intrinsics model.
|
|
141
|
+
/// @return Image width in pixels
|
|
142
|
+
[[nodiscard]] auto imageWidth() const {
|
|
143
|
+
return intrinsicsModel_->imageWidth();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/// Get the image height from the intrinsics model.
|
|
147
|
+
/// @return Image height in pixels
|
|
148
|
+
[[nodiscard]] auto imageHeight() const {
|
|
149
|
+
return intrinsicsModel_->imageHeight();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/// Get the focal length in x direction from the intrinsics model.
|
|
153
|
+
/// @return Focal length fx in pixels
|
|
154
|
+
[[nodiscard]] auto fx() const {
|
|
155
|
+
return intrinsicsModel_->fx();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/// Get the focal length in y direction from the intrinsics model.
|
|
159
|
+
/// @return Focal length fy in pixels
|
|
160
|
+
[[nodiscard]] auto fy() const {
|
|
161
|
+
return intrinsicsModel_->fy();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/// Get the intrinsics model.
|
|
165
|
+
/// @return Shared pointer to the intrinsics model
|
|
166
|
+
[[nodiscard]] std::shared_ptr<const IntrinsicsModelT<T>> intrinsicsModel() const {
|
|
167
|
+
return intrinsicsModel_;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/// Get the eye-from-world transformation matrix.
|
|
171
|
+
/// @return Reference to the transformation from world space to camera space
|
|
172
|
+
[[nodiscard]] const Eigen::Transform<T, 3, Eigen::Affine>& eyeFromWorld() const {
|
|
173
|
+
return eyeFromWorld_;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/// Get the world-from-eye transformation matrix.
|
|
177
|
+
/// @return Transformation from camera space to world space
|
|
178
|
+
[[nodiscard]] Eigen::Transform<T, 3, Eigen::Affine> worldFromEye() const {
|
|
179
|
+
return eyeFromWorld_.inverse();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/// Set the eye-from-world transformation matrix.
|
|
183
|
+
/// @param eyeFromWorld New transformation from world space to camera space
|
|
184
|
+
void setEyeFromWorld(const Eigen::Transform<T, 3, Eigen::Affine>& eyeFromWorld) {
|
|
185
|
+
eyeFromWorld_ = eyeFromWorld;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/// Position the camera to look at a specific target point.
|
|
189
|
+
///
|
|
190
|
+
/// @param position The position of the camera in world space
|
|
191
|
+
/// @param target The target point to look at in world space
|
|
192
|
+
/// @param up The up vector in world space (default is Y-up)
|
|
193
|
+
/// @return A new camera with the updated transform
|
|
194
|
+
[[nodiscard]] CameraT<T> lookAt(
|
|
195
|
+
const Eigen::Vector3<T>& position,
|
|
196
|
+
const Eigen::Vector3<T>& target = Eigen::Vector3<T>::Zero(),
|
|
197
|
+
const Eigen::Vector3<T>& up = Eigen::Vector3<T>::UnitY()) const;
|
|
198
|
+
|
|
199
|
+
/// Adjust the camera position to ensure all specified points are in view.
|
|
200
|
+
/// This preserves the camera's orientation but adjusts its position.
|
|
201
|
+
///
|
|
202
|
+
/// @param points The 3D points in world space that should be in view
|
|
203
|
+
/// @param minZ The minimum Z distance from the camera
|
|
204
|
+
/// @param edgePadding Padding from the edge of the frame (0.0-1.0)
|
|
205
|
+
/// @return A new camera with the updated transform
|
|
206
|
+
[[nodiscard]] CameraT<T> framePoints(
|
|
207
|
+
const std::vector<Eigen::Vector3<T>>& points,
|
|
208
|
+
T minZ = T(0.1),
|
|
209
|
+
T edgePadding = T(0.05)) const;
|
|
210
|
+
|
|
211
|
+
/// Project 3D world points to 2D image coordinates.
|
|
212
|
+
/// @param worldPoints 3D points in world coordinate space (wide vector)
|
|
213
|
+
/// @return Pair of projected 2D points and validity mask
|
|
214
|
+
[[nodiscard]] std::pair<Vector3xP<T>, typename PacketType_t<T>::MaskType> project(
|
|
215
|
+
const Vector3xP<T>& worldPoints) const;
|
|
216
|
+
|
|
217
|
+
/// Project a single 3D world point to 2D image coordinates (Eigen version).
|
|
218
|
+
/// @param worldPoint 3D point in world coordinate space
|
|
219
|
+
/// @return Pair of projected 2D point and validity flag
|
|
220
|
+
[[nodiscard]] std::pair<Eigen::Vector3<T>, bool> project(
|
|
221
|
+
const Eigen::Vector3<T>& worldPoint) const;
|
|
222
|
+
|
|
223
|
+
/// Compute the Jacobian of the projection function with respect to 3D world coordinates.
|
|
224
|
+
/// @param worldPoint 3D point in world coordinate space
|
|
225
|
+
/// @return Tuple of (projected point, Jacobian matrix, valid flag)
|
|
226
|
+
/// The Jacobian is a 2x3 matrix where:
|
|
227
|
+
/// - Row 0: [du/dX_world, du/dY_world, du/dZ_world]
|
|
228
|
+
/// - Row 1: [dv/dX_world, dv/dY_world, dv/dZ_world]
|
|
229
|
+
[[nodiscard]] std::tuple<Eigen::Vector3<T>, Eigen::Matrix<T, 2, 3>, bool> projectJacobian(
|
|
230
|
+
const Eigen::Vector3<T>& worldPoint) const;
|
|
231
|
+
|
|
232
|
+
/// Unproject 3D image points to 3D world points using Newton's method.
|
|
233
|
+
/// @param imagePoints 3D points in image coordinates (u, v, z) where z is the desired depth (wide
|
|
234
|
+
/// vector)
|
|
235
|
+
/// @param maxIterations Maximum number of Newton iterations (default: 10)
|
|
236
|
+
/// @param tolerance Convergence tolerance for the residual (default: 1e-6)
|
|
237
|
+
/// @return Pair of 3D points in world coordinates and validity mask
|
|
238
|
+
[[nodiscard]] std::pair<Vector3xP<T>, typename PacketType_t<T>::MaskType>
|
|
239
|
+
unproject(const Vector3xP<T>& imagePoints, int maxIterations = 10, T tolerance = T(1e-6)) const;
|
|
240
|
+
|
|
241
|
+
/// Unproject 3D image point to 3D world point using Newton's method (Eigen version).
|
|
242
|
+
/// @param imagePoint 3D point in image coordinates (u, v, z) where z is the desired depth
|
|
243
|
+
/// @param maxIterations Maximum number of Newton iterations (default: 10)
|
|
244
|
+
/// @param tolerance Convergence tolerance for the residual (default: 1e-6)
|
|
245
|
+
/// @return Pair of 3D point in world coordinates and validity flag
|
|
246
|
+
[[nodiscard]] std::pair<Eigen::Vector3<T>, bool> unproject(
|
|
247
|
+
const Eigen::Vector3<T>& imagePoint,
|
|
248
|
+
int maxIterations = 10,
|
|
249
|
+
T tolerance = T(1e-6)) const;
|
|
250
|
+
|
|
251
|
+
/// Create a cropped camera with a sub-region of the original image.
|
|
252
|
+
/// @param top Top offset in pixels
|
|
253
|
+
/// @param left Left offset in pixels
|
|
254
|
+
/// @param newWidth New width in pixels after cropping
|
|
255
|
+
/// @param newHeight New height in pixels after cropping
|
|
256
|
+
/// @return New camera with cropped intrinsics and same pose
|
|
257
|
+
[[nodiscard]] CameraT<T> crop(int32_t top, int32_t left, int32_t newWidth, int32_t newHeight)
|
|
258
|
+
const {
|
|
259
|
+
return CameraT<T>(intrinsicsModel_->crop(top, left, newWidth, newHeight), eyeFromWorld_);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/// Create a resized camera with new image dimensions.
|
|
263
|
+
/// @param imageWidth New image width in pixels
|
|
264
|
+
/// @param imageHeight New image height in pixels
|
|
265
|
+
/// @return New camera with resized intrinsics and same pose
|
|
266
|
+
[[nodiscard]] CameraT<T> resize(int32_t imageWidth, int32_t imageHeight) const {
|
|
267
|
+
return CameraT<T>(intrinsicsModel_->resize(imageWidth, imageHeight), eyeFromWorld_);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
[[nodiscard]] const IntrinsicsModelT<T>& getIntrinsicsModel() const {
|
|
271
|
+
return *intrinsicsModel_;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
private:
|
|
275
|
+
/// Transform world points to camera/eye space using SIMD operations.
|
|
276
|
+
/// @param worldPoints 3D points in world coordinate space (wide vector)
|
|
277
|
+
/// @return 3D points in camera/eye coordinate space (wide vector)
|
|
278
|
+
[[nodiscard]] Vector3xP<T> transformWorldToEye(const Vector3xP<T>& worldPoints) const;
|
|
279
|
+
|
|
280
|
+
/// Transform a single world point to camera/eye space.
|
|
281
|
+
/// @param worldPoint 3D point in world coordinate space
|
|
282
|
+
/// @return 3D point in camera/eye coordinate space
|
|
283
|
+
[[nodiscard]] Eigen::Vector3<T> transformWorldToEye(const Eigen::Vector3<T>& worldPoint) const;
|
|
284
|
+
|
|
285
|
+
Eigen::Transform<T, 3, Eigen::Affine> eyeFromWorld_ =
|
|
286
|
+
Eigen::Transform<T, 3, Eigen::Affine>::Identity();
|
|
287
|
+
|
|
288
|
+
std::shared_ptr<const IntrinsicsModelT<T>> intrinsicsModel_;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
/// OpenCV distortion parameters for camera lens distortion correction.
|
|
292
|
+
/// These parameters follow the OpenCV camera calibration model and include
|
|
293
|
+
/// both radial and tangential distortion coefficients.
|
|
294
|
+
template <typename T>
|
|
295
|
+
struct OpenCVDistortionParametersT {
|
|
296
|
+
T k1 = T(0); ///< First radial distortion coefficient
|
|
297
|
+
T k2 = T(0); ///< Second radial distortion coefficient
|
|
298
|
+
T k3 = T(0); ///< Third radial distortion coefficient
|
|
299
|
+
T k4 = T(0); ///< Fourth radial distortion coefficient (for fisheye model)
|
|
300
|
+
T k5 = T(0); ///< Fifth radial distortion coefficient (for fisheye model)
|
|
301
|
+
T k6 = T(0); ///< Sixth radial distortion coefficient (for fisheye model)
|
|
302
|
+
|
|
303
|
+
T p1 = T(0); ///< First tangential distortion coefficient
|
|
304
|
+
T p2 = T(0); ///< Second tangential distortion coefficient
|
|
305
|
+
T p3 = T(0); ///< Third tangential distortion coefficient (for thin prism)
|
|
306
|
+
T p4 = T(0); ///< Fourth tangential distortion coefficient (for thin prism)
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
/// PinholeIntrinsicsModel implements a basic pinhole camera model.
|
|
310
|
+
/// This model uses the following projection formula:
|
|
311
|
+
/// x = fx * X/Z + cx
|
|
312
|
+
/// y = fy * Y/Z + cy
|
|
313
|
+
///
|
|
314
|
+
/// Where:
|
|
315
|
+
/// - (X, Y, Z) is the 3D point in camera coordinates
|
|
316
|
+
/// - (x, y) is the projected 2D point in image coordinates
|
|
317
|
+
/// - (fx, fy) are the focal lengths
|
|
318
|
+
/// - (cx, cy) is the principal point
|
|
319
|
+
///
|
|
320
|
+
/// Unlike the OpenCVIntrinsicsModel, this model does not include any distortion.
|
|
321
|
+
template <typename T>
|
|
322
|
+
class PinholeIntrinsicsModelT : public IntrinsicsModelT<T> {
|
|
323
|
+
public:
|
|
324
|
+
PinholeIntrinsicsModelT(int32_t imageWidth, int32_t imageHeight, T fx, T fy, T cx, T cy);
|
|
325
|
+
PinholeIntrinsicsModelT(int32_t imageWidth, int32_t imageHeight, T fx, T fy);
|
|
326
|
+
|
|
327
|
+
[[nodiscard]] T fx() const final {
|
|
328
|
+
return fx_;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
[[nodiscard]] T fy() const final {
|
|
332
|
+
return fy_;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
[[nodiscard]] T cx() const {
|
|
336
|
+
return cx_;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
[[nodiscard]] T cy() const {
|
|
340
|
+
return cy_;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
[[nodiscard]] std::pair<Vector3xP<T>, typename PacketType_t<T>::MaskType> project(
|
|
344
|
+
const Vector3xP<T>& point) const final;
|
|
345
|
+
|
|
346
|
+
[[nodiscard]] std::pair<Eigen::Vector3<T>, bool> project(
|
|
347
|
+
const Eigen::Vector3<T>& point) const final;
|
|
348
|
+
|
|
349
|
+
[[nodiscard]] std::tuple<Eigen::Vector3<T>, Eigen::Matrix<T, 3, 3>, bool> projectJacobian(
|
|
350
|
+
const Eigen::Vector3<T>& point) const final;
|
|
351
|
+
|
|
352
|
+
[[nodiscard]] std::pair<Eigen::Vector3<T>, bool> unproject(
|
|
353
|
+
const Eigen::Vector3<T>& imagePoint,
|
|
354
|
+
int maxIterations = 10,
|
|
355
|
+
T tolerance = T(1e-6)) const final;
|
|
356
|
+
|
|
357
|
+
[[nodiscard]] std::shared_ptr<const IntrinsicsModelT<T>> resize(
|
|
358
|
+
int32_t imageWidth,
|
|
359
|
+
int32_t imageHeight) const final;
|
|
360
|
+
|
|
361
|
+
[[nodiscard]] std::shared_ptr<const IntrinsicsModelT<T>>
|
|
362
|
+
crop(int32_t top, int32_t left, int32_t newWidth, int32_t newHeight) const final;
|
|
363
|
+
|
|
364
|
+
private:
|
|
365
|
+
T fx_;
|
|
366
|
+
T fy_;
|
|
367
|
+
T cx_;
|
|
368
|
+
T cy_;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
/// OpenCVIntrinsicsModel implements the standard OpenCV camera model.
|
|
372
|
+
/// This model uses the following projection formula:
|
|
373
|
+
/// x = fx * X/Z + cx
|
|
374
|
+
/// y = fy * Y/Z + cy
|
|
375
|
+
///
|
|
376
|
+
/// Where:
|
|
377
|
+
/// - (X, Y, Z) is the 3D point in camera coordinates
|
|
378
|
+
/// - (x, y) is the projected 2D point in image coordinates
|
|
379
|
+
/// - (fx, fy) are the focal lengths
|
|
380
|
+
/// - (cx, cy) is the principal point
|
|
381
|
+
template <typename T>
|
|
382
|
+
class OpenCVIntrinsicsModelT : public IntrinsicsModelT<T> {
|
|
383
|
+
public:
|
|
384
|
+
OpenCVIntrinsicsModelT(
|
|
385
|
+
int32_t imageWidth,
|
|
386
|
+
int32_t imageHeight,
|
|
387
|
+
T fx,
|
|
388
|
+
T fy,
|
|
389
|
+
T cx,
|
|
390
|
+
T cy,
|
|
391
|
+
const OpenCVDistortionParametersT<T>& params = OpenCVDistortionParametersT<T>{});
|
|
392
|
+
|
|
393
|
+
[[nodiscard]] T fx() const final {
|
|
394
|
+
return fx_;
|
|
395
|
+
}
|
|
396
|
+
[[nodiscard]] T fy() const final {
|
|
397
|
+
return fy_;
|
|
398
|
+
}
|
|
399
|
+
[[nodiscard]] T cx() const {
|
|
400
|
+
return cx_;
|
|
401
|
+
}
|
|
402
|
+
[[nodiscard]] T cy() const {
|
|
403
|
+
return cy_;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/// Get the distortion parameters.
|
|
407
|
+
/// @return Reference to the OpenCV distortion parameters
|
|
408
|
+
[[nodiscard]] const OpenCVDistortionParametersT<T>& distortionParameters() const {
|
|
409
|
+
return distortionParams_;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
[[nodiscard]] std::pair<Vector3xP<T>, typename PacketType_t<T>::MaskType> project(
|
|
413
|
+
const Vector3xP<T>& point) const final;
|
|
414
|
+
|
|
415
|
+
[[nodiscard]] std::pair<Eigen::Vector3<T>, bool> project(
|
|
416
|
+
const Eigen::Vector3<T>& point) const final;
|
|
417
|
+
|
|
418
|
+
[[nodiscard]] std::tuple<Eigen::Vector3<T>, Eigen::Matrix<T, 3, 3>, bool> projectJacobian(
|
|
419
|
+
const Eigen::Vector3<T>& point) const final;
|
|
420
|
+
|
|
421
|
+
[[nodiscard]] std::pair<Eigen::Vector3<T>, bool> unproject(
|
|
422
|
+
const Eigen::Vector3<T>& imagePoint,
|
|
423
|
+
int maxIterations = 10,
|
|
424
|
+
T tolerance = T(1e-6)) const final;
|
|
425
|
+
|
|
426
|
+
[[nodiscard]] std::shared_ptr<const IntrinsicsModelT<T>> resize(
|
|
427
|
+
int32_t imageWidth,
|
|
428
|
+
int32_t imageHeight) const final;
|
|
429
|
+
|
|
430
|
+
[[nodiscard]] std::shared_ptr<const IntrinsicsModelT<T>>
|
|
431
|
+
crop(int32_t top, int32_t left, int32_t newWidth, int32_t newHeight) const final;
|
|
432
|
+
|
|
433
|
+
private:
|
|
434
|
+
T fx_;
|
|
435
|
+
T fy_;
|
|
436
|
+
T cx_;
|
|
437
|
+
T cy_;
|
|
438
|
+
const OpenCVDistortionParametersT<T> distortionParams_;
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
// Type aliases for common instantiations
|
|
442
|
+
using IntrinsicsModel = IntrinsicsModelT<float>;
|
|
443
|
+
using IntrinsicsModeld = IntrinsicsModelT<double>;
|
|
444
|
+
using Camera = CameraT<float>;
|
|
445
|
+
using Camerad = CameraT<double>;
|
|
446
|
+
using PinholeIntrinsicsModel = PinholeIntrinsicsModelT<float>;
|
|
447
|
+
using PinholeIntrinsicsModeld = PinholeIntrinsicsModelT<double>;
|
|
448
|
+
using OpenCVIntrinsicsModel = OpenCVIntrinsicsModelT<float>;
|
|
449
|
+
using OpenCVIntrinsicsModeld = OpenCVIntrinsicsModelT<double>;
|
|
450
|
+
using OpenCVDistortionParameters = OpenCVDistortionParametersT<float>;
|
|
451
|
+
using OpenCVDistortionParametersd = OpenCVDistortionParametersT<double>;
|
|
452
|
+
|
|
453
|
+
} // namespace momentum::rasterizer
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <drjit/fwd.h>
|
|
11
|
+
|
|
12
|
+
namespace momentum::rasterizer {
|
|
13
|
+
|
|
14
|
+
template <typename T>
|
|
15
|
+
class CameraT;
|
|
16
|
+
|
|
17
|
+
template <typename T>
|
|
18
|
+
class IntrinsicsModelT;
|
|
19
|
+
|
|
20
|
+
using Camera = CameraT<float>;
|
|
21
|
+
using IntrinsicsModel = IntrinsicsModelT<float>;
|
|
22
|
+
|
|
23
|
+
constexpr size_t kSimdPacketSize = drjit::DefaultSize;
|
|
24
|
+
constexpr size_t kSimdAlignment = 4 * kSimdPacketSize;
|
|
25
|
+
|
|
26
|
+
using IntP = drjit::Packet<int32_t, kSimdPacketSize>;
|
|
27
|
+
using UintP = drjit::Packet<uint32_t, kSimdPacketSize>;
|
|
28
|
+
using Uint8P = drjit::Packet<uint8_t, kSimdPacketSize>;
|
|
29
|
+
|
|
30
|
+
using FloatP = drjit::Packet<float, kSimdPacketSize>;
|
|
31
|
+
using DoubleP = drjit::Packet<double, kSimdPacketSize>;
|
|
32
|
+
using ByteP = drjit::Packet<uint8_t, kSimdPacketSize>;
|
|
33
|
+
using Vector3f = drjit::Array<float, 3>;
|
|
34
|
+
using Vector3d = drjit::Array<double, 3>;
|
|
35
|
+
using Vector3b = drjit::Array<uint8_t, 3>;
|
|
36
|
+
using Vector2f = drjit::Array<float, 2>;
|
|
37
|
+
using Vector2d = drjit::Array<double, 2>;
|
|
38
|
+
using Matrix3f = drjit::Matrix<float, 3>;
|
|
39
|
+
using Matrix3d = drjit::Matrix<double, 3>;
|
|
40
|
+
using Matrix4f = drjit::Matrix<float, 4>;
|
|
41
|
+
using Matrix4d = drjit::Matrix<double, 4>;
|
|
42
|
+
using Vector2fP = drjit::Array<FloatP, 2>;
|
|
43
|
+
using Vector2dP = drjit::Array<DoubleP, 2>;
|
|
44
|
+
using Vector2iP = drjit::Array<IntP, 2>;
|
|
45
|
+
using Vector3fP = drjit::Array<FloatP, 3>;
|
|
46
|
+
using Vector3dP = drjit::Array<DoubleP, 3>;
|
|
47
|
+
using Vector3bP = drjit::Array<ByteP, 3>;
|
|
48
|
+
using Vector3iP = drjit::Array<IntP, 3>;
|
|
49
|
+
using Vector4fP = drjit::Array<FloatP, 4>;
|
|
50
|
+
using Vector4dP = drjit::Array<DoubleP, 4>;
|
|
51
|
+
using Matrix3fP = drjit::Matrix<FloatP, 3>;
|
|
52
|
+
using Matrix3dP = drjit::Matrix<DoubleP, 3>;
|
|
53
|
+
|
|
54
|
+
// Template metafunction to map scalar types to their packet equivalents
|
|
55
|
+
template <typename T>
|
|
56
|
+
struct PacketType;
|
|
57
|
+
|
|
58
|
+
template <>
|
|
59
|
+
struct PacketType<float> {
|
|
60
|
+
using type = FloatP;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
template <>
|
|
64
|
+
struct PacketType<double> {
|
|
65
|
+
using type = DoubleP;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
template <>
|
|
69
|
+
struct PacketType<int32_t> {
|
|
70
|
+
using type = IntP;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
template <>
|
|
74
|
+
struct PacketType<uint32_t> {
|
|
75
|
+
using type = UintP;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
template <>
|
|
79
|
+
struct PacketType<uint8_t> {
|
|
80
|
+
using type = ByteP;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
template <typename T>
|
|
84
|
+
using PacketType_t = typename PacketType<T>::type;
|
|
85
|
+
|
|
86
|
+
// Templatized vector and matrix definitions
|
|
87
|
+
template <typename T>
|
|
88
|
+
using Vector2xP = drjit::Array<PacketType_t<T>, 2>;
|
|
89
|
+
|
|
90
|
+
template <typename T>
|
|
91
|
+
using Vector3xP = drjit::Array<PacketType_t<T>, 3>;
|
|
92
|
+
|
|
93
|
+
template <typename T>
|
|
94
|
+
using Vector4xP = drjit::Array<PacketType_t<T>, 4>;
|
|
95
|
+
|
|
96
|
+
template <typename T>
|
|
97
|
+
using Matrix3xP = drjit::Matrix<PacketType_t<T>, 3>;
|
|
98
|
+
|
|
99
|
+
template <typename T>
|
|
100
|
+
using Matrix4xP = drjit::Matrix<PacketType_t<T>, 4>;
|
|
101
|
+
|
|
102
|
+
} // namespace momentum::rasterizer
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <momentum/math/mesh.h>
|
|
11
|
+
#include <momentum/rasterizer/camera.h>
|
|
12
|
+
#include <Eigen/Core>
|
|
13
|
+
#include <utility>
|
|
14
|
+
|
|
15
|
+
namespace momentum::rasterizer {
|
|
16
|
+
|
|
17
|
+
using RowMatrixXf = Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
|
|
18
|
+
using RowMatrixXi = Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
|
|
19
|
+
|
|
20
|
+
/// Use the momentum Mesh class as the rasterizer Mesh type
|
|
21
|
+
using Mesh = momentum::MeshT<float>;
|
|
22
|
+
|
|
23
|
+
// Utility functions for creating primitives.
|
|
24
|
+
Mesh makeSphere(int subdivisionLevel);
|
|
25
|
+
Mesh makeCylinder(int numCircleSubdivisions, int numLengthSubdivisions);
|
|
26
|
+
std::array<Mesh, 2> makeCheckerboard(float width, int numChecks, int subdivisions);
|
|
27
|
+
|
|
28
|
+
Mesh makeCapsule(
|
|
29
|
+
int numCircleSubdivisions,
|
|
30
|
+
int numLengthSubdivisions,
|
|
31
|
+
float startRadius = 1.0,
|
|
32
|
+
float endRadius = 1.0,
|
|
33
|
+
float length = 1.0);
|
|
34
|
+
|
|
35
|
+
Mesh makeArrow(
|
|
36
|
+
int numCircleSubdivisions,
|
|
37
|
+
int numLengthSubdivisions,
|
|
38
|
+
float innerRadius,
|
|
39
|
+
float outerRadius,
|
|
40
|
+
float tipLength,
|
|
41
|
+
float cylinderLength);
|
|
42
|
+
|
|
43
|
+
Mesh makeArrowhead(
|
|
44
|
+
int numCircleSubdivisions,
|
|
45
|
+
float innerRadius,
|
|
46
|
+
float outerRadius,
|
|
47
|
+
float length,
|
|
48
|
+
float translation);
|
|
49
|
+
|
|
50
|
+
// Creates an octahedron which is basically two pyramids stuck together.
|
|
51
|
+
// "radius" is the width around the middle (where the two pyramid bases meet).
|
|
52
|
+
// "midFraction" is the ratio of the two pyramid heights.
|
|
53
|
+
std::tuple<Mesh, std::vector<Eigen::Vector3f>> makeOctahedron(
|
|
54
|
+
float radius = 0.5,
|
|
55
|
+
float midFraction = 0.5);
|
|
56
|
+
|
|
57
|
+
Eigen::Matrix4f
|
|
58
|
+
makeCylinderTransform(const Eigen::Vector3f& startPos, const Eigen::Vector3f& endPos, float radius);
|
|
59
|
+
|
|
60
|
+
Eigen::Matrix4f makeSphereTransform(const Eigen::Vector3f& center, float radius);
|
|
61
|
+
|
|
62
|
+
// Subdivides the lines until the longest segment is no longer than maxLength, except that it won't
|
|
63
|
+
// generate more than maxSubdivisions segments for each line (to prevent infinite recursion).
|
|
64
|
+
std::vector<Eigen::Vector3f> subdivideLines(
|
|
65
|
+
const std::vector<Eigen::Vector3f>& lines,
|
|
66
|
+
float maxLength,
|
|
67
|
+
size_t maxSubdivisions = 100);
|
|
68
|
+
|
|
69
|
+
std::tuple<RowMatrixXf, RowMatrixXf, RowMatrixXi, RowMatrixXf, RowMatrixXi>
|
|
70
|
+
subdivideMeshNoSmoothing(
|
|
71
|
+
Eigen::Ref<const RowMatrixXf> vertices_orig,
|
|
72
|
+
Eigen::Ref<const RowMatrixXf> normals_orig,
|
|
73
|
+
Eigen::Ref<const RowMatrixXi> triangles_orig,
|
|
74
|
+
Eigen::Ref<const RowMatrixXf> textureCoords_orig,
|
|
75
|
+
Eigen::Ref<const RowMatrixXi> textureTriangles_orig,
|
|
76
|
+
float max_edge_length);
|
|
77
|
+
|
|
78
|
+
Mesh subdivideMeshNoSmoothing(const Mesh& mesh, float max_edge_length, size_t max_depth = 3);
|
|
79
|
+
|
|
80
|
+
std::vector<Eigen::Vector3f>
|
|
81
|
+
makeCameraFrustumLines(const Camera& camera, float distance, size_t nSamples = 20);
|
|
82
|
+
|
|
83
|
+
} // namespace momentum::rasterizer
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <momentum/rasterizer/fwd.h>
|
|
11
|
+
#include <momentum/rasterizer/rasterizer.h>
|
|
12
|
+
|
|
13
|
+
namespace momentum::rasterizer {
|
|
14
|
+
|
|
15
|
+
template <typename T>
|
|
16
|
+
void alphaMatte(Span2f zBuffer, Span3f rgbBuffer, const Span<T, 3>& tgtImage, float alpha = 1.0f);
|
|
17
|
+
|
|
18
|
+
} // namespace momentum::rasterizer
|