μ§κ°μ’Œν‘œκ³„ & κ΅¬λ©΄μ’Œν‘œκ³„ | μ’Œν‘œ λ³€ν™˜

2024. 3. 29. 13:49Β·πŸ“– Fundamentals/Computer Vision
λ°˜μ‘ν˜•

직각 μ’Œν‘œκ³„μ™€ ꡬ면 μ’Œν‘œκ³„λŠ” 이미지 처리 및 λΆ„μ„μ—μ„œ μ‚¬μš©λ˜λŠ” μ’Œν‘œ μ‹œμŠ€ν…œμ΄λ‹€.

 


직각 μ’Œν‘œκ³„(Rectangular Coordinates)

  • 이미지λ₯Ό λ‹€λ£° λ•Œ κ°€μž₯ 일반적으둜 μ‚¬μš©λ˜λŠ” μ’Œν‘œ μ‹œμŠ€ν…œ
  • μ΄λ―Έμ§€λŠ” ν”½μ…€λ‘œ κ΅¬μ„±λ˜μ–΄ 있으며, 각 픽셀은 ν–‰(row)κ³Ό μ—΄(column)의 인덱슀둜 ν‘œν˜„
  • 일반적으둜 μ™Όμͺ½ 상단 λͺ¨μ„œλ¦¬κ°€ (0, 0)으둜 μ‹œμž‘ν•˜μ—¬ 였λ₯Έμͺ½μœΌλ‘œ 갈수둝 μ—΄(column)이 μ¦κ°€ν•˜κ³  μ•„λž˜λ‘œ 갈수둝 ν–‰(row)이 증가

 

 

ꡬ면 μ’Œν‘œκ³„(Spherical Coordinates)

  • ꡬ면 μ’Œν‘œκ³„λŠ” 이미지 μ²˜λ¦¬μ—μ„œ 주둜 μ‚¬μš©λ˜μ§€λŠ” μ•Šμ§€λ§Œ, 컴퓨터 λΉ„μ „μ˜ νŠΉμ • λΆ„μ•Όμ—μ„œ μ‚¬μš©λ  수 있음
  • 주둜 3D κ³΅κ°„μ—μ„œ μ‚¬μš©λ˜λ©°, μœ„λ„(latitude), 경도(longitude), 고도(altitude)와 같은 μ’Œν‘œλ₯Ό μ‚¬μš©ν•˜μ—¬ 지ꡬ ν‘œλ©΄μ„ λ‚˜νƒ€λƒ„
  • νšŒμ „ 및 λ°©ν–₯을 λ‹€λ£¨λŠ” 데 μœ μš©ν•˜λ©°, μΉ΄λ©”λΌμ˜ μœ„μΉ˜ 및 λ°©ν–₯을 μ •ν™•ν•˜κ²Œ μΆ”μ ν•˜λŠ” 데 μ‚¬μš©λ  수 있음
  • 예λ₯Ό λ“€μ–΄, μ΄λ―Έμ§€μ˜ νŠΉμ§•μ μ„ κ°μ§€ν•˜κ³  μΆ”μ ν•˜λŠ” μž‘μ—…μ—μ„œλŠ” 직각 μ’Œν‘œκ³„κ°€ 주둜 μ‚¬μš©λ˜μ§€λ§Œ, 3D 객체의 μœ„μΉ˜ 및 λ°©ν–₯을 μΆ”μ •ν•˜λŠ” μž‘μ—…μ—μ„œλŠ” ꡬ면 μ’Œν‘œκ³„κ°€ μ‚¬μš©λ  수 있음

μ§κ°μ’Œν‘œκ³„ → κ΅¬λ©΄μ’Œν‘œκ³„ μ’Œν‘œ λ³€ν™˜

 

 

κ΅¬λ©΄μ’Œν‘œκ³„ → μ§κ°μ’Œν‘œκ³„ μ’Œν‘œ λ³€ν™˜

 

 

μ½”λ“œ μ˜ˆμ‹œ

import math

# 직각 μ’Œν‘œκ³„μ—μ„œ ꡬ면 μ’Œν‘œκ³„λ‘œ λ³€ν™˜ν•˜λŠ” ν•¨μˆ˜
def rectangular_to_spherical(x, y, z):
    # ꡬ의 λ°˜μ§€λ¦„ 계산
    r = math.sqrt(x**2 + y**2 + z**2)
    # μœ„λ„ 계산
    phi = math.acos(z / r)
    # 경도 계산
    theta = math.atan2(y, x)
    return phi, theta

# ꡬ면 μ’Œν‘œκ³„μ—μ„œ 직각 μ’Œν‘œκ³„λ‘œ λ³€ν™˜ν•˜λŠ” ν•¨μˆ˜
def spherical_to_rectangular(phi, theta, r):
    # 직각 μ’Œν‘œ x, y, z 계산
    x = r * math.sin(phi) * math.cos(theta)
    y = r * math.sin(phi) * math.sin(theta)
    z = r * math.cos(phi)
    return x, y, z

# μ˜ˆμ‹œ: 직각 μ’Œν‘œ (1, 1, 1)λ₯Ό ꡬ면 μ’Œν‘œλ‘œ λ³€ν™˜
rectangular_x = 1
rectangular_y = 1
rectangular_z = 1
phi, theta = rectangular_to_spherical(rectangular_x, rectangular_y, rectangular_z)
print("ꡬ면 μ’Œν‘œ (phi, theta):", phi, theta)

