1 minute read

[WIKIPEDIA Marching cubes]

Marching cubes is a computer graphics algorithm, published in the 1987 SIGGRAPH, for extracting a polygonal mesh of an isosurface from a three-dimensional discrete scalar field (the elements of which are sometimes called voxels).

Marching Cubes ์•Œ๊ณ ๋ฆฌ์ฆ˜

Marching Cubes ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ 3์ฐจ์› ๊ฒฉ์ž ๋ฐ์ดํ„ฐ๋ฅผ ์ž…๋ ฅ์œผ๋กœ ๋ฐ›์•„ isosurface๋ฅผ ์ถ”์ถœํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. Isosurface๋Š” ํŠน์ • ์ž„๊ณ„๊ฐ’์„ ๊ฐ€์ง€๋Š” ์ ๋“ค๋กœ ๊ตฌ์„ฑ๋œ ํ‘œ๋ฉด์ž…๋‹ˆ๋‹ค. ์ด ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ๊ฐ ๊ฒฉ์ž ์…€์„ ํ๋ธŒ๋กœ ๊ฐ„์ฃผํ•˜๊ณ , ํ๋ธŒ์˜ ๊ฐ ๊ผญ์ง“์ ์ด ์ž„๊ณ„๊ฐ’๋ณด๋‹ค ๋†’์€์ง€ ๋‚ฎ์€์ง€๋ฅผ ๊ธฐ์ค€์œผ๋กœ ํ๋ธŒ๋ฅผ ์‚ผ๊ฐํ˜•์œผ๋กœ ๋ถ„ํ• ํ•ฉ๋‹ˆ๋‹ค.

์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ๋‹จ๊ณ„

1) ํ๋ธŒ ๋ถ„ํ• : 3์ฐจ์› ๊ฒฉ์ž ๋ฐ์ดํ„ฐ๋ฅผ ์ž‘์€ ํ๋ธŒ(์…€)๋“ค๋กœ ๋‚˜๋ˆ•๋‹ˆ๋‹ค. ๊ฐ ํ๋ธŒ๋Š” 8๊ฐœ์˜ ๊ผญ์ง“์ ์„ ๊ฐ€์ง€๋ฉฐ, ๊ฐ ๊ผญ์ง“์ ์€ ์ƒ˜ํ”Œ๋ง๋œ ๋ฐ์ดํ„ฐ ๊ฐ’(์Šค์นผ๋ผ ๊ฐ’)์„ ๊ฐ€์ง‘๋‹ˆ๋‹ค.

2) ๊ผญ์ง“์  ํ‰๊ฐ€: ๊ฐ ํ๋ธŒ์˜ ๊ผญ์ง“์ ์ด ์ž„๊ณ„๊ฐ’๋ณด๋‹ค ํฐ์ง€ ์ž‘์€์ง€๋ฅผ ํ‰๊ฐ€ํ•˜์—ฌ ์ด์ง„ ์ฝ”๋“œ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ด์ง„ ์ฝ”๋“œ๋Š” 8๋น„ํŠธ๋กœ ํ‘œํ˜„๋˜๋ฉฐ, ๊ฐ ๋น„ํŠธ๋Š” ๊ผญ์ง“์ ์˜ ์ƒํƒœ(์ž„๊ณ„๊ฐ’๋ณด๋‹ค ํฐ์ง€ ์ž‘์€์ง€)๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. ๊ฐ ๊ผญ์ง“์ ์€ ๊ฐ์ฒด์— ํฌํ•จ๋˜์–ด ์žˆ๋Š”์ง€ ์—ฌ๋ถ€์— ๋”ฐ๋ผ 0 ๋˜๋Š” 1๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ํฌํ•จ๋˜์–ด ์žˆ์œผ๋ฉด 1, ํฌํ•จ๋˜์ง€ ์•Š์œผ๋ฉด 0์ž…๋‹ˆ๋‹ค.

3) ์‚ผ๊ฐํ˜• ํŒจํ„ด ๋งค์นญ: ๊ฐ ํ๋ธŒ์˜ 8๊ฐœ์˜ ๊ผญ์ง“์ ์ด ๋‘ ๊ฐ€์ง€ ์ƒํƒœ๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์—, ํ๋ธŒ๋Š” ์ด 2^8(=256)๊ฐœ์˜ ๊ฒฝ์šฐ์˜ ์ˆ˜๋ฅผ ๊ฐ€์ง‘๋‹ˆ๋‹ค. ์ด์ง„ ์ฝ”๋“œ์— ๋”ฐ๋ผ ๋ฏธ๋ฆฌ ์ •์˜๋œ ์‚ผ๊ฐํ˜• ํŒจํ„ด์„ ์ฐธ์กฐํ•˜์—ฌ ํ๋ธŒ ๋‚ด๋ถ€์— isosurface๋ฅผ ํ‘œํ˜„ํ•˜๋Š” ์‚ผ๊ฐํ˜•์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ด 256๊ฐ€์ง€ ๊ฒฝ์šฐ์˜ ์ˆ˜ ๊ฐ๊ฐ์— ๋Œ€ํ•ด, ์–ด๋–ป๊ฒŒ ํ‘œ๋ฉด ๋‹ค๊ฐํ˜•์„ ๋ฐฐ์น˜ํ• ์ง€ ๋ฏธ๋ฆฌ ์ •์˜๋œ ํ…Œ์ด๋ธ”์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ์ด ํ…Œ์ด๋ธ”์€ ๊ฐ ๊ฒฝ์šฐ์˜ ์ˆ˜์— ๋Œ€ํ•ด ํ•ด๋‹นํ•˜๋Š” ๋‹ค๊ฐํ˜•์„ ๊ตฌ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

