Skip to content

Commit

Permalink
feat(pointcloud-2d): Filter maaping error data
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwin-L committed Sep 14, 2022
1 parent 6512053 commit d3406b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
17 changes: 10 additions & 7 deletions packages/lb-annotation/src/core/pointCloud/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,16 @@ export class PointCloud {
const { P, R, T } = cameraMatrix;
const { composeMatrix4 } = this.transferKitti2Matrix(P, R, T);

const transferViewData = allViewData.map((viewData) => ({
type: viewData.type,
pointList: viewData.pointList
.map((point) => this.rotatePoint(point, boxParams.center, boxParams.rotation))
.map((point) => this.lidar2image(point, composeMatrix4))
.filter((v) => v !== undefined),
}));
const transferViewData = allViewData
.map((viewData) => ({
type: viewData.type,
pointList: viewData.pointList
.map((point) => this.rotatePoint(point, boxParams.center, boxParams.rotation))
.map((point) => this.lidar2image(point, composeMatrix4))
.filter((v) => v !== undefined),
}))
// Clear Empty PointList
.filter((v) => v.pointList.length !== 0);

return transferViewData;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ const PointCloud2DView = ({ imgInfo }: IProps) => {
return;
}
const selected2data = annotations2d.find((v) => v.annotation.id === selectedBox.info.id);
toolInstance.focusPositionByPointList(selected2data?.annotation.pointList);

if (selected2data?.annotation.pointList?.length > 0) {
toolInstance.focusPositionByPointList(selected2data?.annotation.pointList);
}
}, [selectedBox, viewRef.current, annotations2d]);

return (
Expand Down

0 comments on commit d3406b4

Please sign in to comment.