[DIP] Image 다루기: 기본편 3;OpenCV 사용하기 (Summary)

2024. 9. 22. 19:58·Programming/DIP
728x90
728x90

1. Basic Operations

image pixel 값에 접근하기: 개별접근과 slicing (NumPy의 FancyIndexing이나 mask를 이용한 방식에 대한 이해도 중요함)

더보기

https://dsaint31.me/mkdocs_site/DIP/cv2/ch01/dip_1_01/#pixel

 

BME228

Basic Operations on Images 목표 pixel의 intensity 또는 color vector의 값을 읽거나 수정하기. image의 property들을 확인하기 ROI 설정하기. image를 여러 축으로 나누거나 합치기. OpenCV의 Python Binding에서 기본 데이

dsaint31.me

 

다음은 NumPy 외에 ndarray에 해당하는 Tensor의 요소를 indexing하는 방법을 다루는 글임 (시간있다면 같이 익혀두길 권함)

https://ds31x.tistory.com/220

 

[DL] Tensor: Indexing <Simple, Slicing, Fancy, Boolean Mask>

numpy나 pytorch, tensorflow의 텐서들도파이썬의 list 또는 tubple 에서의 indexing과 slicing이 거의 그대로 사용됨.2023.07.12 - [Python] - [Python] list (sequence type) : summary [Python] list (sequence type) : summarylist는 ordered

ds31x.tistory.com


image attributes 접근하기

더보기

https://dsaint31.me/mkdocs_site/DIP/cv2/ch01/dip_1_01/#accessing-image-properties

 

BME228

Basic Operations on Images 목표 pixel의 intensity 또는 color vector의 값을 읽거나 수정하기. image의 property들을 확인하기 ROI 설정하기. image를 여러 축으로 나누거나 합치기. OpenCV의 Python Binding에서 기본 데이

dsaint31.me


2. ROI Processing

callback을 이용한 구현.

더보기

2022.10.03 - [Programming/DIP] - [DIP] opencv : Region of Interest (ROI) :

 

[DIP] opencv : Region of Interest (ROI) :

cv2.selectROI가 아닌 이벤트 핸들러(MouseCallback)를 이용한 구현임. x button (or close button)을 지원하기 위한 구현을 추가한 것이며, 여러 윈도우를 띄우는 경우엔 메인 윈도우가 닫히는 경우, 다른 윈도

dsaint31.tistory.com


 

cv2.selectROI 를 이용한 구현.

더보기

2022.10.03 - [Programming/DIP] - [DIP] opencv : Region of Interest (ROI) : cv2.selectROI

 

[DIP] opencv : Region of Interest (ROI) : cv2.selectROI