Image

4) ๋ณด๊ฐ„: ํ๋ธŒ์˜ ๋ณ€์„ ๋”ฐ๋ผ ์„ ํ˜• ๋ณด๊ฐ„์„ ํ†ตํ•ด ๊ผญ์ง“์ ์˜ ์ •ํ™•ํ•œ ์œ„์น˜๋ฅผ ๊ณ„์‚ฐํ•˜์—ฌ ์‚ผ๊ฐํ˜•์˜ ์ •์ ์„ ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค.

5) ์‚ผ๊ฐํ˜• ์—ฐ๊ฒฐ: ๊ฐ ํ๋ธŒ์—์„œ ์ƒ์„ฑ๋œ ์‚ผ๊ฐํ˜•๋“ค์„ ์—ฐ๊ฒฐํ•˜์—ฌ ์—ฐ์†์ ์ธ ํ‘œ๋ฉด์„ ํ˜•์„ฑํ•ฉ๋‹ˆ๋‹ค.

Image

ํ™œ์šฉ ๋ฐฉ์•ˆ

  • SDF (Signed Distance Fields): SDF๋Š” ์ ์ด ํ‘œ๋ฉด์œผ๋กœ๋ถ€ํ„ฐ์˜ ๊ฑฐ๋ฆฌ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ํ•„๋“œ์ž…๋‹ˆ๋‹ค. Marching Cubes ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ SDF ๋ฐ์ดํ„ฐ์—์„œ isosurface๋ฅผ ์ถ”์ถœํ•˜์—ฌ 3D ๋ชจ๋ธ์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ๊ฒŒ์ž„ ์—”์ง„์—์„œ ๋ฌผ์ฒด์˜ ์ถฉ๋Œ ๊ฐ์ง€, 3D ๋ชจ๋ธ๋ง ์†Œํ”„ํŠธ์›จ์–ด์—์„œ ๋ถ€๋“œ๋Ÿฌ์šด ํ‘œ๋ฉด ์ƒ์„ฑ ๋“ฑ์— ํ™œ์šฉ๋ฉ๋‹ˆ๋‹ค.

  • NeRF (Neural Radiance Fields): NeRF๋Š” ์‹ ๊ฒฝ๋ง์„ ์ด์šฉํ•ด 3D ์žฅ๋ฉด์˜ ๊ด‘์„  ํ•„๋“œ๋ฅผ ํ•™์Šตํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. ํ•™์Šต๋œ NeRF ๋ชจ๋ธ์—์„œ ์ƒ˜ํ”Œ๋ง๋œ 3์ฐจ์› ๋ฐ์ดํ„ฐ๋กœ๋ถ€ํ„ฐ isosurface๋ฅผ ์ถ”์ถœํ•˜์—ฌ ์žฅ๋ฉด์˜ 3D ๊ตฌ์กฐ๋ฅผ ์‹œ๊ฐํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Marching Cubes ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ์ด๋Ÿฌํ•œ ๋ฐ์ดํ„ฐ๋กœ๋ถ€ํ„ฐ ๋ฉ”์‰ฌ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

  • ๋ฉ”๋””์ปฌ ์ด๋ฏธ์ง• (CT, MRI): Marching Cubes ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ CT, MRI ๋ฐ์ดํ„ฐ์—์„œ ์ธ์ฒด ์žฅ๊ธฐ๋‚˜ ๊ตฌ์กฐ๋ฌผ์˜ 3D ๋ชจ๋ธ์„ ์ƒ์„ฑํ•˜๋Š” ๋ฐ ๋„๋ฆฌ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์˜์‚ฌ๋Š” CT ์Šค์บ” ๋ฐ์ดํ„ฐ๋ฅผ ํ†ตํ•ด ํ™˜์ž์˜ ์žฅ๊ธฐ๋ฅผ 3D๋กœ ์‹œ๊ฐํ™”ํ•˜์—ฌ ์ˆ˜์ˆ  ๊ณ„ํš์„ ์„ธ์šฐ๊ฑฐ๋‚˜, ๋ณ‘๋ณ€์˜ ์œ„์น˜์™€ ํฌ๊ธฐ๋ฅผ ์ •ํ™•ํžˆ ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Marching Cube ์žฅ์ 

  • ํšจ์œจ์„ฑ: ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด ๋น„๊ต์  ๊ฐ„๋‹จํ•˜๊ณ , ๋ณ‘๋ ฌ ์ฒ˜๋ฆฌ์— ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค.
  • ์ผ๊ด€์„ฑ: isosurface๊ฐ€ ์—ฐ์†์ ์ด๊ณ  ๋งค๋„๋Ÿฌ์šด ํ‘œ๋ฉด์„ ํ˜•์„ฑํ•˜๋„๋ก ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค.

Marching Cube ๋‹จ์ 

  • ๊ตฌ๋ฉ ๋ฌธ์ œ: ํŠน์ • ๊ฒฝ์šฐ์— ์ž˜๋ชป๋œ ์‚ผ๊ฐํ˜• ํŒจํ„ด์ด ์„ ํƒ๋˜์–ด ๊ตฌ๋ฉ์ด ์ƒ๊ธธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์ •ํ™•๋„: ๋ณด๊ฐ„ ๊ณผ์ •์—์„œ ์ •ํ™•๋„๊ฐ€ ๋–จ์–ด์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Leave a comment