Skip to content

Commit 4fe7a92

Browse files
LimHyungTaeclaude
andcommitted
Make ICP interactive · drop GICP · add Transformation · stable cluster colors
ICP (chapter 10, moved to last) - Replaces the precomputed before/after toggle with a real, in-browser ICP. - Step button runs one iteration: KdTree nearest-correspondences → Procrustes (3×3 SVD via Jacobi eigendecomp of HᵀH) → compose into the cumulative transform. Play auto-iterates ~6 fps so you can watch the alignment tighten frame by frame. - max-correspondence-distance slider reproduces PCL's setMaxCorrespondenceDistance gate. Transformation (new chapter 3) - Six sliders (tx/ty/tz, rx/ry/rz) over a 4×4 rigid transform with ZYX-Euler rotation. First load randomizes a small translation so the demo is never visually trivial. Code panel mirrors Eigen::Matrix4f. Euclidean Clustering colors stay stable across slider changes - ClusterColorMatcher tracks centroids and reuses the prior color for the closest matching cluster (within 3× tolerance). New clusters get a fresh hue from the golden-angle spiral. Data picker - Reordered: Bunny → NaverLabs → KITTI, each with a (CAD)/(Indoor)/ (Outdoor) chip. Camera auto-fit - PointCloudViewer now reframes (camera position + OrbitControls target) whenever the union bbox changes — preset switches snap to fit. Cleanup - GICP page, route, dictionary entries, precomputed PCDs all removed. - export_precomputed.cpp + CMake target removed (no longer needed; web side does everything live). - README updated to reflect 10 fully interactive chapters. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4f32ed3 commit 4fe7a92

23 files changed

Lines changed: 1130 additions & 379 deletions

CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,3 @@ target_link_libraries(lec11_icp ${PCL_LIBRARIES})
6868

6969
add_executable(lec12_gicp lec12_gicp.cpp)
7070
target_link_libraries(lec12_gicp ${PCL_LIBRARIES})
71-
72-
# ──────────────────────────────────────────────────────────────────────────────
73-
# Pre-compute pipeline for the React/web tutorial site (web/).
74-
# Run from the build/ directory after `make export_precomputed`:
75-
# ./export_precomputed
76-
# It dumps src/tgt/aligned PCDs into ../web/public/precomputed/.
77-
add_executable(export_precomputed scripts/export_precomputed.cpp)
78-
target_link_libraries(export_precomputed ${PCL_LIBRARIES})

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,20 @@ ______________________________________________________________________
2828

2929
브라우저에서 슬라이더를 만져 가며 챕터별 동작을 직접 확인할 수 있습니다 — **<https://limhyungtae.github.io/pcl_tutorial/>**.
3030

31-
| 트랙 | 챕터 | 어디서 도느냐 |
32-
| ----------------- | ------------------------------------- | ------------------------------------------------------- |
33-
| **인터랙티브** | Voxelization, PassThrough | TypeScript 재구현 → 브라우저에서 실시간 |
34-
| **Pre-computed** | ICP, GICP, Normal Estimation | C++ 바이너리(`export_precomputed`)가 뽑은 PCD를 fetch |
35-
| **코드 설명** | shared_ptr, Ptr, Transformation 등 | 소스코드 + 블로그 글 링크 (개념 위주) |
31+
모든 인터랙티브 데모는 **TypeScript로 재구현된 알고리즘이 브라우저에서 실시간으로** 돕니다 (외부 컴퓨트 없음). 입력은 KITTI(Outdoor LiDAR) / NaverLabs(Indoor LiDAR) / Stanford Bunny(CAD) 프리셋 + 자유 드래그&드롭.
32+
33+
| # | 챕터 | 핵심 |
34+
| -- | ------------------------------------- | --------------------------------------------------- |
35+
| 1 | Voxelization | leaf size 슬라이더, before/after |
36+
| 2 | PassThrough | 축 + min/max + negative 토글 |
37+
| 3 | Transformation | tx/ty/tz/rx/ry/rz, 진입 시 랜덤 offset |
38+
| 4 | Statistical Outlier Removal | mean K + stddev mult, 인라이어/아웃라이어 분리 |
39+
| 5 | Radius Search | KdTree 기반 반경 내 이웃 |
40+
| 6 | K-Nearest Neighbor | KdTree 기반 K-NN |
41+
| 7 | Normal Estimation | KdTree + 닫힌형 3×3 sym eig |
42+
| 8 | RANSAC Plane Segmentation | 지면/벽 검출 (extra) |
43+
| 9 | Euclidean Clustering | 색상이 슬라이더 변화에도 안정적으로 유지 (extra) |
44+
| 10 | Iterative Closest Point | **Step / Play 버튼으로 매 iteration 관찰** |
3645

3746
### 로컬에서 사이트 띄우기
3847

@@ -44,15 +53,6 @@ npm run dev # http://localhost:5173/pcl_tutorial/
4453

4554
`predev` / `prebuild` 훅이 `materials/`의 데이터(`.bin` / `.pcd` / `.ply`)를 자동으로 `web/public/data/`로 복사합니다.
4655

47-
### Pre-computed 자산 다시 뽑기 (선택)
48-
49-
`lec11_icp.cpp` / `lec12_gicp.cpp`의 출력은 미리 PCD로 저장돼 `web/public/precomputed/`에 들어 있습니다. 알고리즘이나 입력을 바꿨다면 다시 뽑아주세요:
50-
51-
```bash
52-
cd build && make export_precomputed
53-
KMP_DUPLICATE_LIB_OK=TRUE ./export_precomputed # macOS Homebrew PCL은 이 플래그 필요
54-
```
55-
5656
### 배포
5757