# μ˜ˆμ‹œ: ꡬ면 μ’Œν‘œ (pi/4, pi/4)λ₯Ό 직각 μ’Œν‘œλ‘œ λ³€ν™˜
spherical_phi = math.pi / 4  # 45도
spherical_theta = math.pi / 4  # 45도
radius = 1  # μ˜ˆμ‹œλ‘œ λ°˜μ§€λ¦„μ„ 1둜 κ°€μ •
x, y, z = spherical_to_rectangular(spherical_phi, spherical_theta, radius)
print("직각 μ’Œν‘œ (x, y, z):", x, y, z)
λ°˜μ‘ν˜•

'πŸ“– Fundamentals > Computer Vision' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

[객체 κ²€μΆœ] 액컀 λ°•μŠ€(Anchor Box)λž€ 무엇인가? | 객체 κ²€μΆœ λͺ¨λΈμ—μ„œμ˜ μ—­ν• κ³Ό ν•œκ³„  (0) 2024.08.10
Equirectangular Image (λ“±μž₯λ°©ν˜• 이미지) μ„€λͺ… | 이미지 μ’Œν‘œ λ³€ν™˜ | κ΅¬λ©΄μ’Œν‘œ 벑터 계산  (0) 2024.03.29
[객체 κ²€μΆœ] RPN이 λ¬΄μ—‡μΌκΉŒ? | 객체 κ²€μΆœμ—μ„œ 후보 μ˜μ—­μ„ μƒμ„±ν•˜λŠ” λ„€νŠΈμ›Œν¬ | Region Proposal Network μ„€λͺ…  (3) 2023.11.25
[객체 κ²€μΆœ] NMSκ°€ λ¬΄μ—‡μΌκΉŒ? | 객체 κ²€μΆœμ—μ„œ κ²ΉμΉ˜λŠ” bboxλ₯Ό μ œκ±°ν•˜λŠ” 방법 | Non-Maximum Suppression μ„€λͺ…  (0) 2023.11.25
Computer Vision (컴퓨터 λΉ„μ „) 이 λ¬΄μ—‡μΌκΉŒ !?  (1) 2023.04.07
'πŸ“– Fundamentals/Computer Vision' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€
  • [객체 κ²€μΆœ] 액컀 λ°•μŠ€(Anchor Box)λž€ 무엇인가? | 객체 κ²€μΆœ λͺ¨λΈμ—μ„œμ˜ μ—­ν• κ³Ό ν•œκ³„
  • Equirectangular Image (λ“±μž₯λ°©ν˜• 이미지) μ„€λͺ… | 이미지 μ’Œν‘œ λ³€ν™˜ | κ΅¬λ©΄μ’Œν‘œ 벑터 계산
  • [객체 κ²€μΆœ] RPN이 λ¬΄μ—‡μΌκΉŒ? | 객체 κ²€μΆœμ—μ„œ 후보 μ˜μ—­μ„ μƒμ„±ν•˜λŠ” λ„€νŠΈμ›Œν¬ | Region Proposal Network μ„€λͺ…
  • [객체 κ²€μΆœ] NMSκ°€ λ¬΄μ—‡μΌκΉŒ? | 객체 κ²€μΆœμ—μ„œ κ²ΉμΉ˜λŠ” bboxλ₯Ό μ œκ±°ν•˜λŠ” 방법 | Non-Maximum Suppression μ„€λͺ…
뭅즀
뭅즀
AI 기술 λΈ”λ‘œκ·Έ
    λ°˜μ‘ν˜•
  • 뭅즀
    CV DOODLE
    뭅즀
  • 전체
    였늘
    μ–΄μ œ
  • 곡지사항

    • ✨ About Me
    • λΆ„λ₯˜ 전체보기 (198)
      • πŸ“– Fundamentals (33)
        • Computer Vision (9)
        • 3D vision & Graphics (6)
        • AI & ML (15)
        • NLP (2)
        • etc. (1)
      • πŸ› Research (64)
        • Deep Learning (7)
        • Image Classification (2)
        • Detection & Segmentation (17)
        • OCR (7)
        • Multi-modal (4)
        • Generative AI (6)
        • 3D Vision (2)
        • Material & Texture Recognit.. (8)
        • NLP & LLM (11)
        • etc. (0)
      • 🌟 AI & ML Tech (7)
        • AI & ML μΈμ‚¬μ΄νŠΈ (7)
      • πŸ’» Programming (85)
        • Python (18)
        • Computer Vision (12)
        • LLM (4)
        • AI & ML (17)
        • Database (3)
        • Apache Airflow (6)
        • Docker & Kubernetes (14)
        • μ½”λ”© ν…ŒμŠ€νŠΈ (4)
        • C++ (1)
        • etc. (6)
      • πŸ’¬ ETC (3)
        • μ±… 리뷰 (3)
  • 링크

  • 인기 κΈ€

  • νƒœκ·Έ

    object detection
    pandas
    deep learning
    OpenAI
    VLP
    AI
    ν”„λ‘¬ν”„νŠΈμ—”μ§€λ‹ˆμ–΄λ§
    λ”₯λŸ¬λ‹
    OCR
    GPT
    파이썬
    multi-modal
    nlp
    ChatGPT
    LLM
    material recognition
    Computer Vision
    OpenCV
    도컀
    airflow
    컴퓨터비전
    CNN
    pytorch
    Image Classification
    κ°μ²΄κ²€μΆœ
    3D Vision
    객체 κ²€μΆœ
    Text recognition
    segmentation
    Python
  • 졜근 λŒ“κΈ€

  • 졜근 κΈ€

  • hELLOΒ· Designed Byμ •μƒμš°.v4.10.3
뭅즀
μ§κ°μ’Œν‘œκ³„ & κ΅¬λ©΄μ’Œν‘œκ³„ | μ’Œν‘œ λ³€ν™˜
μƒλ‹¨μœΌλ‘œ

ν‹°μŠ€ν† λ¦¬νˆ΄λ°”