cv2에서 사각형의 ROI를 선택하는 가장 쉬운 방법. ret_val = cv2.selectROI([window_name], img [, showCrossHair=True, fromCenter=False] window_name : ROI 선택을 수행할 window이름. str img : 보여질 이미지. showCrossHair : ROI 중

dsaint31.tistory.com


3. Splitting and Merging

 

Image Channels 

더보기

https://dsaint31.me/mkdocs_site/DIP/cv2/ch01/dip_1_01/#splitting-and-merging-image-channels

 

BME228

Basic Operations on Images 목표 pixel의 intensity 또는 color vector의 값을 읽거나 수정하기. image의 property들을 확인하기 ROI 설정하기. image를 여러 축으로 나누거나 합치기. OpenCV의 Python Binding에서 기본 데이

dsaint31.me


이미지 합치기, 나누기

더보기

2021.09.11 - [Programming/DIP] - NumPy 배열 병합 : 영상 붙이기

 

NumPy 배열 병합 : 영상 붙이기

1. numpy.vstack numpy.vstack(tup) : Stack arrays in sequence vertically (rowwise) axis 0로 ndarray들을 붙임 2d image라면 위아래로 붙여지게 됨. Simple example import numpy as np a = np.ones((4,3)) b = np.zeros((4,3)) np.vstack( (a,b) ) Image

dsaint31.tistory.com

2021.09.11 - [Programming/DIP] - NumPy 배열 나누기: 영상 자르기

 

NumPy 배열 나누기: 영상 자르기

1. numpy.vsplit numpy.vsplit(array, indices_or_sections) : Split an array into multiple sub-arrays vertically (row-wise) axis 0 (행)로 array를 잘라 나눔. array가 image라면 수직으로 잘려진다. Simple example import numpy as np a = np.arange

dsaint31.tistory.com


4. Image Padding

더보기

https://dsaint31.me/mkdocs_site/DIP/cv2/ch01/dip_1_02/

 

BME228

OpenCV에서 Padding image를 특정 사이즈로 padding해야할 경우에는 cv2.copyMakeBorder() 함수를 사용하면 된다. ret = cv2.copyMakeBorder(src, top, bottom, left, right, padding_type, value) src : input image top : 위로 padding할 pixel

dsaint31.me

 


5. 사칙연산

더보기

https://dsaint31.me/mkdocs_site/DIP/cv2/ch01/dip_1_03/

 

BME228

Arithmetic Operations on Images Goal Image에 적용가능한 다음의 연산들을 소개함. addition, subtraction, bitwise operations etc. NumPy와 OpenCV의 차이점을 확인할 것. Image Addition 두 이미지를 더하는 방법 OpenCV의 cv2.add

dsaint31.me

위의 내용을 위해선 seaborn 라이브러리가 필요함.


6. Scaling (Zooming and Shrinking) and Interpolation

더보기

https://dsaint31.me/mkdocs_site/DIP/cv2/ch02/dip_geometric_transformation/#scaling

2024.09.22 - [Programming/DIP] - [DIP] Interpolation (on Image)

 

[DIP] Interpolation (on Image)

Interpolation (on Image)measure 되지 못한 or 모르는 pixel(or sample)의 값을 주변의 pixel(or sample)들을 이용하여 구하는 과정.Given ($x_0$, $y_0$ ), ( $x_1$ , $y_1$), $\cdots$ ($x_n$, $y_n$), find the value of $y$ at a value of $x$

dsaint31.tistory.com


7. Alpha Blending

더보기

https://dsaint31.me/mkdocs_site/DIP/cv2/ch01/dip_1_04/

 

BME228

Image Blending (or \(\alpha\) Blending) 이것도 이미지 더하기 의 일종이지만, 이미지에 다른 가중치(\(\alpha\))를 부여하여 Blending 또는 transparency (투명감) 느낌을 부여함. 이는 아래 수식에 따라 더해짐: \[

dsaint31.me

2024.09.22 - [Programming/DIP] - [DIP] Image Morphing (Simple)

 

[DIP] Image Morphing (Simple)

Image Morphing은 한 이미지에서 다른 이미지로 부드럽게 전환하는 기술 두 image간에 대응되는 특징점들을 추출하여 mesh를 만들고 이들을 이용하여 부드럽게 전환이 되도록하는 게 일반적이지만,다

dsaint31.tistory.com


8. Bitwise Op.

더보기

2024.09.22 - [Programming/DIP] - [OpenCV] bitwise op.

 

[OpenCV] bitwise op.

Bitwise OperationsAND, OR, NOT, XOR 연산자를 OpenCV가 제공.주로 특정 영역(사각형 모양이 아닌)을 추출하는데 사용됨.True의 representative value는 1이지만, uint8의 경우 255를 사용함.False의 representative value는 0

dsaint31.tistory.com


 


 

 

'Programming > DIP' 카테고리의 다른 글

[DIP] Moirè (모아레) (and Beat)  (3) 2024.09.30
[DIP] cv2.convertSacleAbs(): contrast, brightness 수동조정  (0) 2024.09.23
[DIP] CV2.INTER_AREA  (0) 2024.09.22
[DIP] Interpolation (on Image)  (2) 2024.09.22
[DIP] Image Morphing (Simple)  (0) 2024.09.22
'Programming/DIP' 카테고리의 다른 글
  • [DIP] Moirè (모아레) (and Beat)
  • [DIP] cv2.convertSacleAbs(): contrast, brightness 수동조정
  • [DIP] CV2.INTER_AREA
  • [DIP] Interpolation (on Image)
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (740)
      • Private Life (13)
      • Programming (186)
        • DIP (104)
        • ML (26)
      • Computer (119)
        • CE (53)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (351)
        • Signals and Systems (103)
        • Math (172)
        • Linear Algebra (33)
        • Physics (42)
        • 인성세미나 (1)
      • 정리필요. (54)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (1)
        • PET Study 2009 (1)
        • 방사선 장해방호 (4)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    Python
    Vector
    Probability
    signal_and_system
    numpy
    random
    Optimization
    math
    signals_and_systems
    opencv
    인허가제도
    Term
    function
    linear algebra
    fourier transform
    SS
    검사
    Programming
    SIGNAL
    Convolution
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[DIP] Image 다루기: 기본편 3;OpenCV 사용하기 (Summary)
상단으로

티스토리툴바