DZDDPZ6 Image filtration. Doc. Dr. Ing. Jiří Horák Institute of Geoinformatics VŠB-TU Ostrava

Podobné dokumenty
DZDDPZ6 Filtrace obrazu. Doc. Dr. Ing. Jiří Horák - Ing. Tomáš Peňáz, Ph.D. Institut geoinformatiky VŠB-TU Ostrava

WORKSHEET 1: LINEAR EQUATION 1

Litosil - application

Transportation Problem

Gymnázium, Brno, Slovanské nám. 7 WORKBOOK. Mathematics. Teacher: Student:

DC circuits with a single source

Lukáš Brodský Praha Osnova. Objektový přístup Verze 4, 5, 6 / 7 Developer7 -funkčnost, nové vlastnosti HW

By David Cameron VE7LTD

Využití hybridní metody vícekriteriálního rozhodování za nejistoty. Michal Koláček, Markéta Matulová

Compression of a Dictionary

CHAPTER 5 MODIFIED MINKOWSKI FRACTAL ANTENNA

LOGOMANUÁL / LOGOMANUAL

EXACT DS OFFICE. The best lens for office work

Introduction to MS Dynamics NAV

Tento materiál byl vytvořen v rámci projektu Operačního programu Vzdělávání pro konkurenceschopnost.

Angličtina v matematických softwarech 2 Vypracovala: Mgr. Bronislava Kreuzingerová

GUIDELINES FOR CONNECTION TO FTP SERVER TO TRANSFER PRINTING DATA

Klepnutím lze upravit styl předlohy. nadpisů. nadpisů.

Gymnázium, Brno, Slovanské nám. 7, SCHEME OF WORK Mathematics SCHEME OF WORK. cz

The Over-Head Cam (OHC) Valve Train Computer Model

Perception Motivated Hybrid Approach to Tone Mapping

Karta předmětu prezenční studium

Vliv metody vyšetřování tvaru brusného kotouče na výslednou přesnost obrobku

Entrance test from mathematics for PhD (with answers)

FIRE INVESTIGATION. Střední průmyslová škola Hranice. Mgr. Radka Vorlová. 19_Fire investigation CZ.1.07/1.5.00/

Radiova meteoricka detekc nı stanice RMDS01A

USING VIDEO IN PRE-SET AND IN-SET TEACHER TRAINING

Image Analysis and MATLAB. Jiří Militky

Database systems. Normal forms

CHAIN TRANSMISSIONS AND WHEELS

Air Quality Improvement Plans 2019 update Analytical part. Ondřej Vlček, Jana Ďoubalová, Zdeňka Chromcová, Hana Škáchová

UPM3 Hybrid Návod na ovládání Čerpadlo UPM3 Hybrid 2-5 Instruction Manual UPM3 Hybrid Circulation Pump 6-9

Dynamic programming. Optimal binary search tree

DATA SHEET. BC516 PNP Darlington transistor. technický list DISCRETE SEMICONDUCTORS Apr 23. Product specification Supersedes data of 1997 Apr 16

SPECIFICATION FOR ALDER LED

STUDY EDITS FOR BETTER TRANSPORT IN THE CENTRE OF NÁCHOD

Dynamic Signals. Ananda V. Mysore SJSU

VY_32_INOVACE_06_Předpřítomný čas_03. Škola: Základní škola Slušovice, okres Zlín, příspěvková organizace

TechoLED H A N D B O O K

Czech Republic. EDUCAnet. Střední odborná škola Pardubice, s.r.o.

A Note on Generation of Sequences of Pseudorandom Numbers with Prescribed Autocorrelation Coefficients

filtrační polomasky disposable respirators

Configuration vs. Conformation. Configuration: Covalent bonds must be broken. Two kinds of isomers to consider

Gymnázium, Brno, Slovanské nám. 7 WORKBOOK. Mathematics. Student: Draw: Convex angle Non-convex angle

Fourth School Year PISTON MACHINES AND PISTON COMPRESSORS

Uni- and multi-dimensional parametric tests for comparison of sample results

Friction drives have constant or variable drives (it means variators). Friction drives are used for the transfer of smaller outputs.

Stojan pro vrtačku plošných spojů

PAINTING SCHEMES CATALOGUE 2012

Dynamic Development of Vocabulary Richness of Text. Miroslav Kubát & Radek Čech University of Ostrava Czech Republic

Výukový materiál v rámci projektu OPVK 1.5 Peníze středním školám

Palmovka Business center Kancelářské prostory k pronájmu / Offices for lease. Na Žertvách 2247/29, Prague 8

