Coaspe

Computer Vision - Mid Level Image Features: Textures 본문

AI/Vision

Computer Vision - Mid Level Image Features: Textures

Coaspe 2022. 4. 8. 17:58

Textures

Regionspartitions으로 나누고 분류하기 위한 feature 이다.

Colorspatial 정보와 imageintensity 정보를 갖고 있다.

이웃한 픽셀의 intensity level공간적 분포에 의해 texture가 정해진다.

Image intensity에 있는 local variations반복되는 pattern이다. (point로 정의 될 수 없다.)

위의 이미지는 histogram으로 보면 다 같은 intensity 분포를 갖지만, texture을 이용하면 구분이 가능하다.

 

Understanding Texture

Structural

Texture is a set of primitive texels in some regular or repeated relationship (텍셀의 set이다.)

Statistical

Texture is a quantitiative measure of the arrangement of intensities in a regions. This set of measurements is called a feature vector. (region안의 intensities의 정량적인 지표이다.)

Modeling

Texture modeling techniques involve constructing models to specify textures.

 

Aspects of texture

  • Size/Granularity(세분화)
  • Directionality/Orientation - 방향성
  • Random or regular

Structural Approach의 문제점

Texel을 추출하는 것이 불가능한 경우가 많다.

해법 -> Statistical Approach를 사용하자

 

Statistical Approach

 

Texture Analysis

Texture classification - 주어진 region이 어떤 texture region인지 분류하는 것

Texture segmentation - boundary로 regions을 나누는 것

 

Simple Statistical Texture Measure(Color 이용)

Range

convolution 했던 것 처럼 window로 밀고 가면서 그 안의 이웃들 중 가장 밝은 값과 어두운 값의 차이를 구해 value를 재설정하여 output을 만든다.

range가 작다는 것은 contrast가 작다, 매끈하다 하지만 크다는 것은 contrast가 크다, 복잡한 pattern이다.

하지만 나(기준이 되는 픽셀, 중앙의 픽셀)을 고려하여 계산한 값이 아니므로 variance를 사용한다.

 

Variance

Center의 intensity와 인접한 pixels들의 차의 square sum이다.

 

Quantitative Texture Measures (Color 이용)

Local Binary Pattern

높은 지점이 영상의 텍스쳐를 결정한다.(많이 등장하는 텍스쳐라는 뜻이다.)

8 bits를 만들고 중앙의 값보다 크면 1을 부여, 작으면 0을 부여한다.

Simple하지만 성능을 끌어올리기 위해서는 extensions과 modifications가 필요하다

-> Paper reading

 

 

Gray Level Co-occurrence

Display vector을 정하는 것이 중요하다.

 

Normalized GLCM

 

차원이 너무 커지면 다이렉트로 사용 할 수는 없다.

그렇기 때문에 GLCM에서 특정한 feature들만 뽑아서 사용한다.

d vetcor을 평가하는 함수

Windowing

center가 [i, j] 이고 size 가 W

Edge and Texture

Color에서 Contrast가 높은 곳

 

Density and Direction

굵기 방향

 

1. Edge magnitude가 threshold보다 큰 pixels의 비율, R : pixels의 개수가 N인 region

2. Hmagnitude: Normarlized histogram of gradient magnitudes fo region

Hdirection: Normarlized histogram of gradient orientations of region

magnitude + direction (histogram) , 10bins, or 9bins

ex) 10 mag, 8 dir 이면 18 dimension vetor가 region마다 생긴다.

 

Exmaple

왼쪽의 그림은 pixel 하나당 edge가 하나씩 있으므로 edgeness per unit area는 1.0이다.

오른쪽의 그림은 6/25 = 0.24이다.

 

Gradient-direction histogram으로는 3개의 bins을 사용할 것이다. 수평, 수직, 대각

 

왼쪽의 그림은 19개의 light edges, 6개의 dark edges가 있으므로 정규화된 gradient-magnitude histogram은

(0.24 0.76)이다. 그리고 12개의 수평 edges, 13개의 수직 edges, 0개의 대각 edges가 있으므로 정규화된 gradient-direction historgam은 (0.48, 0.52, 0.0) 이다.

 

오른쪽은 gradient-magnitude histogram, gradient-direction historgam 순서대로 (0.0, 0.24) (0.0, 0.0, 0.24)이다.

두 그림의 차이는 맨하튼 거리로 계산 할 수 있다.

 

 

edge를 직접적으로 이용해서 texture를 표현하는 방법의 단점

1. edgness만 이용하면 충분한 정보를 표현하지 못한다.

2. 차원이 많아지면 메모리가 부족해진다.

3. texture의 regular, random한 pattern에 대한 정보를 직접적으로 제공하지 못한다.

-> Laws가 해법을 제시한다.

 

전제 : 영상에서 빈번하게 등장하는 texture pattern의 형태가 있다.

방법 : texture type에 대한 local kernel을 정의하고 그 kernel에 반응하는 정도를 texture-energy로 기술하고 결과로 제시되는 energy의 list로 texture를 표현하겠다.

 

1. kernel(filter)로 convolution 연산 (실제 순서 1)

2. 나오는 행렬에 대해 window를 가지고 인접한 요소들을 합하고 그 중앙에 있는 요소에 부여한다. (실제 순서 3 energy 값 측정)

3. 방향만 다르고 동일한 경우는 후처리를 해준다. (실제 순서 2)

4. L5L5로 TEM image를 정규화 시킨다.

 

Law's Texture Mask 1D

Law's Texture Mask 2D

2개 골라서 곱한다. => 5 X 5 = 25

Edge를 기반으로 둔 mask이기 때문에 L5L5 빼고는 mask의 가중치의 합이 0이 된다.

 

Rotaion invariance

S5L5(Horizontial) + L5S5 (Vertical) = L5S5(Rotainal invariance)

 

Law's Texture Energy

절대값을 합한다.

 

Law'e energy for segmentaion

1. 주변 픽셀의 intensity의 평균으로 나의 intensity를 빼서 illumination effects(조명 변화 때문에 생기는 contrast)를 없앤다. (natural scenes에서는 15 X 15)

2. 16개의 마스크를 적용한다. (5 X 5)

보통 위의 사진의 4개를 사용한다. 그래서 16개의 마스크가 나온다 4 X 4

대칭인 것을 합치면 9개만 남는다.

 

Examples

비슷한 카테고리는 비슷한 값을 갖는다.

 

Autocorrelation for texture

데이터들이 서로 얼마나 상관관계를 갖는가

얼마나 반복적으로 나오는가

조금씩 shift해서 pixel들 간의 상관관계를 확인

분석

 

Summary

 

Structural Approaches: texel을 추출하는 것은 자연 사진에서 거의 불가능하다.

Statistical Approaches

 Simple features: Range, Variance

 Local Binary Pattern(LBP): 8Bits -> Histogram

 Gray Level Co-occurrence Metrix  (GLCM): d vector, Normalized GLCM -> Maximum probability, Entropy,  Moments, correlation, Contrast, Homogeneity

 Edge based features: Magnitude, Direction histogram

 Raw's energy: mask(L5E5) -> Sum absolute -> Auto correlation

Comments