• Nebyly nalezeny žádné výsledky

Fakulta elektrotechniky a informatiky Katedra informatiky ______________________________________________________ Detection of Shooting Targets from Images

N/A
N/A
Protected

Academic year: 2022

Podíl "Fakulta elektrotechniky a informatiky Katedra informatiky ______________________________________________________ Detection of Shooting Targets from Images"

Copied!
37
0
0

Načítání.... (zobrazit plný text nyní)

Fulltext

(1)

Katedra informatiky

______________________________________________________

Detection of Shooting Targets from Images

2016 Richard Schneider

(2)
(3)
(4)
(5)

a s

: penCV, Java, A , obraz

Abstract

The aim of this thesis is defined useful methods for searching interference in intercepted target. Based on this searching is possible choose one of method with the best output and implement mobile application for the analysis of shooting targets. Theoretical part describes general principle of analysis, methods suitable for shooting targets analysis and specialises in their disadvantages and advantages.

Next part contains basic usage library OpenCV for operation system Android. User interface for application is defined as next. This thesis includes algorithm gained interference from image of target.

Practical part mentions very important test of analysis focussed on speed and this outputs are evaluated. In the final chapter is designed future possible improvements for shooting targets application.

Key words:Analysis, target, OpenCV, Java, Android, mobile application, image

(6)

Obsah

...5

...6

a digitalizace ... 6

... 6

2.3 Segmentace ... 7

2.4 Popis... 7

2.5 Klasifikace... 7

obraze ...9

3.1 Template Matching ... 9

... 10

3.3 Detekce hran... 10

3.4 Hough Circle Transform ... 10

4 Knihovna OpenCV...12

OpenCV ... 12

4. ... 12

... 12

4.2.2 Funkce cvtColor... 13

4.2.3 Funkce setTo ... 13

4.2.4 Funkce convertTo... 14

...15

5.1 Menu ... 15

... 15

... 16

6 Algoritmus krok za krokem...19

... 19

6.1.1 Blur... 19

... 20

6.2.1 InRange ... 20

(7)

... 21

6.3.1 EqualizeHist ... 21

6.3.2 Canny ... 21

... 22

... 23

7 ...24

... 24

... 25

...28

... 28

8.2 Tra ... 28

... 28

... 29

... 29

...30

10 Reference...31

...32

(8)

RAM - Random Access Memory

CPU - Central Processing Unit

BSD - Berkeley Software Distribution

(9)

Seznam tabulek

Tabulka 1: test rychlosti ... 24

... 26

... 8

... 13

... 14

... 14

... 15

... 16

... 17

... 18

... 19

... 20

... 21

Ilustrace 12: funkce canny, detekce hran ... 22

... 22

... 23

Ilustrace 15: graf testu rychlosti... 25

... 26

... 27

... 28

(10)

Vzhledem k

ch v

,

vlastnilo ke dni 31. 12. 2014 jen v lice 292

elo zhruba 752 000 1. L

k v

k . a.

s obrazem. V

pro mou aplikaci. V knihovn

, a funkce pro s obrazy.

kapitol na

V rozl

V

