intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Bài giảng Xử lý ảnh và ứng dụng: Các phép biến đổi hình học (Image Geometry)

Chia sẻ: _ _ | Ngày: | Loại File: PDF | Số trang:43

3
lượt xem
0
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Bài giảng Xử lý ảnh và ứng dụng: Các phép biến đổi hình học (Image Geometry) sẽ giới thiệu các kỹ thuật thay đổi vị trí và hướng của các pixel trong ảnh. Chương này bao gồm các phép như dịch chuyển, xoay, phóng to, thu nhỏ và biến dạng ảnh. Bạn sẽ hiểu cách các phép biến đổi này được ứng dụng trong việc căn chỉnh, chỉnh sửa, hoặc tạo hiệu ứng hình ảnh. Mời các bạn cùng tham khảo bài giảng để biết thêm chi tiết!

Chủ đề:
Lưu

Nội dung Text: Bài giảng Xử lý ảnh và ứng dụng: Các phép biến đổi hình học (Image Geometry)

  1. CÁC PHÉP BIẾN ĐỔI HÌNH HỌC IMAGE GEOMETRY
  2. Geometric Operations • Scale - change image content size • Rotate - change image content orientation • Reflect - flip over image contents • Translate - change image content position • Affine Transformation • general image content linear geometric transformation 2
  3. Geometric Operations http://what-when-how.com/introduction-to-video-and-image-processing/geometric-transformations-introduction- 3 to-video-and-image-processing-part-1/
  4. Geometric transformations • Geometric transformations are common in computer graphics, and are often used in image analysis. • Geometric transforms permit the elimination of geometric distortion that occurs when an image is captured. • If one attempts to match two different images of the same object, a geometric transformation may be needed. • Applying data augmentation is to increase the generalizability of the model. • Examples? 4
  5. https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/image/ImageDataGenerator 5
  6. https://www.pyimagesearch.com/2019/07/08/keras-imagedatagenerator-and-data-augmentation/ https://machinelearningknowledge.ai/keras-imagedatagenerator-for-image-augmentation/ 6
  7. Geometric Transformations • A geometric transform consists of two basic steps ... • Step1: determining the pixel co-ordinate transformation • mapping of the co-ordinates of the moving image pixel to the point in the fixed image. T(x,y) (x,y) Fixed Image Moving Image 7
  8. Geometric transformations • Step2: determining the brightness of the points in the digital grid of the transformed image. • brightness is usually computed as an interpolation of the brightnesses of several points in the neighborhood. T(x,y) (x,y) Fixed Image Moving Image xformed Moving Image We’ll discuss step 2 first. 8
  9. Interpolation of Data • Given a function f (x) at 4 points, how to “guess” values at other points? x1, x2, x3, x4 are original points X’i are new • Guessing at the function values within the known points range is called interpolation. • Interpolation has great significance in general image/video processing. 9
  10. Another Example Interpolation on an image (4x4 -> 8x8) after scaling Open circle: Original image pixel Closed circle: New pixels 10
  11. Interpolation: Nearest Neighbor 1-D We assign f (xi’ )=f (xj) xj is the original point closest to xi’ The original function values The interpolated values 2-D x’ Original point Interpolated point y’ setting the pixel value on interpolated point to the pixel of closet image point 11
  12. Interpolation: Linear (1D) • General idea: original function values To calculate the interpolated values interpolated values f(x2)-f(x1) 12
  13. Interpolation: Linear (2D) • How a 4x4 image would be interpolated to produce an 8x8 image? f x, y'  f x, y  1  1    f x, y  4 original pixel values f x  1, y'  f x  1, y  1  1    f x  1, y  one interpolated Along the y’ column we have pixel value f x' , y'  f x  1, y'  (1   ) f ( x, y' ) 13
  14. Bilinear Interpolation • Substituting with the values just obtained: f x' , y'   f x  1, y  1  1    f x  1, y   1   f x, y  1  1    f x, y  • You can do the expansion as an exercise. • This is the formulation for bilinear interpolation 14
  15. General Interpolation • We wish to interpolate a value f(x’) for and suppose • We define an interpolated value R(u) and setx1  x'  x2 x' x1   0   1 f ( x' )  R   f x1   R1    f x2  function R(u) is centered at x’ x1 corresponds with u= - , and x2 with u= 1-   1  15
  16. General Interloplation: 0th and 1st orders • Consider 2 functions R0(u) and R1(u) 0if u  0.5  1  uif u  0 R0 (u )  1if    u  0.5 R1 (u )   0if u  0.5 1  uif u  0  Substitute R0(u) for R(u) nearest neighbour interpolation. Substitute R1(u) for R(u) linear interpolation. 16
  17. General Interloplation: 3rd order (Cubic)  1.5 | u |3 2.5 | u |2 1if  u | 1 R3 (u )    0.5 | u |3  2.5 | u | 2 4 | u | 2if 1  u | 2 f ( x ')  R3 (1   ) f ( x1 )  R3 ( ) f ( x2 )  R3 (1   ) f ( x3 )  R3 (2   ) f ( x4 ) 17
  18. General Interpolation: Bicubic (2D) • Bicubic interpolation fits a series of cubic polynomials to the brightness values contained in the 4 x 4 array of pixels surrounding the calculated address. • Step 1: four cubic polynomials F(i), i = 0, 1, 2, 3 are fit to the control points along the rows. The fractional part of the calculated pixel's address in the x-direction is used. 18
  19. General Interpolation: Bicubic • Step 2: the fractional part of the calculated pixel's address in the y-direction is used to fit another cubic polynomial down the column, based on the interpolated brightness values that lie on the curves F(i), i = 0, ..., 3. 19
  20. General Interpolation: Bicubic • Substituting the fractional part of the calculated pixel's address in the x-direction into the resulting cubic polynomial then yields the interpolated pixel's brightness value. 20
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
8=>2