Návrh a implementace algoritmů pro adaptivní řízení průmyslových robotů

Zubní pasty v pozměněném složení a novém designu

Aplikace matematiky. Dana Lauerová A note to the theory of periodic solutions of a parabolic equation

Enabling Intelligent Buildings via Smart Sensor Network & Smart Lighting

SEMI-PRODUCTS. 2. The basic classification of semi-products is: standardized semi-products non-standardized semi-products

Klepnutím lze upravit styl předlohy. Klepnutím lze upravit styl předlohy. nadpisů. nadpisů. Aleš Křupka.

Převod prostorových dat katastru nemovitostí do formátu shapefile

STLAČITELNOST. σ σ. během zatížení

User manual SŘHV Online WEB interface for CUSTOMERS June 2017 version 14 VÍTKOVICE STEEL, a.s. vitkovicesteel.com

2011 Jan Janoušek BI-PJP. Evropský sociální fond Praha & EU: Investujeme do vaší budoucnosti

POPIS TUN TAP. Vysvetlivky: Modre - překlad Cervene - nejasnosti Zelene -poznamky. (Chci si ujasnit o kterem bloku z toho schematu se mluvi.

Digital Electronics. Jaroslav Bernkopf. 17 October 2008

Why PRIME? 20 years of Erasmus Programme Over 2 million students in total Annually

HLEDÁNÍ HRAN. Václav Hlaváč. Fakulta elektrotechnická ČVUT v Praze katedra kybernetiky, Centrum strojového vnímání.

Postup objednávky Microsoft Action Pack Subscription

Jak importovat profily do Cura (Windows a

2. Entity, Architecture, Process

Třída: VI. A6 Mgr. Pavla Hamříková VI. B6 RNDr. Karel Pohaněl Schváleno předmětovou komisí dne: Podpis: Šárka Richterková v. r.

KULOVÝ STEREOTEPLOMĚR NOVÝ přístroj pro měření a hodnocení NEROVNOMĚRNÉ TEPELNÉ ZÁTĚŽE

Vánoční sety Christmas sets

Fytomineral. Inovace Innovations. Energy News 04/2008

Social Media a firemní komunikace

Jakub Zavodny (University of Oxford, UK)

LOAD SPECTRUM OF A CAR POWERTRAIN

kupi.cz Michal Mikuš

pánská peněženka / men s wallet size: 13,5 x 11 cm pánská peněženka / men s wallet size: 15 x 9,5 cm

Mikrokvadrotor: Návrh,

MIKROPROCESORY PRO VÝKONOVÉ SYSTÉMY. Stručný úvod do programování v jazyce C 2.díl. České vysoké učení technické Fakulta elektrotechnická

PRODEJNÍ EAUKCE A JEJICH ROSTOUCÍ SEX-APPEAL SELLING EAUCTIONS AND THEIR GROWING APPEAL

Daniel Pitín Sun in the loft Vienna 4

Střední průmyslová škola strojnická Olomouc, tř.17. listopadu 49

VYSOKÁ ŠKOLA HOTELOVÁ V PRAZE 8, SPOL. S R. O.

Department of Mathematical Analysis and Applications of Mathematics Faculty of Science, Palacký University Olomouc Czech Republic

EURO přeshraniční platba

AIC ČESKÁ REPUBLIKA CZECH REPUBLIC

Obrábění robotem se zpětnovazební tuhostí

Bioinformatika a výpočetní biologie. KFC/BIN VII. Fylogenetická analýza

MC Tlumiče (řízení pohybu) MC Damper

ACOUSTIC EMISSION SIGNAL USED FOR EVALUATION OF FAILURES FROM SCRATCH INDENTATION

Aktivita CLIL Chemie III.

TKGA3. Pera a klíny. Projekt "Podpora výuky v cizích jazycích na SPŠT"

SPECIAL THEORY OF RELATIVITY

GENERAL INFORMATION RUČNÍ POHON MANUAL DRIVE MECHANISM

Unit 3 Stereochemistry

Biosensors and Medical Devices Development at VSB Technical University of Ostrava

PixLa PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH

Extrakce nezávislé komponenty

Název společnosti: VPK, s.r.o. Vypracováno kým: Ing. Michal Troščak Telefon: Datum:

Transkript:

DZDDPZ6 Image filtration Doc. Dr. Ing. Jiří Horák Institute of Geoinformatics VŠB-TU Ostrava

Spatial enhancement - filtration Focal operation, using moving window (kernel), new value is calculated in the middle of the window and written into to the final image The whole image is systematically run through (raw by raw) and small surroundings around the point are explored

Spatial frequency Characteristics of digital image Describe the velocity of value changes in the image according to the distance (scale dependent) nulová nízká vysoká prostorová frekvence prostorová frekvence prostorová frekvence zero spatial frequency low spatial frequency high spatial frequency

Convolution Convolution movement of the window by one pixel in the whole area of image matrix Shape of filtration window (Convolution mask, core) - squares, eventually circle (squares with empty edges), irregular squares size 3x3, 5x5, etc. (usually odd number) Marginal pixels of the image not included in the output image (NULL value or reduce the size of the raster) or value replicated

Filtration amendment Filtration usually do not used specific knowledge about the image. Difficulties known surroundings just around the processed point is small. If some a priori information about the image is available (i.e. known statistical parameters of the noise, it can be used in algorithms. From the point of view of the Shannon theory during filtration you will not obtain no new information. You can only supress or enhance some information. If you need to increase the total information content of the image, you have to improve the process of information collection.

User filters ERDAS

User filters TNTmips

Local filtration Distinguish linear and unlinear methods. linear operation calculate the value in the output image as an linear combination of values in the input image in small surroundings O around the representative pixel. Application of the convolution formula. Unlinear methods do not use convolution formula. Median, rotating window etc.

Convolution Formula V f ij dij q q i 1 j 1 F f ij = koeficient konvolučního filtru na pozici i,j (ve filtru) d ij = DN obrazového elementu, který odpovídá f ij q = rozměr filtru (je-li q = 3, má filtr 3x3 hodnot) F = součet koeficientů filtru (ošetření dělení nulou: F=0 => F = 1) V = hodnota výstupního pixelu (v případě, že V<0, => V = nula)

Application of the linear convolution filter 2 6 6 6-1 -1-1 2 6 6 6-1 16-1 2 2 6 6-1 -1-1 2 2 2 6 2 2 2 2 Convolution Kernel Input Data Convolution Filtering integer((-1x) + (-1x6) + (-1x6) + (-1x2) + (16x) + (-1x6) + (-1x2) + (-1x2) + (-1x) : (-1 + -1 + -1 + -1 + 16 + (-1 + -1 + -1 + -1 )) = = int((12-40) : (16-)) = int(/) = int(11) = 11

Acceleration the computation - decomposition Filter separability convolution mask in p-dimension surroundings (usually p=2 or 3) can be decomposed as a multiplication of the one-dimensional masks, which leads to the reduction of number of multiplication and adding

Calculation acceleration reusing Recursive filters Usually inputs to the calculation during convolution are original unchanged values and calculated values are stored into the output image. Using recursive filters values calculated during the previous step (position of the filter mask) are used as the input values in the new calculation (the known part of required values).

Example of the simplest recursive filter One-dimensional mean with (2n+1) points (n from the centre to both sides) Calculation: Compare f(x) and f(x-1), majority of elements are the same, only one is over and one is missing Thus use f(x-1) and only missing points are added and surplus is eliminated Modified calculation (utilisation of the calculation from the previous step):

Local filtration Image enhancement: Low frequency filters Averaging and smoothing, enhancing low frequencies, noise elimination High frequency filters Image sharpening, enhancing high frequencies. Edge operators. enhancing contrast between objects and background. Other utilisation : Postclassification filters modification of classification results. Low frequency filters.

Image smoothing Averaging of more images easiest smoothing of random noise is to use several images of the same scene. Averaging of pixel values on one place. It is NOT filtration. Low frequency filters only 1 image. We confide on data surplus in the image. Neighbour pixels usually have the same or similar value of brightness. The noise can be repaired due to the analysis of brightness in the defined surroundings. New value may be typical value from the neighbourhood or using some combination.

Low frequency filters

Low-Frequency Filtering Decreasing high-frequency information (reduction of DN in the central pixel excessing surrounding values) Decreasing the range of output pixel values => necessity of contrast enhancement Dependency of smoothing level to the size of filter larger filters more smoothing

Linear methods of smoothing Calculate the new value as a linear combination of neighbouring values. The conditions of linear calculation is violate due to the fact that brightness values cannot be negative and even more they are restricted to the value range. Similarly images are limited in the space, thus premises of spatial invariance is valid only for the limited range of convolution masks movement. Convolution can be also performed as a multiplication of the Fourier image of the scene and the Fourier image of the convolution mask.

Low-Frequency Filters Mean filter calculate the mean in the window, round to the integer and write to the central pixel (in the output layer) 1 1 1 1 ), ( 9 1 ), ( k l l j k i f j i p Dobrovolný

Mean filter smoothing Replace the original DN value of the pixel by the mean from the defined surroundings Eliminate errors (degradation) in the image Suitable to reduce noise in the large homogeneous areas unsuitable to reduce noise in certain types of inhomogeneous areas liquidate edges (linear elements) Filtration can be repeated

Mean filter recommended usage ideální obraz degradovaný obraz opravený obraz 6 10 6 9 9 7 10 7 znehodnocení obrazu rekonstrukce obrazu

Mean filter unrecommended usage ideální obraz degradovaný obraz opravený obraz 2 2 2 2 2 2 2 2 2 2 1 2 10 7 2 2 9 4 1 9 1 2 6 3 1 6 4 2 6 4 2 6 4 2 6 3 2 6 3 2 znehodnocení obrazu rekonstrukce obrazu průměrováním Defocus edges

obraz před filtrací Průměrový filtr

Průměrový filtr 3x3 obraz po filtraci

Hlaváč Simple averaging (mean)

p( i, j) 1 1 1 k1l 1 f ( i k, j l) p( i, j)

Dobrovolný

Nonlinear methods of smoothing Nonlinear filtration methods partly eliminate difficulties with edge tearing (defocusing) Selection of homogeneous areas try to find the part of the analysed surroundings (area with approximately same DN), to which the pixel belongs Only pixels of this area are used to search appropriate value (i.e. mean or selection of one DN value), which will represent the whole surroundings in the output image. It is natural to search representatives only inside such object; the selection is the nonlinear operation.

Nonlinear smoothing - methods Mean filter with rotated window Nearest neighbour Ordinary mean with limited changes of values Median filtration Modal filtration Sieve filter Mean filter for linear elements with rotated window Mean filter with inverse gradient Gauss filter

Method of rotated mask Small mask (i.e. 3x3) rotates around the representative point. possible placements of the mask (+ central = 9). Calculate variance of values in each mask. The mask with the smallest variance is selected as a homogeneous surroundings of the representative point. The new value of the representative point can be calculated as a mean in the selected mask = mean with rotated window.

Method of rotated mask Can be used iteratively process relatively quickly converge into stabile status when the image do not change. The size and shape of the mask influence the velocity of convergence. The smaller are the masks, smaller are changes and more iteration are needed.

Mean filter with rotated window Uses the method of rotated mask Smoothing filter advantage - anticipate the occurrence of edges in the image and keep them The method does not blur edges in the image, it has slightly sharpening effect. disadvantage eliminate linear features

Mean filter with rotated window Unsuitable usage Eliminates linear features obraz s liniovým prvkem filtrovaný obraz 5 1 1 1 1 1 5 1 1 1 1 1 5 1 1 1 1 1 5 1 1 1 1 1 5????????????????????????? průměrová filtrace rotujícím oknem

Nearest neighbour Averaging only pixels with close values. It means that the difference between the DN value of the given pixel and the central pixel is less than defined threshold Low variance

Ordinary mean with limited change of values Uses ordinary mean, but protect the blurring of edges enabling only difference of DN change between the input and output values (result of averaging) within some range. If the difference is smaller than the threshold, the result of averaging is used, otherwise the original value is unchanged. Recommended to repair of large area errors without any impact to the rest of the image and for the simple averaging without damaging edges.

Median filtration Use median of the values in surroundings median central member of ordered sequence of values Use sequences with uneven number of members to easy determine the central element (3x3, 5x5) Reduces local noise and edge blurring Can be use iteratively Main disadvantage in rectangle surroundings break thin lines and sharp corners in the image. It requires to use different shape of surroundings. 2 6 7 2,3,5,5,6,7,9,10,10 3 5 9 MEDIAN = 6 5 10 10

Hlaváč Median filtration

Modal filtration Uses mode from the set of values = the most frequent value in the window Advantage keep original values

Sieve filtration Sieve eliminate polygons smaller than given threshold. They are attached to the neighbouring polygons (obtain the value of the larger polygon) Used for modification of classification results Threshold of the area (number of pixels) is required

Averaging for linear features Used when important lines or edges occur in the image Simple averaging destroys linear features Used methods: Variants of rotated window Gradient calculation calculation of variances etc.

Averaging for linear features - filter with rotated window (2nd variant) 4 masks (= rotated window ) are applied they are multiplied with the original image Select the minimal value of these 4 multiplications Such selected mask (window) is suitable for further averaging

Averaging for linear features - averaging with inverse gradient Gradient detects the direction of probable line in the image According to the direction suitable process of averaging is selected I.e. application of Roberts gradient

Averaging with inverse gradient Roberts gradient probability of the edge presence g( i, j) max{ f ( i, j) f ( i 1, j 1), f ( i 1, j) f ( i, j 1) } f(i,j) = grey value g(i,j) = Roberts gradient

Averaging with inverse gradient Mild edge defocusing Redistribution of coefficient weights elimination of the influence of points on edges during the calculation of the value Weight of point contribution : Resulting filtered value for image point: ), ( ), ( max j i g grad j i 1 1 1 1 1 1 1 1 ), ( ), ( )., ( ), ( k l k l F l j k i l j k i l j k i f j i f

Frequently used Gaussian filter Filtration with weights derived from Gauss function V Simple variant for 3x3: p( i, j) 1 9 1 1 k1l 1 V ( i, j)* p( i, Usually we have no sufficient approximation of the Gaussian curve, it is recommended to use the core with 6 σ j)

Gaussian filter For small σ is better to use convolution. convolution core is separable and can be divided into 2 convolutions with one dimensional cores. It results in time reduction thanks to change quadratic dependency of time on the convolution size to linear dependency. First, convolution in X direction is computed and then convolution in Y direction. Computation fastening for large σ: Use Fourier transformation (convolution can be changed to multiplication in Fourier domain) Use recurrent filters - better

High frequency filters

High-Frequency Filters High-Frequency Filters, High-Pass Filters Elimination of low frequency information (increase the difference between central pixel and surroundings) Increase the range of output values of the grey levels Increase spatial frequency of the image

High-Frequency Filters - usage Edge Enhancer and Line enhancer preparation of vectorization Image sharpening Emphasize objects and phenomena smaller then half of the filtration image elimination of objects and phenomena larger then half of the filtration Main classification: Edge and Line Detection Edge and Line Enhancement

Edge vs. Line Discontinuities in the image (in the grey tone image) Significant, or sharp change of values in the image Edge - border between two different surfaces, theoretically zero width Line thin both-sided edge Common edge can be anything with the change of image values according following types (next slide)

Types of edge DN Value DN Value slope DN change 90 0 DN change Slope midpoint Ramp edge x or y x or y Step edge (stupňovitá) DN Value width DN change Line x or y DN Value Width near 0 DN Value Width near 0 DN change DN change Roof edge (střechovitá) x or y x or y Ditch edge (příkopová)

Edge problems Problem of accurate positioning: 1. Too wide area of intensity changes. Where is the edge, in the centre of the area? 2. Ubiquitous noise. What of the intensity changes is an edge and what is noise? The noise should be eliminated by suitable pre-processing using low-frequency linear filters (i.e. Gaussian) or non-linear filters (i.e. median). Edge on the border of 2 different textures: Difficult to detect by classic methods (1st or 2nd order of derivation they find edges inside textures not on their border. Use different methods pattern matching or statistical methods. Problem of multispectral image Does the edge occur in only one band or in some bands?

Edges in multispectral and colour images Point represented by the vector of values Use discontinuities in intensities (brightness) of a multispectral image (weighted sum of brightness from all bands) Use discontinuities in colours of a coloured image (based on a ratio of values from different bands)

Parallel Thinning Edge extraction Line has not the width of 1 pixel Known orientation of edges detection perpendicular to the known direction, the highest value is considered as an axis of the edge, other pixels are set to 0. Unknown orientation of edges window 3x3, testing if the central pixel is useless (then it is set to 0)

Review of high frequency types of filters Edge Enhancers Edge Detectors Zero-Sum Kernels Sobel filter Prewitt filter Laplace operator Canny detector. High Pass Differential Filters Edge Sharpening Filter

Edge Sharpening Filter One of the High Pass Differential Filters. Original image is filtered by the mean filter -> smoothed image smoothed image is subtracted from the original image -> image with remaining high frequency information This image is added to the original image. The resulted image contains enhanced edges and lines. Used for i.e. vectorization

Edge Enhancement (minimum deepening) 204 201 19 200 100 200 197 209 210 + 1 1 1 1 16 1 1 1 1 204 201 19 200 9 200 197 209 210 vstupní obrazová filtr výstupní obrazová data (ostřící operátor) data

Edge Enhancement (increased maximal values) 64 61 5 60 125 60 57 69 70 + 1 1 1 1 16 1 1 1 1 64 61 5 60 17 60 57 69 70 vstupní obrazová filtr výstupní obrazová data (ostřící operátor) data

obraz před filtrací High Pass filter

TNTmips High Pass filter (3 x 3) 0,5 0,5 0,5 0,5 5,5 0,5 0,5 0,5 0,5 3 x 3

High Pass filter (3x3) obraz po filtraci

High Pass filter (5 x 5) - example TNTmips 0,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 15,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 0,5 5 x 5

High Pass filter (5x5) obraz po filtraci

Edges in the image Edge sudden change in image function values. Mathematical tools partial derivation. The change of function is described by its gradient. It is necessary to distinguish direction and size of the gradient. Gradient operators: operators approximating derivations using differences. Several operators are invariant for rotation (i.e. Laplacian operator) and may be calculated by convolution with one mask. Other approximating operators use several masks with different orientation. It is necessary to select this one, which is the best for approximation in the given place. By the mask selection we discover the direction of the gradient (and the edge). zero-crossing operators search the edge where 2nd derivation of image function crosses zero. I.e. Marr-Hildreth operator and Canny edge detector. Operators using local approximation of image function with a simple parametric model. I.e. polynomial function of 2 variables

First order derivation methods The highest change of intensity is in the place of edge occurrence. Homogeneous places are without changes and the first derivation is zero. First order derivation methods = gradient methods. Make a partial derivation of the image according to X axis and then according to Y axis and obtain the vector (orientation and size of the gradient). Gradient is the vector perpendicular to the edge direction. Size of edge and the angle with X-axis are described:

First order derivation methods It is difficult to calculate derivation for discrete image function Approximation by suitable calculation of derivation Usually Central differential Equation is used where O stands for the order of calculation errors

Edge operators Edge operators are more simple then derivations Use convolution kernel Applying convolution of the image with this kernel we obtain the requested component of the gradient Sum of weights = 0

Zero-Sum Kernels Weight of the central member = sum of weights of neighbours output: DN = 0 for homogeneous areas (no edges) DN low for area with a low spatial frequency DN high, extreme - for area with a high spatial frequency

Edge operators - Zero-Sum Kernels

Edge operators Gradient of the scalar field is the vector field It shows the direction of the highest increase of the scalar field Its size corresponds the size of the change

Edge operators gradient measurement of edge occurrence in the image point (i,j) 2 ), ( 2 ), ( ), ( ) ( ) ( j i y j i x j i f f grad ) 1, ( ), ( ), ( j i j i j i x f f f 1), ( ), ( ), ( j i j i j i y f f f ).. ( ), ( ), ( 1 j i x j i y f f tg φ = direction of the edge i, j i-1, j i, j-1 Δy Δx

Roberts Cross Edge Detector Results are influenced by the noise small neighbouring 1 0 0 1 0 1 pro směr X 1 0 pro směr Y Roberts gradient

Simplified Roberts Cross Edge Detector Simple Roberts gradient ) 1, ( ) 1, ( 1) 1, ( ), ( ), ( j i j i j i j i j i f f f f grad P 1 P 2 P 3 P 4 3 2 4 1 ), ( P P P P grad j i

Roberts Cross Edge Detector

Sobel filter Filters enhancing edges of specified direction only Sobel filter enhances all vertical and horizontal edges in the image It is possible to combine both filter windows and calculate Sobel gradient For each direction the value X and Y is calculated as a sum of multiplication of the weight in the filter window and the pixel value The Sobel gradient is then calculated as:

Wiki

example Sobel edge detector

Edge operators jedná se v zásadě o variace na Centrální diferenciální rovnici. Lépe vidět ze separace jader pro Sobelův a Prewittův operátor. Sobelův operátor = výsledek konvoluce mezi Centrální diferenciální rovnicí (diference horizontálně) a jednoduchou aproximací Gaussova nízkofrekvenčního filtru (vertikálně vyhlazení). Prewittové operátor - místo Gaussova filtru použito průměrovací jádro. Tyto operátory používají v jednom směru výpočet diferenciálu a ve směru kolmém používají filtry na potlačení vlivu šumu. Výsledek je lepší, než kdyby se napřed celý obraz rozmazal v obou směrech a teprve na tomto rozmazaném obraze se prováděl výpočet gradientu. Separability se využívá pro větší efektivitu výpočtu, neboť výpočet konvoluce se dvěma 1D jádry je časově méně náročný než s jedním 2D jádrem, což platí pro všechna jádra větší než 2x2 gradientu.

Algoritmus vymezení hran 1. pro každý bod vypočítej x-ovou složku gradientu g x 2. pro každý bod vypočítej y-ovou složku gradientu g y 3. pro každý bod vypočítej velikost gradientu 4. prahuj velikost gradientu s vhodným prahem T Nedostatek - vytváří příliš tlusté hrany, takže ani nevíme, kde přesně se daná hrana nachází. Řešení - Cannyho detektor.

Second order derivation methods Not needed to know the direction and size of edges Only information where the edges occur Places with the highest change of intensity and therefore the highest 1st derivation the 2nd derivation pass through 0.

Edge determination based on the 2nd derivation 2nd derivation can be calculated using double calculation of the 1st derivation. For discrete function Where O function stands for the order of the calculation error Another possibility use some of edge operator for 2nd derivation. Laplacian operators use appropriate 2nd derivation of the Gaussian filter for convolution. c is normalisation member which assure that convolution kernel has the sum of all elements equals 0

Laplace operators - LoG Laplacian operators members of more common family of edge operators Laplacian of Gaussian (LoG). Laplacian operators focused on central points and the sum of all its members are equal 0. Mexican hat The filter produces 0 values in homogeneous areas of the image. Increasing (decreasing) values of pixels which are higher (lower) than surrounding pixels.

Laplacian of Gaussian Advantage of LoG - possibility to select the size of the kernel. It influences its sensitivity. Larger core has a larger resistance for noise. Detected edges depend on the size of kernel. Appropriate size of the kernel is essential for a good result. The kernel size should corresponds to the size of details which we would like to detect (it enhances objects less than half of the kernel size). Disadvantage of LoG non-separability. With the size of the kernel rapidly arises the temporal demandness of the convolutions. Possibility to improve use recursive filters which approximate LoG. Utilization: Filter produces 0 value in homogeneous areas of the image. Increasing (decreasing) values of pixels which are higher (lower) than surrounding pixels. Map of edges (see later)

Difference of Gaussian DoG Another possibility 2nd order derivation DoG (difference of Gaussian) Na obraz se aplikuje 2x Gaussův filtr; jednou s větším parametrem sigma (sigma2) (směrodatná odchylka normální distribuce) a jednou s menším sigma (sigma1). Doporučuje se volit sigma tak, aby poměr sigma2/sigma1=1.6 (je to vhodná aproximace LoG) Výsledné obrazy se od sebe odečtou:

Thresholding to create map of edges postup jak z druhé derivace vytvořit mapu hran = najít místa, kde druhá derivace prochází nulou. Nejjednodušší způsob - prosté prahování. Každý bod s hodnotou nula označit jako hranový bod. Nevýhody: 1. obrazová funkce má druhou derivaci nulovou i v místech, kde má nulovou první derivaci, tedy i uprostřed homogenních oblastí. Prahování tedy za hranové označí i body, které hranové vůbec být nemusejí. 2. k průchodu nulou nemusí nutně docházet v nějakém pixelu, nýbrž mezi dvěma sousedními pixeli. Pak prahovací technika hranové body vůbec nezaznamená.

Using a mask to create map of edges Lépe vyhledávání bodů, ve kterých dochází ke změně znaménka. Vytvoří se maska velikosti 2x2, která se postupně přikládá na všechny body obrazu. Levý horní prvek se bere jako střed masky (a). Tento prvek se porovnává s ostatními prvky. Pokud se znaménko tohoto prvku (a) liší od znaménka některého z ostatních prvků masky, je daný bod (a) označen jako hranový. Masky lze použít ještě k obdobě prahování: bod je označen za hranový jen, pokud je rozdíl hodnot větší než stanovený limit, tj. je splněna ještě dodatečná podmínka: Má-li (a) a např. (b) různá znaménka, musí zároveň platit, že kde T je předem definovaný práh

Pros and cons of 2nd derivation Nevýhody metody druhé derivace (oproti metodám první derivace): vyšší citlivost na šum větší časová náročnost pro velké rozměry masky Výhoda metody druhé derivace: mapa hran obsahuje pouze tenké a uzavřené hrany. Pokud použijeme variantu s prahováním, výsledné hrany zpravidla uzavřené nejsou.

Canny detector J. F. Canny stanovil vlastnosti ideálního hranového detektoru: Minimální chyba detekce hran: Všechny důležité hrany musí být detekovány a nesmí být detekovány žádné falešné hrany. Správná lokalizace: Vzdálenost mezi skutečnou a detekovanou hranou musí být co nejmenší. Pouze jedna odezva: Každá hrana musí být detekovaná pouze jednou. Cannyho detektor by se dal zařadit mezi metody využívající první derivaci. Pro výpočet mapy hran je potřeba znát nejen velikost gradientu, ale i směr.

Algorithm for Canny edge detector 1. Vytvoř 1D konvoluční jádro G σ Gaussova filtru o zadané velikosti sigma (vstupní parametr). 2. Rozmaž obraz jádrem G σ podle osy y a výsledek ulož do G x. Spočítej první derivaci G x podle osy x a výsledek ulož do g x. (Sobelův operátor v 1. ose) 3. Rozmaž obraz jádrem G σ podle osy x a výsledek ulož do G y. Spočítej první derivaci G y podle osy y a výsledek ulož do g y. (Sobelův operátor v 2. ose) 4. Spočítej amplitudu (Sobelův gradient) 5. Ztenči obraz hran podle směru gradientu (Nonmaxima suppression) (při výpočtu 1.derivace vznikají tlusté hrany) 6. Proved hysterezní prahování s prahy T L a T H (vstupní parametry)

Nonmaxima suppression zvláštní poloprahovací technika ztenčení Předpoklad - hrana dává největší odezvu v místě, kde se skutečně nachází. Algoritmus - Pro každý bod b obrazu proved : 1. Urči jeho sousedy r a l ležící ve směru gradientu 2. Je-li b < r nebo b < l, pak přiřad b = 0, jinak neprováděj nic. Tento krok rozpojí hrany v místech, kde jsou křižovatky tvaru T. K rozpojení dojde proto, že vždy je jedna hrana větší než ta druhá. Vliv jejího gradientu je v místě spojení dominantní.

Hysterese thresholding snažíme se eliminovat nevýznamné a falešné hrany. ponechá v obraze pouze ty hrany, jejichž gradient alespoň v některých místech dosahuje požadované limitní velikosti T H.

Output from Canny edge detector Výsledná mapa hran obsahuje tenké neuzavřené hrany. Časová náročnost podobná jako u jiných metod založených na první derivaci Výhodné, pokud je Gaussův filtr naprogramován pomocí rekursivního filtru

Edge detection using template matching Using a special mask which is attached to the checked place. If the response is sufficiently high, then an edge is detected in this point. Pros: Highly noise resistant. The influence of noise depends on the mask size. Ability to detect variance edges (edges created on the border of two different textures). Cons: Dependency on the orientation and shape of the mask and the searched edge. F.e. the mask from the image is unable to detect corners. Time demandness if the image is checked pixel by pixel and all rotation of the mask are applied. How to improve the velocity? 1. Suitable mask construction and calculation of the response. Nemusí se vždy přepočítávat celá maska, ale pouze ta část, ve které došlo k nějaké změně při jejím otočení či posunutí. 2. Preliminary gradient methods (or other edge enhancer) are used to detect places with higher probability of an edge and its orientation and make calculation only for these places and orientations.

Edge detection using statistical methods Similar to methods comparison with the pattern Use a kernel above the checked point in the centre. The special function is applied to calculate values from all pixels in the kernel. The final value enable to understand if the point is some edge is in its neighbouring. filter SUSAN (Smallest Univalue Segment Assimilating Nucleus) Use a circle kernel and function: Variable x 0 represents a centre of the kernel. The threshold T determines the minimal detectable difference. The threshold n max represents the highest value which can be reached in the equation.

nonlinear filter. Pros and cons of SUSAN Edges and corners detected by SUSAN represent places with lowest values. Pros Highly noise resistant. No pre-processing is needed to remove noise. Ability to detect corners Cons Highly time consuming.

Edge Delocalization Only important edges should be detected. To avoid extensive image segmentation (using less important edges) the defocusing methods are applied i.e. Gaussian filters. It causes elimination of less important edges. Disadvantage of the process is Edge Delocalization. Neither Canny detector is able to solve it. Typically when you apply a Gaussian filter to remove unwanted details in the image, detected edges are shifted from the original locations. Higher Gaussian filters causes higher shifting (= higher Edge Delocalization).

Edge Delocalization

Edge Delocalization We need compromising solution between too segmented image and edge delocalization. Solution use different kernel size for detection of important edges and its location (the location is used from the small size kernel application). Scale space: The important feature of Gaussian filter the distance of the detected edge from the real location is dependent on the kernel size. Create several maps of image edges during step-by-step increasing defocusing. Create interval tree. Use the interval tree to reconstruct the inaccurate important edge from the highly defocused image from the more accurate smaller edges from the less defocused images.