1 LEX. [online]. [cit. 2016-03- http://gunlex.cz/clanky/informace-lex/2002-pocet-drzitelu- zbrojnich-prukazu-a-zbrani-v-roce-2014

(11)

2

,

lze

2

Z

Segmentace obrazu Popis

Klasifikace.

2.1 v

2.2 v

ho obrazu,

3

2 . Praha 1992, ISBN 80 85424 67 3.

3 233 6,

ISBN 978 80 7300.

(12)

2.3 Segmentace

Segmentace obrazu na objekty

z z

, pokud budeme analyzovat fotografie .

nebo k .

v z

to zpravidla pravda. V s

koeficientem v 1, 1 .

2.4 Popis

nich

kompaktnost.

2.5 Klasifikace

v

(13)

Ilustrace 1:sche

- ,

(14)

,

, nich

c

na jasu. Jednou z obraze neboli Template Matching

Template Matching je metod vzory v obraze. Knihovna OpenCV v

byly s metodu CV_TM_SQDIFF,

KdeIje prohle , T x, y obraze ax,, y,

K

ch

kde , ta . Tyto body lze v

cvMinMaxLoc v .

,

S touto metodou jsem nedo ch kvality. Tato

metoda m krokem

(15)

Matching

v obraze barva a ten m bo

Ale ani

obraze , aby -

kruhu a z obraze Hough Circle

Transform.

obraze a v CV_HOUGH_GRADIENT

k , jinak nedojde k

src circles

CV_HOUGH_GRADIENT dp

min_dist param_1 param_2

min_radius mini max_radius

(16)

Imgproc.HoughCircles(test4, circles, Imgproc.CV_HOUGH_GRADIENT, 1, velikost_stred / 8, 60, presnost, velikost_stred / 12, velikost_stred / 8);

Funkce Hough Circle Transf (x, y), to

Je- ,

v V

nehran poten

, se inkrementuje

v , nost je rovna

.

sebou s y

(17)

4 Knihovna OpenCV

4.1 OpenCV

Knihovnu OpenCV4 v roce 1999 jako open

source knihovnu pro i

5 licence

au o licenci. Knihovna Open

.

platformy Windows, Linux a Mac i na

4.2 4.2.1

obrazy v OpenCV

uchov

rows - 2D poli

cols 2D poli

type ,

rametr na jednu barevnou

[0,255,0]. ( .

:

Mat test = Imgcodecs.imread(cesta);

4OpenCV. [online]. [cit. 2016-03- http://opencv.org/

5BSD. [online]. [cit. 2016-03- https://cs.wikipedia.org/wiki/BSD

(18)

st

src dst

code COLOR_BGR2RGB , COLOR_RGB2GRAY)

DstCn

Imgproc.cvtColor(test1, test2, Imgproc.COLOR_RGB2GRAY, 4);

Ilustrace 2: funk

4.2.3 Funkce setTo Funkce

parametr mask, ,

test3.setTo(new Scalar(0, 0, 0), mask);

(19)

Ilustrace 3: funkce

4.2.4 Funkce convertTo Funkce convertTo

body odstranit.

test4.convertTo(test4, -1, 1.8, 20);

Ilustrace 4

(20)

5.1 Menu

- Analyzuj -

- EXIT

(viz kapitola 8.)

Ilustrace 5

5.2

,

(21)

, a eji, srovnat mobil tak, aby v

-

Ilustrace 6

5.3

a zda jso na displeji

rozhodnout, jestli v

znovu , a to o velikosti,

-

, a y

(22)

Ilustrace 7

V v

lenosti ,

(23)

Ilustrace 8

(24)

6.1

azu, ,

6.1.1 Blur

Blur

- obraze a je-li velikost

src dst ksize anchor

Imgproc.blur(img2, img2, new Size(9, 9), new Point(-1,-1));

Ilustrace 9

(25)

6.2

Maska je v V

obrazu.

6.2.1 InRange

InRange je funkce, obraze a kontrolu u je

v , -li hodnota v ,

src

lowerb nota barev v

upperb dst

Core.inRange(testGray, new Scalar(170, 170, 170), new Scalar(255, 255, 255), mask);

Ilustrace 10 barvy

(26)

6.3

,

, 6.3.1 EqualizeHist

Funkce equalizeHist obraze. Histog si statistika

, kde ,

Ilustrace 11

6.3.2 Canny

Canny je funkce pro detekci hran v obraze, kterou vymyslel Johny F. Canny v roce 1986. Funkce

src dst

lowThreshold highThreshold kernel_size

(27)

V ,

nalezena jen v , bude-

Ilustrace 12: funkce canny, detekce hran

6.4

, a tak , aby

Proto obraz s ,

kterou jsem pomoci funkce blur trochu rozmazal, obraze,

Ilustrace 13

(28)

cle Transform y

Ilustrace 14: funkce Hough Circle Transform

(29)

hlediska rychlosti,

k

mm luger, a

K testu

-U10 CPU: 1190Mhz x 4 RAM: 912MB OS: Android 4.3 -U00 CPU: 1190Mhz x 2 RAM: 410MB OS: Android 4.3

CPU: 1300Mhz x 4 RAM: 956MB OS: Android 5.0.2

4. tablet Lenovo B6000 H CPU: 1209Mhz x 4 RAM: 968MB OS: Android 4.4.2

CPU: 1200Mhz x 8 RAM: 2048MB OS: Android 5.1.1

te

Test rychlosti (s)

Huawei G6-U10 13,4 13,3 12,2 12,8 12,3

Huawei Y530-U00 12,5 13,2 12,1 12,3 11,1

Lenovo A5000 13,3 12,9 13,4 12,5 11,3

Lenovo B6000 H 13 12,7 12,3 11,9 11,3

Huawei Honor 4C 12,2 12,9 12,5 12,5 10,9

Tabulka 1: test rychlosti

(30)

Ilustrace 15: graf testu rychlosti

Z

,

v

ch m

, s

m

, a

(31)

Tabulka 2

Ilustrace 16

Jak z , , kolik je v

pohybuje okolo 95 %, %

.

(32)

Ilustrace 17

Z m

na

, a to okolo 88 %. Ale , t

,

(33)

8.1 e

- Jedna z

8.2

Transformace tak,

sebe.

Ilustrace 18

8.3 Jak bylo

n testech

(34)

sela by se omezit

8.5

(35)

9

obraze, vybrat a pomoc

detektor. S

V obraze. Nebylo by

sal,

,

, jako pro jazyk C++.

, ,

V

Takov

, y

%.

%.

by mohla

a Java

spoustu jak pracovat s obrazem.

(36)

[1] LEX. [online]. [cit. 2016-03- : http://gunlex.cz/clanky/informace-lex/2002-pocet- drzitelu-zbrojnich-prukazu-a-zbrani-v-roce-2014

85424 67 3.

Praha 2008 233 6, ISBN 978 80 7300 [4] OpenCV. [online]. [cit. 2016-03-

[5] BSD. [online]. [cit. 2016-03- dia.org/wiki/BSD

(37)

Odkazy

Související dokumenty

Develop a method based on deep convolutional neural networks for solving the task of the detection of diabetic retinopathy from digital color fundus images of the retina, as defined

The practical part of this thesis applies the knowledge from the theoretical part to a specific company and its conclusion is the evaluation of financial stability and

Core information, financial statements, and methods of financial analysis are introduced in the theoretical part of this thesis.. The practical part of this thesis includes

This method is based on measuring the surface temperature of the wall with infra-red camera, which is influenced by the oscillating heat flow from one side and the convective

The draft NECP does not contain concrete measures that have been already adopted by Czech government (such as in the State Energy Concept or in the Climate Protection Policy) and

This method is based on measuring the surface temperature of the wall with infra-red camera, which is influenced by the oscillating heat flow from one side and the convective

Fakulta elektrotechniky a informatiky VŠB-TU Ostrava!. Katedra telekomunikační

The impact measurement structure is based on the SDGs and tracks progress of 46 outcome indicators and their global targets, the Triple Billion targets on universal health