Bài giảng Xử lý ảnh số - Chương 4: Các cấu trúc dữ liệu - Võ Quang Hoàng Khang

pdf 51 trang ngocly 1260
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Xử lý ảnh số - Chương 4: Các cấu trúc dữ liệu - Võ Quang Hoàng Khang", để tải tài liệu gốc về máy bạn click vào nút DOWNLOAD ở trên

Tài liệu đính kèm:

  • pdfbai_giang_xu_ly_anh_so_chuong_4_cac_cau_truc_du_lieu_vo_quan.pdf

Nội dung text: Bài giảng Xử lý ảnh số - Chương 4: Các cấu trúc dữ liệu - Võ Quang Hoàng Khang

  1. Chương 4: CÁC CẤU TRÚC DỮ LIỆU Võ Quang Hoàng Khang TPHCM - 2016
  2. 1. Các mức biểu diễn dữ liệu hình ảnh 2. Traditional data structures 3. Hierarchical data structures 2
  3. Mô tả được các mức biểu diễn hình ảnh. Giải thích được lý do sử dụng các cấu trúc dữ liệu/mã để biểu diễn ảnh. Nhận diện được mục đích sử dụng của các cấu trúc/mã: . Chain . Run-length . Topology . Hierarchical 3
  4. • Iconic image: mức biểu diễn thấp nhất, ma trận số nguyên chứa giá trị về độ sáng của các pixel. • Segmented image: các pixel thuộc về một vùng của cùng một đối tượng. • Geometric representations: hình dạng 2D, 3D. • Relational model: cho chúng ta khả năng xử lý dữ liệu hiệu quả hơn và ở mức độ trừu tượng cao hơn.
  5. • Ma trận - Matrices • Mã xích – Chain Codes • Mã loạt dài - Run Length Codes • Đồ thị - Graphs • Relational databases
  6. • Cấu trúc dữ liệu phổ biến nhất đại diện cho một hình ảnh ở mức thấp (low-level) 100 116 126 129 100 116 126 129  103 106 113 119 103 106 113 119  98 101 106 109 98 101 106 109  96 98 101 105   96 98 101 105  • Ảnh nhị phân: ma trận chỉ chứa các giá trị 0 và 1
  7. • Vùng ảnh (phân đoạn) được biểu diễn bởi đường biên của vùng. • Chain code: đại diện cho một đường biên bằng chuỗi kết nối các đoạn đường thẳng có độ dài và hướng. • Có thể dùng 4-neighbor hoặc 8-neighbor
  8. • Thông tin hữu ích từ chuỗi Chain code: Chu vi của vùng = số phần tử trong chuỗi chain code
  9. • Thay thế chuỗi các giá trị brightness bởi: (hàng, cột bắt đầu, cột kết thúc)
  10. • Mô tả ảnh bởi tập các phần tử và mối quan hệ giữa chúng: • đồ thị vùng liền kề • relational structures
  11. 0 1 5 2 3 6 4
  12. 0 • node: vùng • arcs: các vùng lân cận 1 5 2 0 3 6 4 1 2 6 3 5 4
  13. 1 5 2 3 6 4 Object Name Density (x,y) Inside 1 Background 8 (1,1) 2 Chest wall 140 (347,107) 1 3 Right lung 35 (145,159) 2 4 Left lung 35 (357,146) 2 5 Heart 142 (259,165) 2 6 Aorta 148 (280,319) 2
  14. . Phân tích hình ảnh ở các độ phân giải khác nhau: – M-pyramids (matrix-pyramids) – T-pyramids (tree-pyramids)
  15. • A sequence of images {ML, ML-1, , M0} ML ML-1 ML-2 ML-3 ML-4 ML-5
  16. • ML represents the original image • Mi-1 is derived from Mi by reducing the resolution by a factor of 2 ML ML-1 ML-2 ML-3 ML-4 ML-5 256 x 256 128 x 128 64 x 64 32 x 32 16 x 16 8 x 8
  17. . Phân tích ảnh ở các độ phân giải khác nhau cùng một lúc
  18. • Cho phép phân tích ảnh ở các độ phân giải khác nhau cùng một lúc 20 x 20 Level 0 21 x 21 Level 1 22 x 22 Level 2 L-2 L-2 2 x 2 Level L-2 (ML-2) 2L-1 x 2L-1 Level L-1 (ML-1) 2L x 2L Level L (ML)
  19. • T-pyramid biểu diễn đầy đủ CTDL dạng cây theo phương pháp tiếp cận “bottom-up“. • Quadtrees là một modify của T-pyramid. • Mỗi node của Tree có 4 con.
  20. • Begin with the original 2L x 2L image Level 0
  21. • Begin with the original 2L x 2L image and divide it into 4 quadrants each of dimension 2L-1 x 2L-1 Level 0 0 1 0 1 2 3 2 3
  22. • Tiếp tục chia nhỏ các nút nếu chưa thỏa mãn tiêu chí đồng nhất. Level 0 8 9 0 0 2 3 10 11 Level 2 8 9 10 11 2 3
  23. • Lặp lại cho đến khi thỏa mãn tiêu chí đồng nhất Level 0 36 37 9 38 39 0 48 49 0 2 3 10 50 51 Level 2 9 10 2 3 Level 3 36 37 38 39 48 49 50 51
  24. • A binary image Level 0
  25. Level 0 1 1 2 2
  26. Level 0 5 1 1 2 6 7 5 6 7 16 17 18 19 16 17 2 18 19
  27. Level 0 20 21 5 22 23 1 1 2 6 7 5 6 7 16 17 18 19 16 17 2 Level 3 20 21 22 23 18 19
  28. 1 2 5 6 7 16 17 18 19 20 21 22 23 •Cây có thể được mã hóa bởi một chuỗi các kí tự: b, w, và g.
  29. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( )
  30. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( ) )
  31. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b ) )
  32. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b ) )
  33. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w ) )
  34. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) )
  35. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b )
  36. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b w )
  37. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b w g( ) )
  38. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b w g( b ) )
  39. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b w g( b b ) )
  40. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b w g( b b w ) )
  41. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b w g( b b w g( ) ) )
  42. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b w g( b b w g( b ) ) )
  43. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b w g( b b w g( b b ) ) )
  44. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b w g( b b w g( b b w ) ) )
  45. 1 2 5 6 7 16 17 18 19 20 21 22 23 Code: g( g( b b w w ) b w g( b b w g( b b w w ) ) )
  46. Level of image data representation Data structures together with algorithms are used to devise solutions to computational tasks. Data structures for vision may be loosely classified as . * Iconic . * Segmented . * Geometric . * Relational *Boundaries between these layers may not be well defined.
  47. Traditional image data structures The matrix (2D array) is the most common data structure used for low- level representations, implemented as an array. Matrices hold image data explicitly. Spatial characteristics are implicitly available. Binary images are represented by binary matrices; multispectral images are represented by binary matrices; Hierarchical image structures are represented by matrices of different dimensions; The co-occurrence matrix is an example of global information derived from an image matrix; it is useful in describing texture.
  48. Traditional image data structures cont. Chains may be used to describe pixel paths, especially borders. Chain codes are useful for recognition based on syntactic approaches. Run length codes are useful for simple image compression. Graph structures may be used to describe regions and their adjacency. These may be derived from a region map, a matrix of the same size as the image. Relational structures may be used to describe semantic relationships between image regions.
  49. Hierarchical data structures Hierarchical structures can be used to extract large-scale features, which may be used to initialize analysis.They can provide significant computational efficiency. M-pyramids and T-pyramids provide data structures to describe multiple image resolutions. Quadtrees are a variety of T-pyramid in which selected areas of an image are stored at higher resolution than others, permitting selective extraction of detail. Many algorithms for manipulation of quadtrees are available. Quadtrees are prone to great variation from small image differences. Leaf codes provide a more efficient form of quadtree. Many ways of deriving pyramids exist, dependent on choice of reduction window.