5858
`main` 브랜치에 `web/**` 변경이 push되면 GitHub Actions(`.github/workflows/deploy.yml`)가 자동으로 빌드 후 GitHub Pages에 배포합니다. 첫 배포 전에는 GitHub repo settings → Pages → Source를 **GitHub Actions**로 설정해 주세요.
@@ -118,17 +118,19 @@ ______________________________________________________________________
118118
pcl_tutorial/
119119
├── CMakeLists.txt
120120
├── lec*.cpp # 챕터별 예제 코드 (PCL/C++)
121-
├── scripts/
122-
│ └── export_precomputed.cpp # ICP/GICP 결과를 PCD로 저장 (web/이 사용)
123121
├── auxiliary/ # 본 빌드와 무관한 보조 스니펫
124122
├── img/ # README/블로그용 이미지
125123
├── materials/ # 예제용 포인트클라우드 데이터 (.bin / .pcd / .ply)
126124
└── web/ # React + Vite 기반 인터랙티브 사이트
127125
├── src/
128126
│ ├── pages/ # 챕터별 페이지
129127
│ ├── components/ # 뷰어, 슬라이더, 드롭존
130-
│ └── lib/filters/ # voxel, passthrough, … (TS 재구현)
131-
└── public/precomputed/ # C++가 미리 뽑은 .pcd (커밋됨)
128+
│ ├── i18n/ # 영/한 사전 + 토글
129+
│ └── lib/ # KdTree, PCD/BIN/PLY 파서,
130+
│ └── filters/ # voxel · passthrough · sor · normal ·
131+
│ # ransacPlane · euclideanCluster · icp ·
132+
│ # transform (모두 TS 재구현)
133+
└── public/data/ # materials/에서 자동 복사 (build 시)
132134
```
133135

134136
______________________________________________________________________

scripts/export_precomputed.cpp

Lines changed: 0 additions & 88 deletions
This file was deleted.
-1.43 MB
Binary file not shown.
-1.43 MB
Binary file not shown.
-1.43 MB
Binary file not shown.
-1.43 MB
Binary file not shown.

web/public/precomputed/icp_src.pcd

-1.43 MB
Binary file not shown.

web/public/precomputed/icp_tgt.pcd

-1.43 MB
Binary file not shown.

web/src/chapters.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,59 +29,59 @@ export const chapters: ChapterMeta[] = [
2929
status: "interactive",
3030
},
3131
{
32-
slug: "lec07",
32+
slug: "lec03",
3333
number: "3",
34+
source: "lec03_transformation.cpp",
35+
blog: `${BLOG}/2021-09-10-ROS-Point-Cloud-Library-(PCL)-3.-Transformation/`,
36+
status: "interactive",
37+
},
38+
{
39+
slug: "lec07",
40+
number: "4",
3441
source: "lec07_sor.cpp",
3542
blog: `${BLOG}/2021-09-12-ROS-Point-Cloud-Library-(PCL)-7.-Statistical-Outlier-Removal/`,
3643
status: "interactive",
3744
},
3845
{
3946
slug: "lec08",
40-
number: "4",
47+
number: "5",
4148
source: "lec08_radius_search.cpp",
4249
blog: `${BLOG}/2021-09-12-ROS-Point-Cloud-Library-(PCL)-8.-KdTree를-활용한-Radius-Search/`,
4350
status: "interactive",
4451
},
4552
{
4653
slug: "lec09",
47-
number: "5",
54+
number: "6",
4855
source: "lec09_knn.cpp",
4956
blog: `${BLOG}/2021-09-12-ROS-Point-Cloud-Library-(PCL)-9.-KdTree를-활용한-K-nearest-Neighbor-Search-(KNN)/`,
5057
status: "interactive",
5158
},
5259
{
5360
slug: "lec10",
54-
number: "6",
61+
number: "7",
5562
source: "lec10_1_normal.cpp",
5663
blog: `${BLOG}/2021-09-13-ROS-Point-Cloud-Library-(PCL)-10.-Normal-Estimation/`,
5764
status: "interactive",
5865
},
5966
{
60-
slug: "lec11",
61-
number: "7",
62-
source: "lec11_icp.cpp",
63-
blog: `${BLOG}/2021-09-14-ROS-Point-Cloud-Library-(PCL)-11.-Iterative-Closest-Point-(ICP)/`,
64-
status: "precomputed",
65-
},
66-
{
67-
slug: "lec12",
67+
slug: "extra01",
6868
number: "8",
69-
source: "lec12_gicp.cpp",
70-
blog: `${BLOG}/2021-09-14-ROS-Point-Cloud-Library-(PCL)-12.-Generalized-Iterative-Closest-Point-(G-ICP)/`,
71-
status: "precomputed",
69+
source: "",
70+
blog: "",
71+
status: "interactive",
7272
},
7373
{
74-
slug: "extra01",
74+
slug: "extra02",
7575
number: "9",
7676
source: "",
7777
blog: "",
7878
status: "interactive",
7979
},
8080
{
81-
slug: "extra02",
81+
slug: "lec11",
8282
number: "10",
83-
source: "",
84-
blog: "",
83+
source: "lec11_icp.cpp",
84+
blog: `${BLOG}/2021-09-14-ROS-Point-Cloud-Library-(PCL)-11.-Iterative-Closest-Point-(ICP)/`,
8585
status: "interactive",
8686
},
8787
];

0 commit comments

Comments
 (0)