Compare commits
128
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d8284ecf1 | ||
|
|
952d9e8e3f | ||
|
|
380a46c1ed | ||
|
|
c3766e7cc2 | ||
|
|
95789bb593 | ||
|
|
e0d896d89e | ||
|
|
a86f0f0954 | ||
|
|
ec594e755c | ||
|
|
3378e6451b | ||
|
|
5bb5dec0f5 | ||
|
|
15373fd07d | ||
|
|
19e70d9d8f | ||
|
|
1c81151e67 | ||
|
|
681ff9879f | ||
|
|
f0e5f51fcb | ||
|
|
f57fd48b56 | ||
|
|
e6308463f0 | ||
|
|
f717d655c6 | ||
|
|
e0afea734b | ||
|
|
b4464b3b76 | ||
|
|
fbb5a28f23 | ||
|
|
d9947d100c | ||
|
|
544f0f5dcc | ||
|
|
ce8ed0c18a | ||
|
|
99b3bfae9c | ||
|
|
56213fd2bf | ||
|
|
00dfb9c11c | ||
|
|
d3440b193b | ||
|
|
e996ebf61b | ||
|
|
903ebaf926 | ||
|
|
c6a21cb38c | ||
|
|
95252b375b | ||
|
|
a2ec9f4eb1 | ||
|
|
a21a74d7c1 | ||
|
|
0839b32c14 | ||
|
|
a1d4cbc462 | ||
|
|
91ad5059f5 | ||
|
|
f21d8859c8 | ||
|
|
c0783c4416 | ||
|
|
806e56d942 | ||
|
|
f0a6decb2a | ||
|
|
3b88b4e001 | ||
|
|
58c99fcf83 | ||
|
|
4ab4059991 | ||
|
|
5a6b4b6bf5 | ||
|
|
b498cbd7cf | ||
|
|
cd49b1c20e | ||
|
|
dae7057d74 | ||
|
|
89fcd4273b | ||
|
|
f3e7c39bc9 | ||
|
|
cb69705ba6 | ||
|
|
a7d0c6c67e | ||
|
|
213f4bcf0c | ||
|
|
c86afd351a | ||
|
|
c9bf11a2f0 | ||
|
|
289d1afe2f | ||
|
|
e1c3d2750a | ||
|
|
25cdc5bd71 | ||
|
|
6c23135ff0 | ||
|
|
4bb0680a9e | ||
|
|
711b37a119 | ||
|
|
69667112bd | ||
|
|
9f20fca8c6 | ||
|
|
745bb81c9f | ||
|
|
7b90ee6ba3 | ||
|
|
7aeff660cf | ||
|
|
a0a3e2e36b | ||
|
|
2fad46fe4c | ||
|
|
17e8d5b751 | ||
|
|
96ce0e4cff | ||
|
|
b5324a3512 | ||
|
|
05dbcee816 | ||
|
|
ab7b6cdd1e | ||
|
|
056e4d8d94 | ||
|
|
45ae7f4e73 | ||
|
|
2477a941a3 | ||
|
|
ea79a9fd8c | ||
|
|
2ea7b68e78 | ||
|
|
779fcb17b6 | ||
|
|
d85606305e | ||
|
|
2241afe955 | ||
|
|
9a504f5be4 | ||
|
|
71ae13ab11 | ||
|
|
6220f2f19b | ||
|
|
e91ba11dc3 | ||
|
|
a7e3f0b7c6 | ||
|
|
cb4112ba2c | ||
|
|
8dca053e8d | ||
|
|
d61b808f79 | ||
|
|
32003a5990 | ||
|
|
4371879df2 | ||
|
|
e02d3fbf12 | ||
|
|
c369c8d447 | ||
|
|
4885538811 | ||
|
|
c2df9fea04 | ||
|
|
5233f6b519 | ||
|
|
8202db8c3c | ||
|
|
261316cca7 | ||
|
|
c758354ac4 | ||
|
|
00cae1a2b3 | ||
|
|
05beb1ffa9 | ||
|
|
d166f1f443 | ||
|
|
7a3510a7e4 | ||
|
|
a07792c6c4 | ||
|
|
4317a0bc1a | ||
|
|
310e63a975 | ||
|
|
1a62c12bd9 | ||
|
|
d9c4e5e2ed | ||
|
|
4b437201f1 | ||
|
|
d66ed986b3 | ||
|
|
5b07b940fc | ||
|
|
185beb9b98 | ||
|
|
c195cbbbb1 | ||
|
|
8f9a20ae0d | ||
|
|
c2a6e881be | ||
|
|
3f6fd60777 | ||
|
|
ab62b33d7b | ||
|
|
66655b03f4 | ||
|
|
9e5cf49d04 | ||
|
|
6c876b94eb | ||
|
|
184c6890c1 | ||
|
|
4db2768073 | ||
|
|
8b8b1f9394 | ||
|
|
55dc76a057 | ||
|
|
c7f03d8a5d | ||
|
|
ed059aa01e | ||
|
|
4a89b54d9a | ||
|
|
4fa2a825a8 |
+20
@@ -44,3 +44,23 @@ build/
|
|||||||
|
|
||||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
hs_err_pid*
|
hs_err_pid*
|
||||||
|
|
||||||
|
*.pdb
|
||||||
|
*.ipdb
|
||||||
|
*.iobj
|
||||||
|
*.exe
|
||||||
|
*.ilk
|
||||||
|
*.tlog
|
||||||
|
*.obj
|
||||||
|
*.idb
|
||||||
|
*.user
|
||||||
|
*.filters
|
||||||
|
*.vcxproj
|
||||||
|
*.ipch
|
||||||
|
*.opendb
|
||||||
|
*.db
|
||||||
|
*.suo
|
||||||
|
*.sln
|
||||||
|
|
||||||
|
*.bib.bak
|
||||||
|
*.bib.sav
|
||||||
|
|||||||
@@ -0,0 +1,566 @@
|
|||||||
|
Prozessor: Intel(R) Core(TM) i7-7800X CPU @ 3.5GHz
|
||||||
|
GPU: NVIDIA GeForce GTX 1080 Ti
|
||||||
|
RAM: 32GB
|
||||||
|
|
||||||
|
Log:
|
||||||
|
|
||||||
|
some print statement
|
||||||
|
2020-März-27 10:27:02 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Loading opencv dll
|
||||||
|
2020-März-27 10:27:02 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Loading CUDA module
|
||||||
|
2020-März-27 10:27:03 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Number of Cuda enabled devices: 1
|
||||||
|
2020-März-27 10:27:03 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - creating EventHandler
|
||||||
|
2020-März-27 10:27:03 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - loading and verifying test images
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - test image sizes: 741x500, 1482x1000, 2223x1500, 2964x2000, 3705x2500
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - stereo test image sizes: 741x500, 1482x1000, 2223x1500, 2964x2000, 3705x2500
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Some hardware information:
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - OS name: Windows 10
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - OS type: amd64
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - OS version: 10.0
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - System environment information:
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Processor identifier: Intel64 Family 6 Model 85 Stepping 4, GenuineIntel
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Processor architecture: AMD64
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Number of processors: 12
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - CUDA information following:
|
||||||
|
*** CUDA Device Query (Runtime API) version (CUDART static linking) ***
|
||||||
|
|
||||||
|
Device count: 1
|
||||||
|
|
||||||
|
Device 0: "GeForce GTX 1080 Ti"
|
||||||
|
CUDA Driver Version / Runtime Version 10.20 / 10.10
|
||||||
|
CUDA Capability Major/Minor version number: 6.1
|
||||||
|
Total amount of global memory: 11264 MBytes (11811160064 bytes)
|
||||||
|
GPU Clock Speed: 1.58 GHz
|
||||||
|
Max Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072,65536), 3D=(16384,16384,16384)
|
||||||
|
Max Layered Texture Size (dim) x layers 1D=(32768) x 2048, 2D=(32768,32768) x 2048
|
||||||
|
Total amount of constant memory: 65536 bytes
|
||||||
|
Total amount of shared memory per block: 49152 bytes
|
||||||
|
Total number of registers available per block: 65536
|
||||||
|
Warp size: 32
|
||||||
|
Maximum number of threads per block: 1024
|
||||||
|
Maximum sizes of each dimension of a block: 1024 x 1024 x 64
|
||||||
|
Maximum sizes of each dimension of a grid: 2147483647 x 65535 x 65535
|
||||||
|
Maximum memory pitch: 2147483647 bytes
|
||||||
|
Texture alignment: 512 bytes
|
||||||
|
Concurrent copy and execution: Yes with 2 copy engine(s)
|
||||||
|
Run time limit on kernels: Yes
|
||||||
|
Integrated GPU sharing Host Memory: No
|
||||||
|
Support host page-locked memory mapping: Yes
|
||||||
|
Concurrent kernel execution: Yes
|
||||||
|
Alignment requirement for Surfaces: Yes
|
||||||
|
Device has ECC support enabled: No
|
||||||
|
Device is using TCC driver mode: No
|
||||||
|
Device supports Unified Addressing (UVA): Yes
|
||||||
|
Device PCI Bus ID / PCI location ID: 101 / 0
|
||||||
|
Compute Mode:
|
||||||
|
Default (multiple host threads can use ::cudaSetDevice() with device simultaneously)
|
||||||
|
|
||||||
|
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.20, CUDA Runtime Version = 10.10, NumDevs = 1
|
||||||
|
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.GpuTestSystem - starting tests
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.events.EventHandler - The following tasks will be tested:
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.events.EventHandler - UploadDownloadTask
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.events.EventHandler - PageLockedUploadDownloadTask
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.events.EventHandler - PixelWiseTask
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.events.EventHandler - KernelTask
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.events.EventHandler - ImgProcTask
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.events.EventHandler - PipelineTask
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.events.EventHandler - FeatureBasedTask
|
||||||
|
2020-März-27 10:27:05 vorm. [main] INFO de.unidue.nes.gpu.GpuTestSystem - Running tasks so dlls get loaded
|
||||||
|
starting UploadDownloadTask
|
||||||
|
starting PageLockedUploadDownloadTask
|
||||||
|
starting PixelWiseTask
|
||||||
|
starting KernelTask
|
||||||
|
starting ImgProcTask
|
||||||
|
starting PipelineTask
|
||||||
|
starting FeatureBasedTask
|
||||||
|
2020-März-27 10:32:24 vorm. [main] INFO de.unidue.nes.gpu.GpuTestSystem - Now starting tasks to measure performance
|
||||||
|
2020-März-27 10:32:25 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 350x232 took 10.0ms.
|
||||||
|
2020-März-27 10:32:26 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 741x500 took 28.8ms.
|
||||||
|
2020-März-27 10:32:26 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 875x580 took 37.3ms.
|
||||||
|
2020-März-27 10:32:27 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 1482x1000 took 86.5ms.
|
||||||
|
2020-März-27 10:32:28 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 1750x1160 took 126.4ms.
|
||||||
|
2020-März-27 10:32:30 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 2223x1500 took 202.0ms.
|
||||||
|
2020-März-27 10:32:33 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 2625x1740 took 273.1ms.
|
||||||
|
2020-März-27 10:32:37 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 2964x2000 took 373.0ms.
|
||||||
|
2020-März-27 10:32:42 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 3500x2320 took 496.2ms.
|
||||||
|
2020-März-27 10:32:47 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 3705x2500 took 562.9ms.
|
||||||
|
2020-März-27 10:32:47 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 350x232 took 13.2ms.
|
||||||
|
2020-März-27 10:32:48 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 741x500 took 38.1ms.
|
||||||
|
2020-März-27 10:32:48 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 875x580 took 44.0ms.
|
||||||
|
2020-März-27 10:32:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 1482x1000 took 99.0ms.
|
||||||
|
2020-März-27 10:32:51 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 1750x1160 took 130.3ms.
|
||||||
|
2020-März-27 10:32:53 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 2223x1500 took 207.4ms.
|
||||||
|
2020-März-27 10:32:55 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 2625x1740 took 284.4ms.
|
||||||
|
2020-März-27 10:32:59 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 2964x2000 took 347.2ms.
|
||||||
|
2020-März-27 10:33:04 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 3500x2320 took 473.1ms.
|
||||||
|
2020-März-27 10:33:09 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 3705x2500 took 535.4ms.
|
||||||
|
2020-März-27 10:33:09 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 350x232 took 21.3ms.
|
||||||
|
2020-März-27 10:33:10 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 741x500 took 62.0ms.
|
||||||
|
2020-März-27 10:33:11 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 875x580 took 76.6ms.
|
||||||
|
2020-März-27 10:33:13 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 1482x1000 took 193.1ms.
|
||||||
|
2020-März-27 10:33:15 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 1750x1160 took 262.5ms.
|
||||||
|
2020-März-27 10:33:19 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 2223x1500 took 421.8ms.
|
||||||
|
2020-März-27 10:33:25 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 2625x1740 took 566.9ms.
|
||||||
|
2020-März-27 10:33:32 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 2964x2000 took 723.4ms.
|
||||||
|
2020-März-27 10:33:42 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 3500x2320 took 974.3ms.
|
||||||
|
2020-März-27 10:33:53 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 3705x2500 took 1134.0ms.
|
||||||
|
2020-März-27 10:33:55 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 350x232 took 5.1ms.
|
||||||
|
2020-März-27 10:33:55 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 741x500 took 15.0ms.
|
||||||
|
2020-März-27 10:33:55 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 875x580 took 17.4ms.
|
||||||
|
2020-März-27 10:33:55 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 1482x1000 took 50.2ms.
|
||||||
|
2020-März-27 10:33:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 1750x1160 took 62.0ms.
|
||||||
|
2020-März-27 10:33:57 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 2223x1500 took 106.4ms.
|
||||||
|
2020-März-27 10:33:58 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 2625x1740 took 121.2ms.
|
||||||
|
2020-März-27 10:34:00 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 2964x2000 took 183.2ms.
|
||||||
|
2020-März-27 10:34:02 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 3500x2320 took 230.2ms.
|
||||||
|
2020-März-27 10:34:05 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 3705x2500 took 259.3ms.
|
||||||
|
2020-März-27 10:34:05 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 350x232 took 12.2ms.
|
||||||
|
2020-März-27 10:34:06 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 741x500 took 37.5ms.
|
||||||
|
2020-März-27 10:34:06 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 875x580 took 45.3ms.
|
||||||
|
2020-März-27 10:34:07 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 1482x1000 took 99.2ms.
|
||||||
|
2020-März-27 10:34:08 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 1750x1160 took 129.5ms.
|
||||||
|
2020-März-27 10:34:10 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 2223x1500 took 205.1ms.
|
||||||
|
2020-März-27 10:34:13 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 2625x1740 took 285.8ms.
|
||||||
|
2020-März-27 10:34:17 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 2964x2000 took 352.9ms.
|
||||||
|
2020-März-27 10:34:22 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 3500x2320 took 473.7ms.
|
||||||
|
2020-März-27 10:34:27 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 3705x2500 took 554.4ms.
|
||||||
|
2020-März-27 10:34:27 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 350x232 took 11.2ms.
|
||||||
|
2020-März-27 10:34:28 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 741x500 took 28.6ms.
|
||||||
|
2020-März-27 10:34:28 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 875x580 took 34.7ms.
|
||||||
|
2020-März-27 10:34:29 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 1482x1000 took 98.0ms.
|
||||||
|
2020-März-27 10:34:30 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 1750x1160 took 120.1ms.
|
||||||
|
2020-März-27 10:34:32 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 2223x1500 took 203.1ms.
|
||||||
|
2020-März-27 10:34:34 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 2625x1740 took 235.4ms.
|
||||||
|
2020-März-27 10:34:38 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 2964x2000 took 356.1ms.
|
||||||
|
2020-März-27 10:34:42 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 3500x2320 took 446.1ms.
|
||||||
|
2020-März-27 10:34:47 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 3705x2500 took 499.8ms.
|
||||||
|
2020-März-27 10:34:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 350x232 took 0.0ms.
|
||||||
|
2020-März-27 10:34:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 741x500 took 1.0ms.
|
||||||
|
2020-März-27 10:34:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 875x580 took 1.0ms.
|
||||||
|
2020-März-27 10:34:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 1482x1000 took 3.0ms.
|
||||||
|
2020-März-27 10:34:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 1750x1160 took 4.0ms.
|
||||||
|
2020-März-27 10:34:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 2223x1500 took 6.2ms.
|
||||||
|
2020-März-27 10:34:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 2625x1740 took 10.0ms.
|
||||||
|
2020-März-27 10:34:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 2964x2000 took 15.5ms.
|
||||||
|
2020-März-27 10:34:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 3500x2320 took 32.8ms.
|
||||||
|
2020-März-27 10:34:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 3705x2500 took 43.9ms.
|
||||||
|
2020-März-27 10:34:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 350x232 took 4.0ms.
|
||||||
|
2020-März-27 10:34:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 741x500 took 4.0ms.
|
||||||
|
2020-März-27 10:34:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 875x580 took 4.0ms.
|
||||||
|
2020-März-27 10:34:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 1482x1000 took 5.1ms.
|
||||||
|
2020-März-27 10:34:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 1750x1160 took 5.4ms.
|
||||||
|
2020-März-27 10:34:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 2223x1500 took 6.5ms.
|
||||||
|
2020-März-27 10:34:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 2625x1740 took 7.4ms.
|
||||||
|
2020-März-27 10:34:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 2964x2000 took 8.1ms.
|
||||||
|
2020-März-27 10:34:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 3500x2320 took 10.6ms.
|
||||||
|
2020-März-27 10:34:51 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 3705x2500 took 9.8ms.
|
||||||
|
2020-März-27 10:34:52 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 350x232 took 3.0ms
|
||||||
|
2020-März-27 10:34:52 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 741x500 took 6.0ms
|
||||||
|
2020-März-27 10:34:52 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 875x580 took 4.0ms
|
||||||
|
2020-März-27 10:34:52 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 1482x1000 took 13.0ms
|
||||||
|
2020-März-27 10:34:52 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 1750x1160 took 17.6ms
|
||||||
|
2020-März-27 10:34:52 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 2223x1500 took 31.5ms
|
||||||
|
2020-März-27 10:34:53 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 2625x1740 took 45.9ms
|
||||||
|
2020-März-27 10:34:54 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 2964x2000 took 66.3ms
|
||||||
|
2020-März-27 10:34:55 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 3500x2320 took 99.3ms
|
||||||
|
2020-März-27 10:34:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 3705x2500 took 105.6ms
|
||||||
|
2020-März-27 10:34:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 350x232 took 4.0ms
|
||||||
|
2020-März-27 10:34:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 741x500 took 4.4ms
|
||||||
|
2020-März-27 10:34:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 875x580 took 4.5ms
|
||||||
|
2020-März-27 10:34:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 1482x1000 took 8.4ms
|
||||||
|
2020-März-27 10:34:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 1750x1160 took 7.9ms
|
||||||
|
2020-März-27 10:34:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 2223x1500 took 9.6ms
|
||||||
|
2020-März-27 10:34:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 2625x1740 took 10.2ms
|
||||||
|
2020-März-27 10:34:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 2964x2000 took 12.2ms
|
||||||
|
2020-März-27 10:34:57 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 3500x2320 took 17.2ms
|
||||||
|
2020-März-27 10:34:57 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 3705x2500 took 18.1ms
|
||||||
|
2020-März-27 10:35:00 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 350x232 took 259.9ms
|
||||||
|
2020-März-27 10:35:12 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 741x500 took 1160.3ms
|
||||||
|
2020-März-27 10:35:28 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 875x580 took 1549.4ms
|
||||||
|
2020-März-27 10:36:12 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 1482x1000 took 4444.1ms
|
||||||
|
2020-März-27 10:37:13 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 1750x1160 took 6098.8ms
|
||||||
|
2020-März-27 10:38:53 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 2223x1500 took 9947.4ms
|
||||||
|
2020-März-27 10:41:09 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 2625x1740 took 13691.6ms
|
||||||
|
2020-März-27 10:44:03 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 2964x2000 took 17374.5ms
|
||||||
|
2020-März-27 10:48:09 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 3500x2320 took 24565.0ms
|
||||||
|
2020-März-27 10:52:37 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 3705x2500 took 26852.5ms
|
||||||
|
2020-März-27 10:52:38 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 350x232 took 15.6ms
|
||||||
|
2020-März-27 10:52:38 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 741x500 took 40.0ms
|
||||||
|
2020-März-27 10:52:38 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 875x580 took 50.2ms
|
||||||
|
2020-März-27 10:52:39 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 1482x1000 took 99.2ms
|
||||||
|
2020-März-27 10:52:41 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 1750x1160 took 126.4ms
|
||||||
|
2020-März-27 10:52:43 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 2223x1500 took 184.2ms
|
||||||
|
2020-März-27 10:52:45 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 2625x1740 took 218.1ms
|
||||||
|
2020-März-27 10:52:48 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 2964x2000 took 283.3ms
|
||||||
|
2020-März-27 10:52:51 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 3500x2320 took 382.1ms
|
||||||
|
2020-März-27 10:52:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 3705x2500 took 422.2ms
|
||||||
|
2020-März-27 10:52:58 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 350x232 took 233.5ms
|
||||||
|
2020-März-27 10:53:06 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 741x500 took 821.8ms
|
||||||
|
2020-März-27 10:53:18 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 875x580 took 1152.9ms
|
||||||
|
2020-März-27 10:53:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 1482x1000 took 3095.7ms
|
||||||
|
2020-März-27 10:54:30 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 1750x1160 took 4134.6ms
|
||||||
|
2020-März-27 10:55:37 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 2223x1500 took 6700.2ms
|
||||||
|
2020-März-27 10:57:09 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 2625x1740 took 9196.2ms
|
||||||
|
2020-März-27 10:59:06 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 2964x2000 took 11664.3ms
|
||||||
|
2020-März-27 11:01:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 3500x2320 took 16292.3ms
|
||||||
|
2020-März-27 11:04:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 3705x2500 took 18000.7ms
|
||||||
|
2020-März-27 11:04:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 350x232 took 12.2ms
|
||||||
|
2020-März-27 11:04:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 741x500 took 33.2ms
|
||||||
|
2020-März-27 11:04:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 875x580 took 40.6ms
|
||||||
|
2020-März-27 11:04:51 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 1482x1000 took 96.7ms
|
||||||
|
2020-März-27 11:04:52 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 1750x1160 took 124.9ms
|
||||||
|
2020-März-27 11:04:54 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 2223x1500 took 199.5ms
|
||||||
|
2020-März-27 11:04:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 2625x1740 took 267.7ms
|
||||||
|
2020-März-27 11:05:00 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 2964x2000 took 339.3ms
|
||||||
|
2020-März-27 11:05:05 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 3500x2320 took 459.7ms
|
||||||
|
2020-März-27 11:05:10 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 3705x2500 took 522.3ms
|
||||||
|
2020-März-27 11:05:11 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 350x232 took 9.1ms
|
||||||
|
2020-März-27 11:05:11 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 350x232 took 12.1ms
|
||||||
|
2020-März-27 11:05:11 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 741x500 took 14.2ms
|
||||||
|
2020-März-27 11:05:11 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 741x500 took 14.2ms
|
||||||
|
2020-März-27 11:05:12 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 875x580 took 23.1ms
|
||||||
|
2020-März-27 11:05:12 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 875x580 took 27.5ms
|
||||||
|
2020-März-27 11:05:12 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 1482x1000 took 51.6ms
|
||||||
|
2020-März-27 11:05:13 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 1482x1000 took 51.4ms
|
||||||
|
2020-März-27 11:05:14 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 1750x1160 took 77.3ms
|
||||||
|
2020-März-27 11:05:15 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 1750x1160 took 82.3ms
|
||||||
|
2020-März-27 11:05:16 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 2223x1500 took 139.3ms
|
||||||
|
2020-März-27 11:05:17 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 2223x1500 took 132.5ms
|
||||||
|
2020-März-27 11:05:19 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 2625x1740 took 165.8ms
|
||||||
|
2020-März-27 11:05:20 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 2625x1740 took 150.8ms
|
||||||
|
2020-März-27 11:05:23 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 2964x2000 took 236.7ms
|
||||||
|
2020-März-27 11:05:25 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 2964x2000 took 239.3ms
|
||||||
|
2020-März-27 11:05:28 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 3500x2320 took 315.1ms
|
||||||
|
2020-März-27 11:05:32 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 3500x2320 took 319.8ms
|
||||||
|
2020-März-27 11:05:35 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 3705x2500 took 377.1ms
|
||||||
|
2020-März-27 11:05:39 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 3705x2500 took 375.4ms
|
||||||
|
2020-März-27 11:05:40 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 350x232 took 85.7ms
|
||||||
|
2020-März-27 11:05:41 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 350x232 took 77.7ms
|
||||||
|
2020-März-27 11:05:43 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 741x500 took 242.6ms
|
||||||
|
2020-März-27 11:05:46 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 741x500 took 243.3ms
|
||||||
|
2020-März-27 11:05:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 875x580 took 328.8ms
|
||||||
|
2020-März-27 11:05:52 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 875x580 took 330.1ms
|
||||||
|
2020-März-27 11:06:01 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 1482x1000 took 850.4ms
|
||||||
|
2020-März-27 11:06:09 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 1482x1000 took 852.9ms
|
||||||
|
2020-März-27 11:06:21 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 1750x1160 took 1130.9ms
|
||||||
|
2020-März-27 11:06:32 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 1750x1160 took 1131.5ms
|
||||||
|
2020-März-27 11:06:50 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 2223x1500 took 1851.1ms
|
||||||
|
2020-März-27 11:07:09 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 2223x1500 took 1855.9ms
|
||||||
|
2020-März-27 11:07:33 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 2625x1740 took 2432.2ms
|
||||||
|
2020-März-27 11:07:58 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 2625x1740 took 2433.2ms
|
||||||
|
2020-März-27 11:08:30 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 2964x2000 took 3243.6ms
|
||||||
|
2020-März-27 11:09:03 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 2964x2000 took 3245.8ms
|
||||||
|
2020-März-27 11:09:46 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 3500x2320 took 4355.8ms
|
||||||
|
2020-März-27 11:10:30 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 3500x2320 took 4358.2ms
|
||||||
|
2020-März-27 11:11:17 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 3705x2500 took 4759.7ms
|
||||||
|
2020-März-27 11:12:05 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 3705x2500 took 4755.8ms
|
||||||
|
2020-März-27 11:12:07 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 350x232: 55.4ms
|
||||||
|
2020-März-27 11:12:08 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 741x500: 169.9ms
|
||||||
|
2020-März-27 11:12:10 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 875x580: 185.6ms
|
||||||
|
2020-März-27 11:12:15 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 1482x1000: 447.0ms
|
||||||
|
2020-März-27 11:12:19 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 1750x1160: 493.1ms
|
||||||
|
2020-März-27 11:12:27 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 2223x1500: 770.5ms
|
||||||
|
2020-März-27 11:12:36 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 2625x1740: 895.9ms
|
||||||
|
2020-März-27 11:12:48 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 2964x2000: 1163.5ms
|
||||||
|
2020-März-27 11:13:05 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 3500x2320: 1731.9ms
|
||||||
|
2020-März-27 11:13:24 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 3705x2500: 1862.1ms
|
||||||
|
2020-März-27 11:13:24 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 350x232: 42.0ms
|
||||||
|
2020-März-27 11:13:25 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 741x500: 56.8ms
|
||||||
|
2020-März-27 11:13:25 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 875x580: 57.8ms
|
||||||
|
2020-März-27 11:13:26 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 1482x1000: 98.0ms
|
||||||
|
2020-März-27 11:13:28 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 1750x1160: 170.4ms
|
||||||
|
2020-März-27 11:13:30 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 2223x1500: 226.5ms
|
||||||
|
2020-März-27 11:13:33 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 2625x1740: 228.1ms
|
||||||
|
2020-März-27 11:13:36 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 2964x2000: 298.1ms
|
||||||
|
2020-März-27 11:13:39 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 3500x2320: 331.0ms
|
||||||
|
2020-März-27 11:13:43 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 3705x2500: 361.2ms
|
||||||
|
2020-März-27 11:13:44 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 350x232: 45.1ms
|
||||||
|
2020-März-27 11:13:45 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 741x500: 143.1ms
|
||||||
|
2020-März-27 11:13:47 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 875x580: 174.6ms
|
||||||
|
2020-März-27 11:13:51 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 1482x1000: 384.6ms
|
||||||
|
2020-März-27 11:13:56 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 1750x1160: 533.9ms
|
||||||
|
2020-März-27 11:14:03 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 2223x1500: 705.1ms
|
||||||
|
2020-März-27 11:14:13 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 2625x1740: 989.3ms
|
||||||
|
2020-März-27 11:14:25 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 2964x2000: 1188.7ms
|
||||||
|
2020-März-27 11:14:45 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 3500x2320: 1977.3ms
|
||||||
|
2020-März-27 11:15:06 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 3705x2500: 2125.5ms
|
||||||
|
2020-März-27 11:15:07 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 350x232: 99.8ms
|
||||||
|
2020-März-27 11:15:09 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 741x500: 153.2ms
|
||||||
|
2020-März-27 11:15:11 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 875x580: 185.1ms
|
||||||
|
2020-März-27 11:15:14 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 1482x1000: 368.3ms
|
||||||
|
2020-März-27 11:15:19 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 1750x1160: 467.4ms
|
||||||
|
2020-März-27 11:15:26 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 2223x1500: 689.5ms
|
||||||
|
2020-März-27 11:15:35 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 2625x1740: 857.9ms
|
||||||
|
2020-März-27 11:15:46 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 2964x2000: 1135.8ms
|
||||||
|
2020-März-27 11:16:00 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 3500x2320: 1412.7ms
|
||||||
|
2020-März-27 11:16:17 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 3705x2500: 1700.0ms
|
||||||
|
2020-März-27 11:16:19 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask - Image sizes: 350x232, 741x500
|
||||||
|
2020-März-27 11:16:28 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 741x500: 910.6ms
|
||||||
|
2020-März-27 11:16:38 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 741x500: 952.1ms
|
||||||
|
2020-März-27 11:16:52 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 741x500: 1388.8ms
|
||||||
|
2020-März-27 11:17:06 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 741x500: 1397.5ms
|
||||||
|
2020-März-27 11:17:06 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask - Image sizes: 875x580, 1482x1000
|
||||||
|
2020-März-27 11:17:35 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 1482x1000: 2935.9ms
|
||||||
|
2020-März-27 11:18:00 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 1482x1000: 2520.1ms
|
||||||
|
2020-März-27 11:18:17 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 1482x1000: 1627.9ms
|
||||||
|
2020-März-27 11:18:33 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 1482x1000: 1642.0ms
|
||||||
|
2020-März-27 11:18:33 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask - Image sizes: 1750x1160, 2223x1500
|
||||||
|
2020-März-27 11:19:20 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 2223x1500: 4729.6ms
|
||||||
|
2020-März-27 11:20:04 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 2223x1500: 4336.1ms
|
||||||
|
2020-März-27 11:20:24 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 2223x1500: 2074.2ms
|
||||||
|
2020-März-27 11:20:45 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 2223x1500: 2074.0ms
|
||||||
|
2020-März-27 11:20:45 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask - Image sizes: 2625x1740, 2964x2000
|
||||||
|
2020-März-27 11:21:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 2964x2000: 6428.4ms
|
||||||
|
2020-März-27 11:22:52 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 2964x2000: 6257.4ms
|
||||||
|
2020-März-27 11:23:18 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 2964x2000: 2625.6ms
|
||||||
|
2020-März-27 11:23:45 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 2964x2000: 2688.8ms
|
||||||
|
2020-März-27 11:23:45 vorm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask - Image sizes: 3500x2320, 3705x2500
|
||||||
|
2020-März-27 11:25:07 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 3705x2500: 8227.0ms
|
||||||
|
2020-März-27 11:26:32 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 3705x2500: 8471.9ms
|
||||||
|
2020-März-27 11:27:05 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 3705x2500: 3232.0ms
|
||||||
|
2020-März-27 11:27:37 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 3705x2500: 3283.9ms
|
||||||
|
2020-März-27 11:27:49 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching - cpu stereo matching took of image size 741x500: 1162.5ms
|
||||||
|
2020-März-27 11:28:33 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching - cpu stereo matching took of image size 1482x1000: 4401.7ms
|
||||||
|
2020-März-27 11:29:58 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching - cpu stereo matching took of image size 2223x1500: 8477.2ms
|
||||||
|
2020-März-27 11:32:55 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching - cpu stereo matching took of image size 2964x2000: 17665.9ms
|
||||||
|
2020-März-27 11:37:08 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching - cpu stereo matching took of image size 3705x2500: 25373.9ms
|
||||||
|
2020-März-27 11:37:12 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching - gpu stereo matching took of image size 741x500: 324.5ms
|
||||||
|
2020-März-27 11:37:19 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching - gpu stereo matching took of image size 1482x1000: 705.1ms
|
||||||
|
2020-März-27 11:37:33 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching - gpu stereo matching took of image size 2223x1500: 1437.0ms
|
||||||
|
2020-März-27 11:37:58 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching - gpu stereo matching took of image size 2964x2000: 2455.6ms
|
||||||
|
2020-März-27 11:38:35 vorm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching - gpu stereo matching took of image size 3705x2500: 3780.4ms
|
||||||
|
2020-März-27 11:38:36 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 500 features in image of size 3705x2500: 77.1ms
|
||||||
|
2020-März-27 11:38:39 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 1000 features in image of size 3705x2500: 262.3ms
|
||||||
|
2020-März-27 11:38:45 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 1500 features in image of size 3705x2500: 543.0ms
|
||||||
|
2020-März-27 11:38:54 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 2000 features in image of size 3705x2500: 951.5ms
|
||||||
|
2020-März-27 11:39:09 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 2500 features in image of size 3705x2500: 1436.8ms
|
||||||
|
2020-März-27 11:39:29 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 3000 features in image of size 3705x2500: 2020.4ms
|
||||||
|
2020-März-27 11:39:57 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 3500 features in image of size 3705x2500: 2706.0ms
|
||||||
|
2020-März-27 11:40:32 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 4000 features in image of size 3705x2500: 3481.5ms
|
||||||
|
2020-März-27 11:41:16 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 4500 features in image of size 3705x2500: 4415.7ms
|
||||||
|
2020-März-27 11:42:10 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 5000 features in image of size 3705x2500: 5374.1ms
|
||||||
|
2020-März-27 11:43:15 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 5500 features in image of size 3705x2500: 6453.9ms
|
||||||
|
2020-März-27 11:44:32 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 6000 features in image of size 3705x2500: 7707.1ms
|
||||||
|
2020-März-27 11:46:02 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 6500 features in image of size 3705x2500: 9008.1ms
|
||||||
|
2020-März-27 11:47:46 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 7000 features in image of size 3705x2500: 10380.9ms
|
||||||
|
2020-März-27 11:49:45 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 7500 features in image of size 3705x2500: 11888.3ms
|
||||||
|
2020-März-27 11:52:01 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 8000 features in image of size 3705x2500: 13536.3ms
|
||||||
|
2020-März-27 11:54:34 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 8500 features in image of size 3705x2500: 15307.7ms
|
||||||
|
2020-März-27 11:57:25 vorm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 9000 features in image of size 3705x2500: 17038.5ms
|
||||||
|
2020-März-27 12:00:34 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 9500 features in image of size 3705x2500: 18909.4ms
|
||||||
|
2020-März-27 12:04:03 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 10000 features in image of size 3705x2500: 20905.5ms
|
||||||
|
2020-März-27 12:04:04 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 500 features in image of size 3705x2500: 22.4ms
|
||||||
|
2020-März-27 12:04:04 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 1000 features in image of size 3705x2500: 28.9ms
|
||||||
|
2020-März-27 12:04:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 1500 features in image of size 3705x2500: 40.6ms
|
||||||
|
2020-März-27 12:04:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 2000 features in image of size 3705x2500: 57.6ms
|
||||||
|
2020-März-27 12:04:06 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 2500 features in image of size 3705x2500: 77.3ms
|
||||||
|
2020-März-27 12:04:07 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 3000 features in image of size 3705x2500: 101.4ms
|
||||||
|
2020-März-27 12:04:09 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 3500 features in image of size 3705x2500: 130.9ms
|
||||||
|
2020-März-27 12:04:11 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 4000 features in image of size 3705x2500: 194.8ms
|
||||||
|
2020-März-27 12:04:13 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 4500 features in image of size 3705x2500: 243.3ms
|
||||||
|
2020-März-27 12:04:16 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 5000 features in image of size 3705x2500: 272.6ms
|
||||||
|
2020-März-27 12:04:19 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 5500 features in image of size 3705x2500: 338.5ms
|
||||||
|
2020-März-27 12:04:23 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 6000 features in image of size 3705x2500: 375.3ms
|
||||||
|
2020-März-27 12:04:27 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 6500 features in image of size 3705x2500: 406.8ms
|
||||||
|
2020-März-27 12:04:32 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 7000 features in image of size 3705x2500: 465.1ms
|
||||||
|
2020-März-27 12:04:38 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 7500 features in image of size 3705x2500: 579.5ms
|
||||||
|
2020-März-27 12:04:45 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 8000 features in image of size 3705x2500: 663.8ms
|
||||||
|
2020-März-27 12:04:52 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 8500 features in image of size 3705x2500: 750.2ms
|
||||||
|
2020-März-27 12:05:01 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 9000 features in image of size 3705x2500: 821.7ms
|
||||||
|
2020-März-27 12:05:10 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 9500 features in image of size 3705x2500: 898.6ms
|
||||||
|
2020-März-27 12:05:19 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 10000 features in image of size 3705x2500: 950.6ms
|
||||||
|
2020-März-27 12:05:19 nachm. [main] INFO de.unidue.nes.gpu.events.EventHandler - All tasks are finished
|
||||||
|
upload download times:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{350x232} & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{875x580} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{1750x1160} \\
|
||||||
|
& \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2625x1740} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3500x2320} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
uploading & 10.0 & 0.4 & 28.8 & 1.5 & 37.3 & 2.2 & 86.5 & 3.2 & 126.4 & 6.6 \\
|
||||||
|
& 202.0 & 10.3 & 273.1 & 7.4 & 373.0 & 17.7 & 496.2 & 15.2 & 562.9 & 21.0 \\
|
||||||
|
\hline
|
||||||
|
downloading & 13.2 & 1.6 & 38.1 & 1.8 & 44.0 & 1.4 & 99.0 & 4.1 & 130.3 & 5.4 \\
|
||||||
|
& 207.4 & 15.6 & 284.4 & 13.8 & 347.2 & 13.4 & 473.1 & 15.8 & 535.4 & 16.2 \\
|
||||||
|
\hline
|
||||||
|
combined & 21.3 & 4.9 & 62.0 & 2.0 & 76.6 & 3.8 & 193.1 & 10.9 & 262.5 & 6.1 \\
|
||||||
|
& 421.8 & 11.1 & 566.9 & 18.6 & 723.4 & 18.7 & 974.3 & 29.4 & 1134.0 & 32.1 \\
|
||||||
|
\hline
|
||||||
|
page-locked uploading & 5.1 & 0.2 & 15.0 & 0.6 & 17.4 & 0.9 & 50.2 & 2.0 & 62.0 & 7.0 \\
|
||||||
|
& 106.4 & 1.2 & 121.2 & 1.2 & 183.2 & 4.5 & 230.2 & 4.5 & 259.3 & 6.3 \\
|
||||||
|
\hline
|
||||||
|
page-locked downloading & 12.2 & 0.4 & 37.5 & 1.7 & 45.3 & 2.2 & 99.2 & 5.3 & 129.5 & 8.3 \\
|
||||||
|
& 205.1 & 6.0 & 285.8 & 15.7 & 352.9 & 16.0 & 473.7 & 15.5 & 554.4 & 12.4 \\
|
||||||
|
\hline
|
||||||
|
page-locked combined & 11.2 & 0.7 & 28.6 & 0.7 & 34.7 & 1.7 & 98.0 & 6.0 & 120.1 & 3.9 \\
|
||||||
|
& 203.1 & 6.3 & 235.4 & 3.4 & 356.1 & 8.3 & 446.1 & 5.6 & 499.8 & 6.2 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
pixel-wise table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{350x232} & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{875x580} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{1750x1160} \\
|
||||||
|
& \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2625x1740} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3500x2320} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU threshold & 0.0 & 0.0 & 1.0 & 0.0 & 1.0 & 0.0 & 3.0 & 0.0 & 4.0 & 0.0 \\
|
||||||
|
& 6.2 & 0.3 & 10.0 & 0.4 & 15.5 & 0.6 & 32.8 & 0.8 & 43.9 & 1.7 \\
|
||||||
|
\hline
|
||||||
|
GPU threshold & 4.0 & 0.0 & 4.0 & 0.0 & 4.0 & 0.0 & 5.1 & 0.2 & 5.4 & 0.4 \\
|
||||||
|
& 6.5 & 0.5 & 7.4 & 0.6 & 8.1 & 0.2 & 10.6 & 1.4 & 9.8 & 1.4 \\
|
||||||
|
\hline
|
||||||
|
CPU grayscale & 3.0 & 0.0 & 6.0 & 3.3 & 4.0 & 0.0 & 13.0 & 0.7 & 17.6 & 0.9 \\
|
||||||
|
& 31.5 & 1.0 & 45.9 & 1.1 & 66.3 & 1.9 & 99.3 & 6.7 & 105.6 & 2.1 \\
|
||||||
|
\hline
|
||||||
|
GPU grayscale & 4.0 & 0.0 & 4.4 & 0.4 & 4.5 & 0.5 & 8.4 & 5.2 & 7.9 & 0.3 \\
|
||||||
|
& 9.6 & 0.6 & 10.2 & 0.4 & 12.2 & 0.4 & 17.2 & 1.2 & 18.1 & 3.3 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
kernel table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{350x232} & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{875x580} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{1750x1160} \\
|
||||||
|
& \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2625x1740} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3500x2320} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU median filter & 259.9 & 8.0 & 1160.3 & 16.2 & 1549.4 & 23.7 & 4444.1 & 33.0 & 6098.8 & 26.5 \\
|
||||||
|
& 9947.4 & 407.9 & 13691.6 & 38.2 & 17374.5 & 43.7 & 24565.0 & 50.2 & 26852.5 & 47.2 \\
|
||||||
|
\hline
|
||||||
|
GPU median filter & 233.5 & 10.2 & 821.8 & 8.0 & 1152.9 & 5.9 & 3095.7 & 5.9 & 4134.6 & 14.3 \\
|
||||||
|
& 6700.2 & 7.0 & 9196.2 & 8.4 & 11664.3 & 7.7 & 16292.3 & 8.9 & 18000.7 & 9.3 \\
|
||||||
|
\hline
|
||||||
|
CPU gaussian filter & 15.6 & 2.8 & 40.0 & 3.0 & 50.2 & 1.0 & 99.2 & 9.7 & 126.4 & 4.9 \\
|
||||||
|
& 184.2 & 17.1 & 218.1 & 12.9 & 283.3 & 15.5 & 382.1 & 29.8 & 422.2 & 33.4 \\
|
||||||
|
\hline
|
||||||
|
GPU gaussian filter & 12.2 & 0.3 & 33.2 & 0.8 & 40.6 & 6.9 & 96.7 & 2.6 & 124.9 & 3.3 \\
|
||||||
|
& 199.5 & 5.1 & 267.7 & 4.6 & 339.3 & 5.8 & 459.7 & 5.7 & 522.3 & 6.2 \\
|
||||||
|
\hline
|
||||||
|
CPU dilate & 9.1 & 0.3 & 14.2 & 0.5 & 23.1 & 0.2 & 51.6 & 1.1 & 77.3 & 4.8 \\
|
||||||
|
& 139.3 & 11.2 & 165.8 & 10.4 & 236.7 & 11.4 & 315.1 & 14.2 & 377.1 & 12.6 \\
|
||||||
|
\hline
|
||||||
|
GPU dilate & 85.7 & 7.5 & 242.6 & 5.4 & 328.8 & 5.9 & 850.4 & 5.6 & 1130.9 & 6.9 \\
|
||||||
|
& 1851.1 & 7.9 & 2432.2 & 6.5 & 3243.6 & 6.3 & 4355.8 & 6.2 & 4759.7 & 8.4 \\
|
||||||
|
\hline
|
||||||
|
CPU erode & 12.1 & 2.5 & 14.2 & 0.4 & 27.5 & 6.0 & 51.4 & 0.6 & 82.3 & 9.6 \\
|
||||||
|
& 132.5 & 4.2 & 150.8 & 3.3 & 239.3 & 16.1 & 319.8 & 18.0 & 375.4 & 13.7 \\
|
||||||
|
\hline
|
||||||
|
GPU erode & 77.7 & 1.8 & 243.3 & 6.1 & 330.1 & 5.4 & 852.9 & 8.0 & 1131.5 & 4.2 \\
|
||||||
|
& 1855.9 & 5.6 & 2433.2 & 5.9 & 3245.8 & 5.9 & 4358.2 & 9.7 & 4755.8 & 10.7 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
imgproc table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{350x232} & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{875x580} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{1750x1160} \\
|
||||||
|
& \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2625x1740} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3500x2320} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU edge detection & 55.4 & 4.3 & 169.9 & 19.0 & 185.6 & 7.2 & 447.0 & 35.3 & 493.1 & 22.5 \\
|
||||||
|
& 770.5 & 25.4 & 895.9 & 20.6 & 1163.5 & 44.6 & 1731.9 & 31.1 & 1862.1 & 38.5 \\
|
||||||
|
\hline
|
||||||
|
GPU edge detection & 42.0 & 1.3 & 56.8 & 3.0 & 57.8 & 2.6 & 98.0 & 6.4 & 170.4 & 11.3 \\
|
||||||
|
& 226.5 & 16.6 & 228.1 & 12.3 & 298.1 & 13.8 & 331.0 & 17.0 & 361.2 & 15.0 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
pipeline table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{350x232} & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{875x580} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{1750x1160} \\
|
||||||
|
& \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2625x1740} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3500x2320} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU pipeline & 45.1 & 3.5 & 143.1 & 11.4 & 174.6 & 6.4 & 384.6 & 25.4 & 533.9 & 22.2 \\
|
||||||
|
& 705.1 & 28.4 & 989.3 & 22.6 & 1188.7 & 31.9 & 1977.3 & 33.2 & 2125.5 & 42.1 \\
|
||||||
|
\hline
|
||||||
|
GPU pipeline & 99.8 & 4.9 & 153.2 & 11.0 & 185.1 & 5.0 & 368.3 & 10.2 & 467.4 & 16.8 \\
|
||||||
|
& 689.5 & 10.1 & 857.9 & 18.8 & 1135.8 & 13.0 & 1412.7 & 20.9 & 1700.0 & 15.6 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
feature table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU - skyscraper image & 910.6 & 31.4 & 2935.9 & 64.5 & 4729.6 & 63.4 & 6428.4 & 45.3 & 8227.0 & 49.4 \\
|
||||||
|
\hline
|
||||||
|
GPU - skyscraper image & 1388.8 & 46.6 & 1627.9 & 27.7 & 2074.2 & 36.9 & 2625.6 & 64.1 & 3232.0 & 35.7 \\
|
||||||
|
\hline
|
||||||
|
CPU - motorcycle image & 952.1 & 37.9 & 2520.1 & 40.1 & 4336.1 & 50.0 & 6257.4 & 36.8 & 8471.9 & 28.2 \\
|
||||||
|
\hline
|
||||||
|
GPU - motorcycle image & 1397.5 & 44.3 & 1642.0 & 45.3 & 2074.0 & 41.6 & 2688.8 & 32.2 & 3283.9 & 27.8 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
feature matching table:
|
||||||
|
CPU feature matching number of features = (average time, standard deviation):
|
||||||
|
500=(77.1, 8.757282683572571)
|
||||||
|
1000=(262.3, 21.642781706610638)
|
||||||
|
1500=(543.0, 25.26657871576601)
|
||||||
|
2000=(951.5, 50.91217928943919)
|
||||||
|
2500=(1436.8, 43.769395700649106)
|
||||||
|
3000=(2020.4, 48.738485819729775)
|
||||||
|
3500=(2706.0, 33.24755630117799)
|
||||||
|
4000=(3481.5, 38.70723446592381)
|
||||||
|
4500=(4415.7, 47.927132190440936)
|
||||||
|
5000=(5374.1, 55.267440686176165)
|
||||||
|
5500=(6453.9, 40.12592678057418)
|
||||||
|
6000=(7707.1, 103.64019490525864)
|
||||||
|
6500=(9008.1, 72.07003538225855)
|
||||||
|
7000=(10380.9, 58.7902202751444)
|
||||||
|
7500=(11888.3, 35.39223078586598)
|
||||||
|
8000=(13536.3, 98.53329386557621)
|
||||||
|
8500=(15307.7, 177.0491739602306)
|
||||||
|
9000=(17038.5, 99.78702320442274)
|
||||||
|
9500=(18909.4, 92.03173365747274)
|
||||||
|
10000=(20905.5, 84.12044935685971)
|
||||||
|
|
||||||
|
|
||||||
|
GPU feature matching number of features = (average time, standard deviation):
|
||||||
|
500=(22.4, 6.62117814289874)
|
||||||
|
1000=(28.9, 2.1189620100417086)
|
||||||
|
1500=(40.6, 1.624807680927192)
|
||||||
|
2000=(57.6, 1.7435595774162695)
|
||||||
|
2500=(77.3, 2.193171219946131)
|
||||||
|
3000=(101.4, 6.681317235396027)
|
||||||
|
3500=(130.9, 1.5779733838059498)
|
||||||
|
4000=(194.8, 7.4404300950953095)
|
||||||
|
4500=(243.3, 3.0016662039607267)
|
||||||
|
5000=(272.6, 5.589275444992847)
|
||||||
|
5500=(338.5, 6.989277502002621)
|
||||||
|
6000=(375.3, 8.649277426467487)
|
||||||
|
6500=(406.8, 4.261455150532504)
|
||||||
|
7000=(465.1, 4.90815647672321)
|
||||||
|
7500=(579.5, 6.34428877022476)
|
||||||
|
8000=(663.8, 14.372195378577343)
|
||||||
|
8500=(750.2, 5.617828762075256)
|
||||||
|
9000=(821.7, 9.263368717696602)
|
||||||
|
9500=(898.6, 8.2)
|
||||||
|
10000=(950.6, 5.6780278266313555)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
stereo matching table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU stereo matching & 1162.5 & 78.3 & 4401.7 & 18.6 & 8477.2 & 139.0 & 17665.9 & 83.4 & 25373.9 & 71.4 \\
|
||||||
|
\hline
|
||||||
|
GPU stereo matching & 324.5 & 19.9 & 705.1 & 6.8 & 1437.0 & 8.7 & 2455.6 & 5.7 & 3780.4 & 5.0 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,564 @@
|
|||||||
|
Prozessor: Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
|
||||||
|
GPU: NVIDIA GeForce GTX 1050 Ti
|
||||||
|
RAM: 8 GB
|
||||||
|
|
||||||
|
some print statement
|
||||||
|
2020-März-27 14:44:20 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Loading opencv dll
|
||||||
|
2020-März-27 14:44:20 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Loading CUDA module
|
||||||
|
2020-März-27 14:44:22 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Number of Cuda enabled devices: 1
|
||||||
|
2020-März-27 14:44:22 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - creating EventHandler
|
||||||
|
2020-März-27 14:44:22 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - loading and verifying test images
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - test image sizes: 741x500, 1482x1000, 2223x1500, 2964x2000, 3705x2500
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - stereo test image sizes: 741x500, 1482x1000, 2223x1500, 2964x2000, 3705x2500
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Some hardware information:
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - OS name: Windows 10
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - OS type: amd64
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - OS version: 10.0
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - System environment information:
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Processor identifier: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Processor architecture: AMD64
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - Number of processors: 4
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.initialization.Initializer - CUDA information following:
|
||||||
|
*** CUDA Device Query (Runtime API) version (CUDART static linking) ***
|
||||||
|
|
||||||
|
Device count: 1
|
||||||
|
|
||||||
|
Device 0: "GeForce GTX 1050 Ti"
|
||||||
|
CUDA Driver Version / Runtime Version 10.20 / 10.10
|
||||||
|
CUDA Capability Major/Minor version number: 6.1
|
||||||
|
Total amount of global memory: 4096 MBytes (4294967296 bytes)
|
||||||
|
GPU Clock Speed: 1.39 GHz
|
||||||
|
Max Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072,65536), 3D=(16384,16384,16384)
|
||||||
|
Max Layered Texture Size (dim) x layers 1D=(32768) x 2048, 2D=(32768,32768) x 2048
|
||||||
|
Total amount of constant memory: 65536 bytes
|
||||||
|
Total amount of shared memory per block: 49152 bytes
|
||||||
|
Total number of registers available per block: 65536
|
||||||
|
Warp size: 32
|
||||||
|
Maximum number of threads per block: 1024
|
||||||
|
Maximum sizes of each dimension of a block: 1024 x 1024 x 64
|
||||||
|
Maximum sizes of each dimension of a grid: 2147483647 x 65535 x 65535
|
||||||
|
Maximum memory pitch: 2147483647 bytes
|
||||||
|
Texture alignment: 512 bytes
|
||||||
|
Concurrent copy and execution: Yes with 2 copy engine(s)
|
||||||
|
Run time limit on kernels: Yes
|
||||||
|
Integrated GPU sharing Host Memory: No
|
||||||
|
Support host page-locked memory mapping: Yes
|
||||||
|
Concurrent kernel execution: Yes
|
||||||
|
Alignment requirement for Surfaces: Yes
|
||||||
|
Device has ECC support enabled: No
|
||||||
|
Device is using TCC driver mode: No
|
||||||
|
Device supports Unified Addressing (UVA): Yes
|
||||||
|
Device PCI Bus ID / PCI location ID: 1 / 0
|
||||||
|
Compute Mode:
|
||||||
|
Default (multiple host threads can use ::cudaSetDevice() with device simultaneously)
|
||||||
|
|
||||||
|
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.20, CUDA Runtime Version = 10.10, NumDevs = 1
|
||||||
|
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.GpuTestSystem - starting tests
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.events.EventHandler - The following tasks will be tested:
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.events.EventHandler - UploadDownloadTask
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.events.EventHandler - PageLockedUploadDownloadTask
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.events.EventHandler - PixelWiseTask
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.events.EventHandler - KernelTask
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.events.EventHandler - ImgProcTask
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.events.EventHandler - PipelineTask
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.events.EventHandler - FeatureBasedTask
|
||||||
|
2020-März-27 14:44:24 nachm. [main] INFO de.unidue.nes.gpu.GpuTestSystem - Running tasks so dlls get loaded
|
||||||
|
starting UploadDownloadTask
|
||||||
|
starting PageLockedUploadDownloadTask
|
||||||
|
starting PixelWiseTask
|
||||||
|
starting KernelTask
|
||||||
|
starting ImgProcTask
|
||||||
|
starting PipelineTask
|
||||||
|
starting FeatureBasedTask
|
||||||
|
2020-März-27 14:51:44 nachm. [main] INFO de.unidue.nes.gpu.GpuTestSystem - Now starting tasks to measure performance
|
||||||
|
2020-März-27 14:51:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 350x232 took 8.1ms.
|
||||||
|
2020-März-27 14:51:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 741x500 took 30.2ms.
|
||||||
|
2020-März-27 14:51:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 875x580 took 37.2ms.
|
||||||
|
2020-März-27 14:51:47 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 1482x1000 took 106.7ms.
|
||||||
|
2020-März-27 14:51:49 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 1750x1160 took 174.6ms.
|
||||||
|
2020-März-27 14:51:52 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 2223x1500 took 301.4ms.
|
||||||
|
2020-März-27 14:51:56 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 2625x1740 took 388.4ms.
|
||||||
|
2020-März-27 14:52:01 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 2964x2000 took 545.6ms.
|
||||||
|
2020-März-27 14:52:09 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 3500x2320 took 724.9ms.
|
||||||
|
2020-März-27 14:52:17 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading Mat of size 3705x2500 took 840.4ms.
|
||||||
|
2020-März-27 14:52:17 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 350x232 took 14.1ms.
|
||||||
|
2020-März-27 14:52:18 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 741x500 took 42.6ms.
|
||||||
|
2020-März-27 14:52:18 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 875x580 took 54.0ms.
|
||||||
|
2020-März-27 14:52:20 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 1482x1000 took 148.1ms.
|
||||||
|
2020-März-27 14:52:22 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 1750x1160 took 193.1ms.
|
||||||
|
2020-März-27 14:52:25 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 2223x1500 took 332.9ms.
|
||||||
|
2020-März-27 14:52:30 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 2625x1740 took 447.1ms.
|
||||||
|
2020-März-27 14:52:35 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 2964x2000 took 576.7ms.
|
||||||
|
2020-März-27 14:52:43 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 3500x2320 took 768.4ms.
|
||||||
|
2020-März-27 14:52:52 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - downloading Mat of size 3705x2500 took 879.0ms.
|
||||||
|
2020-März-27 14:52:52 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 350x232 took 18.5ms.
|
||||||
|
2020-März-27 14:52:53 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 741x500 took 70.5ms.
|
||||||
|
2020-März-27 14:52:54 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 875x580 took 88.5ms.
|
||||||
|
2020-März-27 14:52:56 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 1482x1000 took 246.9ms.
|
||||||
|
2020-März-27 14:52:59 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 1750x1160 took 340.4ms.
|
||||||
|
2020-März-27 14:53:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 2223x1500 took 577.6ms.
|
||||||
|
2020-März-27 14:53:13 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 2625x1740 took 783.0ms.
|
||||||
|
2020-März-27 14:53:23 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 2964x2000 took 1014.7ms.
|
||||||
|
2020-März-27 14:53:38 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 3500x2320 took 1431.6ms.
|
||||||
|
2020-März-27 14:53:54 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.UploadDownloadTask - uploading and downloading Mat of size 3705x2500 took 1648.2ms.
|
||||||
|
2020-März-27 14:54:03 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 350x232 took 4.9ms.
|
||||||
|
2020-März-27 14:54:03 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 741x500 took 13.8ms.
|
||||||
|
2020-März-27 14:54:03 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 875x580 took 17.0ms.
|
||||||
|
2020-März-27 14:54:03 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 1482x1000 took 44.2ms.
|
||||||
|
2020-März-27 14:54:04 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 1750x1160 took 59.6ms.
|
||||||
|
2020-März-27 14:54:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 2223x1500 took 92.6ms.
|
||||||
|
2020-März-27 14:54:06 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 2625x1740 took 127.9ms.
|
||||||
|
2020-März-27 14:54:08 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 2964x2000 took 162.9ms.
|
||||||
|
2020-März-27 14:54:10 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 3500x2320 took 230.2ms.
|
||||||
|
2020-März-27 14:54:13 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading Mat of size 3705x2500 took 260.7ms.
|
||||||
|
2020-März-27 14:54:13 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 350x232 took 11.7ms.
|
||||||
|
2020-März-27 14:54:13 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 741x500 took 38.0ms.
|
||||||
|
2020-März-27 14:54:14 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 875x580 took 48.4ms.
|
||||||
|
2020-März-27 14:54:15 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 1482x1000 took 145.6ms.
|
||||||
|
2020-März-27 14:54:17 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 1750x1160 took 186.7ms.
|
||||||
|
2020-März-27 14:54:20 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 2223x1500 took 300.1ms.
|
||||||
|
2020-März-27 14:54:24 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 2625x1740 took 412.4ms.
|
||||||
|
2020-März-27 14:54:30 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 2964x2000 took 543.5ms.
|
||||||
|
2020-März-27 14:54:37 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 3500x2320 took 729.7ms.
|
||||||
|
2020-März-27 14:54:45 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - downloading Mat of size 3705x2500 took 844.9ms.
|
||||||
|
2020-März-27 14:54:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 350x232 took 11.0ms.
|
||||||
|
2020-März-27 14:54:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 741x500 took 28.8ms.
|
||||||
|
2020-März-27 14:54:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 875x580 took 36.7ms.
|
||||||
|
2020-März-27 14:54:47 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 1482x1000 took 96.0ms.
|
||||||
|
2020-März-27 14:54:48 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 1750x1160 took 125.7ms.
|
||||||
|
2020-März-27 14:54:50 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 2223x1500 took 194.8ms.
|
||||||
|
2020-März-27 14:54:53 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 2625x1740 took 269.3ms.
|
||||||
|
2020-März-27 14:54:57 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 2964x2000 took 340.3ms.
|
||||||
|
2020-März-27 14:55:01 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 3500x2320 took 486.3ms.
|
||||||
|
2020-März-27 14:55:07 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.PageLockedUploadDownloadTask - uploading and downloading Mat of size 3705x2500 took 557.6ms.
|
||||||
|
2020-März-27 14:55:14 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 350x232 took 0.0ms.
|
||||||
|
2020-März-27 14:55:14 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 741x500 took 0.2ms.
|
||||||
|
2020-März-27 14:55:14 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 875x580 took 1.0ms.
|
||||||
|
2020-März-27 14:55:14 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 1482x1000 took 3.1ms.
|
||||||
|
2020-März-27 14:55:14 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 1750x1160 took 4.8ms.
|
||||||
|
2020-März-27 14:55:15 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 2223x1500 took 30.2ms.
|
||||||
|
2020-März-27 14:55:15 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 2625x1740 took 57.3ms.
|
||||||
|
2020-März-27 14:55:16 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 2964x2000 took 88.0ms.
|
||||||
|
2020-März-27 14:55:17 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 3500x2320 took 139.1ms.
|
||||||
|
2020-März-27 14:55:19 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUThresholding - thresholding image from size 3705x2500 took 192.0ms.
|
||||||
|
2020-März-27 14:55:19 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 350x232 took 4.5ms.
|
||||||
|
2020-März-27 14:55:19 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 741x500 took 6.5ms.
|
||||||
|
2020-März-27 14:55:19 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 875x580 took 5.1ms.
|
||||||
|
2020-März-27 14:55:20 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 1482x1000 took 8.2ms.
|
||||||
|
2020-März-27 14:55:20 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 1750x1160 took 9.8ms.
|
||||||
|
2020-März-27 14:55:20 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 2223x1500 took 13.0ms.
|
||||||
|
2020-März-27 14:55:20 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 2625x1740 took 16.3ms.
|
||||||
|
2020-März-27 14:55:20 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 2964x2000 took 18.3ms.
|
||||||
|
2020-März-27 14:55:20 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 3500x2320 took 25.0ms.
|
||||||
|
2020-März-27 14:55:21 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUThresholding - thresholding image from size 3705x2500 took 26.8ms.
|
||||||
|
2020-März-27 14:55:28 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 350x232 took 3.0ms
|
||||||
|
2020-März-27 14:55:28 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 741x500 took 5.0ms
|
||||||
|
2020-März-27 14:55:29 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 875x580 took 9.1ms
|
||||||
|
2020-März-27 14:55:29 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 1482x1000 took 22.7ms
|
||||||
|
2020-März-27 14:55:29 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 1750x1160 took 44.2ms
|
||||||
|
2020-März-27 14:55:30 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 2223x1500 took 89.6ms
|
||||||
|
2020-März-27 14:55:32 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 2625x1740 took 138.7ms
|
||||||
|
2020-März-27 14:55:33 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 2964x2000 took 184.1ms
|
||||||
|
2020-März-27 14:55:36 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 3500x2320 took 261.8ms
|
||||||
|
2020-März-27 14:55:39 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUColoring - Grayscaling the image of size 3705x2500 took 305.5ms
|
||||||
|
2020-März-27 14:55:39 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 350x232 took 4.2ms
|
||||||
|
2020-März-27 14:55:39 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 741x500 took 5.7ms
|
||||||
|
2020-März-27 14:55:39 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 875x580 took 7.6ms
|
||||||
|
2020-März-27 14:55:39 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 1482x1000 took 13.3ms
|
||||||
|
2020-März-27 14:55:40 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 1750x1160 took 16.8ms
|
||||||
|
2020-März-27 14:55:40 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 2223x1500 took 25.0ms
|
||||||
|
2020-März-27 14:55:40 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 2625x1740 took 32.3ms
|
||||||
|
2020-März-27 14:55:41 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 2964x2000 took 42.1ms
|
||||||
|
2020-März-27 14:55:41 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 3500x2320 took 56.6ms
|
||||||
|
2020-März-27 14:55:42 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUColoring - Grayscaling the image of size 3705x2500 took 64.7ms
|
||||||
|
2020-März-27 14:55:51 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 350x232 took 288.0ms
|
||||||
|
2020-März-27 14:56:04 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 741x500 took 1274.4ms
|
||||||
|
2020-März-27 14:56:21 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 875x580 took 1694.9ms
|
||||||
|
2020-März-27 14:57:09 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 1482x1000 took 4861.0ms
|
||||||
|
2020-März-27 14:58:15 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 1750x1160 took 6576.8ms
|
||||||
|
2020-März-27 15:00:01 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 2223x1500 took 10562.2ms
|
||||||
|
2020-März-27 15:02:25 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 2625x1740 took 14476.0ms
|
||||||
|
2020-März-27 15:05:30 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 2964x2000 took 18433.5ms
|
||||||
|
2020-März-27 15:09:48 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 3500x2320 took 25781.5ms
|
||||||
|
2020-März-27 15:14:32 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - median filter on size: 3705x2500 took 28397.5ms
|
||||||
|
2020-März-27 15:14:32 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 350x232 took 12.2ms
|
||||||
|
2020-März-27 15:14:32 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 741x500 took 36.3ms
|
||||||
|
2020-März-27 15:14:32 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 875x580 took 45.4ms
|
||||||
|
2020-März-27 15:14:33 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 1482x1000 took 88.2ms
|
||||||
|
2020-März-27 15:14:35 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 1750x1160 took 117.4ms
|
||||||
|
2020-März-27 15:14:36 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 2223x1500 took 186.4ms
|
||||||
|
2020-März-27 15:14:39 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 2625x1740 took 255.4ms
|
||||||
|
2020-März-27 15:14:42 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 2964x2000 took 332.1ms
|
||||||
|
2020-März-27 15:14:47 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 3500x2320 took 427.6ms
|
||||||
|
2020-März-27 15:14:51 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUFiltering - gaussian filter on size: 3705x2500 took 488.4ms
|
||||||
|
2020-März-27 15:14:55 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 350x232 took 392.4ms
|
||||||
|
2020-März-27 15:15:08 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 741x500 took 1223.3ms
|
||||||
|
2020-März-27 15:15:24 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 875x580 took 1632.7ms
|
||||||
|
2020-März-27 15:16:04 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 1482x1000 took 4038.3ms
|
||||||
|
2020-März-27 15:16:58 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 1750x1160 took 5316.8ms
|
||||||
|
2020-März-27 15:18:22 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 2223x1500 took 8483.3ms
|
||||||
|
2020-März-27 15:20:17 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 2625x1740 took 11461.9ms
|
||||||
|
2020-März-27 15:22:42 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 2964x2000 took 14472.6ms
|
||||||
|
2020-März-27 15:26:00 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 3500x2320 took 19834.1ms
|
||||||
|
2020-März-27 15:29:40 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - median filter on size: 3705x2500 took 22025.5ms
|
||||||
|
2020-März-27 15:29:41 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 350x232 took 13.1ms
|
||||||
|
2020-März-27 15:29:41 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 741x500 took 31.2ms
|
||||||
|
2020-März-27 15:29:41 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 875x580 took 43.0ms
|
||||||
|
2020-März-27 15:29:42 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 1482x1000 took 102.7ms
|
||||||
|
2020-März-27 15:29:44 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 1750x1160 took 139.5ms
|
||||||
|
2020-März-27 15:29:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 2223x1500 took 218.4ms
|
||||||
|
2020-März-27 15:29:49 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 2625x1740 took 294.4ms
|
||||||
|
2020-März-27 15:29:53 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 2964x2000 took 372.6ms
|
||||||
|
2020-März-27 15:29:58 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 3500x2320 took 506.9ms
|
||||||
|
2020-März-27 15:30:03 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUFiltering - gaussian filter on size: 3705x2500 took 576.0ms
|
||||||
|
2020-März-27 15:30:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 350x232 took 10.0ms
|
||||||
|
2020-März-27 15:30:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 350x232 took 10.0ms
|
||||||
|
2020-März-27 15:30:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 741x500 took 15.7ms
|
||||||
|
2020-März-27 15:30:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 741x500 took 15.4ms
|
||||||
|
2020-März-27 15:30:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 875x580 took 24.2ms
|
||||||
|
2020-März-27 15:30:06 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 875x580 took 24.2ms
|
||||||
|
2020-März-27 15:30:06 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 1482x1000 took 56.8ms
|
||||||
|
2020-März-27 15:30:07 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 1482x1000 took 56.4ms
|
||||||
|
2020-März-27 15:30:08 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 1750x1160 took 79.4ms
|
||||||
|
2020-März-27 15:30:08 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 1750x1160 took 79.9ms
|
||||||
|
2020-März-27 15:30:10 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 2223x1500 took 140.4ms
|
||||||
|
2020-März-27 15:30:11 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 2223x1500 took 136.5ms
|
||||||
|
2020-März-27 15:30:13 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 2625x1740 took 150.6ms
|
||||||
|
2020-März-27 15:30:14 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 2625x1740 took 152.0ms
|
||||||
|
2020-März-27 15:30:16 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 2964x2000 took 220.8ms
|
||||||
|
2020-März-27 15:30:19 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 2964x2000 took 219.3ms
|
||||||
|
2020-März-27 15:30:22 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 3500x2320 took 297.5ms
|
||||||
|
2020-März-27 15:30:25 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 3500x2320 took 297.5ms
|
||||||
|
2020-März-27 15:30:28 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - dilate on size: 3705x2500 took 358.3ms
|
||||||
|
2020-März-27 15:30:32 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUMorph - erode on size: 3705x2500 took 356.3ms
|
||||||
|
2020-März-27 15:30:33 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 350x232 took 107.1ms
|
||||||
|
2020-März-27 15:30:34 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 350x232 took 104.4ms
|
||||||
|
2020-März-27 15:30:37 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 741x500 took 306.4ms
|
||||||
|
2020-März-27 15:30:40 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 741x500 took 304.9ms
|
||||||
|
2020-März-27 15:30:44 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 875x580 took 419.8ms
|
||||||
|
2020-März-27 15:30:48 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 875x580 took 419.6ms
|
||||||
|
2020-März-27 15:31:00 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 1482x1000 took 1116.5ms
|
||||||
|
2020-März-27 15:31:11 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 1482x1000 took 1118.6ms
|
||||||
|
2020-März-27 15:31:26 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 1750x1160 took 1489.3ms
|
||||||
|
2020-März-27 15:31:41 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 1750x1160 took 1491.5ms
|
||||||
|
2020-März-27 15:32:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 2223x1500 took 2442.1ms
|
||||||
|
2020-März-27 15:32:29 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 2223x1500 took 2444.0ms
|
||||||
|
2020-März-27 15:33:02 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 2625x1740 took 3236.2ms
|
||||||
|
2020-März-27 15:33:34 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 2625x1740 took 3240.2ms
|
||||||
|
2020-März-27 15:34:17 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 2964x2000 took 4273.7ms
|
||||||
|
2020-März-27 15:35:00 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 2964x2000 took 4276.8ms
|
||||||
|
2020-März-27 15:35:57 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 3500x2320 took 5720.8ms
|
||||||
|
2020-März-27 15:36:54 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 3500x2320 took 5724.3ms
|
||||||
|
2020-März-27 15:37:58 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - dilate on size: 3705x2500 took 6355.9ms
|
||||||
|
2020-März-27 15:39:01 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUMorph - erode on size: 3705x2500 took 6361.2ms
|
||||||
|
2020-März-27 15:39:03 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 350x232: 58.4ms
|
||||||
|
2020-März-27 15:39:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 741x500: 193.3ms
|
||||||
|
2020-März-27 15:39:08 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 875x580: 287.4ms
|
||||||
|
2020-März-27 15:39:15 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 1482x1000: 714.9ms
|
||||||
|
2020-März-27 15:39:24 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 1750x1160: 905.4ms
|
||||||
|
2020-März-27 15:39:38 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 2223x1500: 1395.3ms
|
||||||
|
2020-März-27 15:39:56 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 2625x1740: 1739.2ms
|
||||||
|
2020-März-27 15:40:17 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 2964x2000: 2154.4ms
|
||||||
|
2020-März-27 15:40:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 3500x2320: 2905.6ms
|
||||||
|
2020-März-27 15:41:16 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection - cpu execution time for image of size 3705x2500: 3029.8ms
|
||||||
|
2020-März-27 15:41:17 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 350x232: 53.6ms
|
||||||
|
2020-März-27 15:41:18 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 741x500: 98.8ms
|
||||||
|
2020-März-27 15:41:19 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 875x580: 103.2ms
|
||||||
|
2020-März-27 15:41:21 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 1482x1000: 241.3ms
|
||||||
|
2020-März-27 15:41:25 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 1750x1160: 309.9ms
|
||||||
|
2020-März-27 15:41:30 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 2223x1500: 521.3ms
|
||||||
|
2020-März-27 15:41:36 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 2625x1740: 585.3ms
|
||||||
|
2020-März-27 15:41:44 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 2964x2000: 812.3ms
|
||||||
|
2020-März-27 15:41:54 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 3500x2320: 972.8ms
|
||||||
|
2020-März-27 15:42:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection - gpu execution time for image of size 3705x2500: 1151.8ms
|
||||||
|
2020-März-27 15:42:07 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 350x232: 38.0ms
|
||||||
|
2020-März-27 15:42:08 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 741x500: 135.9ms
|
||||||
|
2020-März-27 15:42:10 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 875x580: 205.0ms
|
||||||
|
2020-März-27 15:42:15 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 1482x1000: 545.2ms
|
||||||
|
2020-März-27 15:42:24 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 1750x1160: 873.8ms
|
||||||
|
2020-März-27 15:42:36 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 2223x1500: 1226.6ms
|
||||||
|
2020-März-27 15:42:55 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 2625x1740: 1830.5ms
|
||||||
|
2020-März-27 15:43:15 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 2964x2000: 2069.2ms
|
||||||
|
2020-März-27 15:43:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 3500x2320: 3011.7ms
|
||||||
|
2020-März-27 15:44:17 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline - cpu execution time for image of size 3705x2500: 3110.5ms
|
||||||
|
2020-März-27 15:44:18 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 350x232: 104.8ms
|
||||||
|
2020-März-27 15:44:19 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 741x500: 175.5ms
|
||||||
|
2020-März-27 15:44:22 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 875x580: 209.3ms
|
||||||
|
2020-März-27 15:44:27 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 1482x1000: 519.4ms
|
||||||
|
2020-März-27 15:44:33 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 1750x1160: 663.6ms
|
||||||
|
2020-März-27 15:44:44 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 2223x1500: 1048.2ms
|
||||||
|
2020-März-27 15:44:57 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 2625x1740: 1345.0ms
|
||||||
|
2020-März-27 15:45:15 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 2964x2000: 1795.1ms
|
||||||
|
2020-März-27 15:45:38 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 3500x2320: 2304.6ms
|
||||||
|
2020-März-27 15:46:06 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline - gpu execution time for image of size 3705x2500: 2740.6ms
|
||||||
|
2020-März-27 15:46:08 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask - Image sizes: 350x232, 741x500
|
||||||
|
2020-März-27 15:46:16 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 741x500: 786.5ms
|
||||||
|
2020-März-27 15:46:24 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 741x500: 824.0ms
|
||||||
|
2020-März-27 15:46:37 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 741x500: 1245.2ms
|
||||||
|
2020-März-27 15:46:49 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 741x500: 1271.4ms
|
||||||
|
2020-März-27 15:46:49 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask - Image sizes: 875x580, 1482x1000
|
||||||
|
2020-März-27 15:47:14 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 1482x1000: 2439.7ms
|
||||||
|
2020-März-27 15:47:35 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 1482x1000: 2093.3ms
|
||||||
|
2020-März-27 15:47:50 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 1482x1000: 1502.3ms
|
||||||
|
2020-März-27 15:48:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 1482x1000: 1507.6ms
|
||||||
|
2020-März-27 15:48:05 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask - Image sizes: 1750x1160, 2223x1500
|
||||||
|
2020-März-27 15:48:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 2223x1500: 4141.5ms
|
||||||
|
2020-März-27 15:49:23 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 2223x1500: 3717.3ms
|
||||||
|
2020-März-27 15:49:45 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 2223x1500: 2178.7ms
|
||||||
|
2020-März-27 15:50:07 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 2223x1500: 2165.9ms
|
||||||
|
2020-März-27 15:50:07 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask - Image sizes: 2625x1740, 2964x2000
|
||||||
|
2020-März-27 15:51:04 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 2964x2000: 5747.2ms
|
||||||
|
2020-März-27 15:52:00 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 2964x2000: 5575.4ms
|
||||||
|
2020-März-27 15:52:29 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 2964x2000: 2887.4ms
|
||||||
|
2020-März-27 15:52:58 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 2964x2000: 2922.6ms
|
||||||
|
2020-März-27 15:52:58 nachm. [main] INFO de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask - Image sizes: 3500x2320, 3705x2500
|
||||||
|
2020-März-27 15:54:12 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 3705x2500: 7387.8ms
|
||||||
|
2020-März-27 15:55:29 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature detection time for images of size 3705x2500: 7658.0ms
|
||||||
|
2020-März-27 15:56:06 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 3705x2500: 3748.2ms
|
||||||
|
2020-März-27 15:56:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu detection time for images of size 3705x2500: 3972.3ms
|
||||||
|
2020-März-27 15:56:57 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching - cpu stereo matching took of image size 741x500: 1073.5ms
|
||||||
|
2020-März-27 15:57:52 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching - cpu stereo matching took of image size 1482x1000: 5578.0ms
|
||||||
|
2020-März-27 16:00:12 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching - cpu stereo matching took of image size 2223x1500: 13959.7ms
|
||||||
|
2020-März-27 16:04:36 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching - cpu stereo matching took of image size 2964x2000: 26444.8ms
|
||||||
|
2020-März-27 16:11:23 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching - cpu stereo matching took of image size 3705x2500: 40675.4ms
|
||||||
|
2020-März-27 16:11:29 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching - gpu stereo matching took of image size 741x500: 559.2ms
|
||||||
|
2020-März-27 16:11:55 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching - gpu stereo matching took of image size 1482x1000: 2603.8ms
|
||||||
|
2020-März-27 16:12:57 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching - gpu stereo matching took of image size 2223x1500: 6239.9ms
|
||||||
|
2020-März-27 16:14:52 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching - gpu stereo matching took of image size 2964x2000: 11482.6ms
|
||||||
|
2020-März-27 16:17:53 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching - gpu stereo matching took of image size 3705x2500: 18108.7ms
|
||||||
|
2020-März-27 16:17:55 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 500 features in image of size 3705x2500: 99.2ms
|
||||||
|
2020-März-27 16:17:59 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 1000 features in image of size 3705x2500: 387.3ms
|
||||||
|
2020-März-27 16:18:07 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 1500 features in image of size 3705x2500: 808.7ms
|
||||||
|
2020-März-27 16:18:21 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 2000 features in image of size 3705x2500: 1438.8ms
|
||||||
|
2020-März-27 16:18:44 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 2500 features in image of size 3705x2500: 2271.9ms
|
||||||
|
2020-März-27 16:19:16 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 3000 features in image of size 3705x2500: 3168.4ms
|
||||||
|
2020-März-27 16:20:00 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 3500 features in image of size 3705x2500: 4343.9ms
|
||||||
|
2020-März-27 16:20:55 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 4000 features in image of size 3705x2500: 5454.1ms
|
||||||
|
2020-März-27 16:22:03 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 4500 features in image of size 3705x2500: 6876.5ms
|
||||||
|
2020-März-27 16:23:28 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 5000 features in image of size 3705x2500: 8466.2ms
|
||||||
|
2020-März-27 16:25:11 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 5500 features in image of size 3705x2500: 10235.4ms
|
||||||
|
2020-März-27 16:27:12 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 6000 features in image of size 3705x2500: 12128.5ms
|
||||||
|
2020-März-27 16:29:35 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 6500 features in image of size 3705x2500: 14238.7ms
|
||||||
|
2020-März-27 16:32:21 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 7000 features in image of size 3705x2500: 16558.5ms
|
||||||
|
2020-März-27 16:35:31 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 7500 features in image of size 3705x2500: 18984.4ms
|
||||||
|
2020-März-27 16:39:06 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 8000 features in image of size 3705x2500: 21539.4ms
|
||||||
|
2020-März-27 16:43:11 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 8500 features in image of size 3705x2500: 24464.7ms
|
||||||
|
2020-März-27 16:47:45 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 9000 features in image of size 3705x2500: 27390.1ms
|
||||||
|
2020-März-27 16:52:50 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 9500 features in image of size 3705x2500: 30487.7ms
|
||||||
|
2020-März-27 16:58:29 nachm. [main] INFO de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask - cpu feature matching time for 10000 features in image of size 3705x2500: 33792.7ms
|
||||||
|
2020-März-27 16:58:29 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 500 features in image of size 3705x2500: 30.7ms
|
||||||
|
2020-März-27 16:58:30 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 1000 features in image of size 3705x2500: 65.3ms
|
||||||
|
2020-März-27 16:58:31 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 1500 features in image of size 3705x2500: 120.4ms
|
||||||
|
2020-März-27 16:58:33 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 2000 features in image of size 3705x2500: 203.1ms
|
||||||
|
2020-März-27 16:58:36 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 2500 features in image of size 3705x2500: 317.3ms
|
||||||
|
2020-März-27 16:58:41 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 3000 features in image of size 3705x2500: 429.7ms
|
||||||
|
2020-März-27 16:58:47 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 3500 features in image of size 3705x2500: 595.5ms
|
||||||
|
2020-März-27 16:58:55 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 4000 features in image of size 3705x2500: 757.3ms
|
||||||
|
2020-März-27 16:59:04 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 4500 features in image of size 3705x2500: 933.9ms
|
||||||
|
2020-März-27 16:59:16 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 5000 features in image of size 3705x2500: 1154.6ms
|
||||||
|
2020-März-27 16:59:30 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 5500 features in image of size 3705x2500: 1398.0ms
|
||||||
|
2020-März-27 16:59:46 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 6000 features in image of size 3705x2500: 1632.7ms
|
||||||
|
2020-März-27 17:00:06 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 6500 features in image of size 3705x2500: 1939.8ms
|
||||||
|
2020-März-27 17:00:28 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 7000 features in image of size 3705x2500: 2263.8ms
|
||||||
|
2020-März-27 17:00:54 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 7500 features in image of size 3705x2500: 2558.8ms
|
||||||
|
2020-März-27 17:01:23 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 8000 features in image of size 3705x2500: 2915.5ms
|
||||||
|
2020-März-27 17:01:57 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 8500 features in image of size 3705x2500: 3329.3ms
|
||||||
|
2020-März-27 17:02:34 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 9000 features in image of size 3705x2500: 3699.7ms
|
||||||
|
2020-März-27 17:03:15 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 9500 features in image of size 3705x2500: 4114.3ms
|
||||||
|
2020-März-27 17:04:01 nachm. [main] INFO de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask - gpu feature matching time for 10000 features in image of size 3705x2500: 4594.3ms
|
||||||
|
2020-März-27 17:04:01 nachm. [main] INFO de.unidue.nes.gpu.events.EventHandler - All tasks are finished
|
||||||
|
upload download times:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{350x232} & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{875x580} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{1750x1160} \\
|
||||||
|
& \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2625x1740} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3500x2320} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
uploading & 8.1 & 1.0 & 30.2 & 1.4 & 37.2 & 6.6 & 106.7 & 14.5 & 174.6 & 15.6 \\
|
||||||
|
& 301.4 & 15.3 & 388.4 & 26.3 & 545.6 & 18.1 & 724.9 & 25.9 & 840.4 & 8.6 \\
|
||||||
|
\hline
|
||||||
|
downloading & 14.1 & 1.1 & 42.6 & 2.9 & 54.0 & 1.1 & 148.1 & 2.5 & 193.1 & 10.0 \\
|
||||||
|
& 332.9 & 2.9 & 447.1 & 4.0 & 576.7 & 6.8 & 768.4 & 10.4 & 879.0 & 21.6 \\
|
||||||
|
\hline
|
||||||
|
combined & 18.5 & 0.5 & 70.5 & 4.9 & 88.5 & 5.4 & 246.9 & 2.1 & 340.4 & 6.9 \\
|
||||||
|
& 577.6 & 7.2 & 783.0 & 33.0 & 1014.7 & 26.1 & 1431.6 & 15.7 & 1648.2 & 17.7 \\
|
||||||
|
\hline
|
||||||
|
page-locked uploading & 4.9 & 0.5 & 13.8 & 1.5 & 17.0 & 0.8 & 44.2 & 3.1 & 59.6 & 3.5 \\
|
||||||
|
& 92.6 & 2.6 & 127.9 & 3.7 & 162.9 & 2.4 & 230.2 & 3.6 & 260.7 & 3.0 \\
|
||||||
|
\hline
|
||||||
|
page-locked downloading & 11.7 & 1.4 & 38.0 & 2.9 & 48.4 & 3.8 & 145.6 & 5.8 & 186.7 & 3.1 \\
|
||||||
|
& 300.1 & 7.7 & 412.4 & 6.2 & 543.5 & 8.4 & 729.7 & 13.0 & 844.9 & 6.9 \\
|
||||||
|
\hline
|
||||||
|
page-locked combined & 11.0 & 0.8 & 28.8 & 3.1 & 36.7 & 2.7 & 96.0 & 5.5 & 125.7 & 5.1 \\
|
||||||
|
& 194.8 & 3.2 & 269.3 & 5.5 & 340.3 & 6.3 & 486.3 & 7.2 & 557.6 & 5.1 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
pixel-wise table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{350x232} & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{875x580} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{1750x1160} \\
|
||||||
|
& \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2625x1740} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3500x2320} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU threshold & 0.0 & 0.0 & 0.2 & 0.4 & 1.0 & 0.0 & 3.1 & 0.3 & 4.8 & 0.6 \\
|
||||||
|
& 30.2 & 2.7 & 57.3 & 3.7 & 88.0 & 3.4 & 139.1 & 5.7 & 192.0 & 8.3 \\
|
||||||
|
\hline
|
||||||
|
GPU threshold & 4.5 & 1.0 & 6.5 & 0.6 & 5.1 & 0.2 & 8.2 & 0.6 & 9.8 & 0.6 \\
|
||||||
|
& 13.0 & 0.8 & 16.3 & 1.8 & 18.3 & 0.7 & 25.0 & 1.0 & 26.8 & 0.9 \\
|
||||||
|
\hline
|
||||||
|
CPU grayscale & 3.0 & 0.0 & 5.0 & 0.0 & 9.1 & 0.7 & 22.7 & 2.0 & 44.2 & 3.9 \\
|
||||||
|
& 89.6 & 3.8 & 138.7 & 2.0 & 184.1 & 4.3 & 261.8 & 5.4 & 305.5 & 5.4 \\
|
||||||
|
\hline
|
||||||
|
GPU grayscale & 4.2 & 0.6 & 5.7 & 0.4 & 7.6 & 1.0 & 13.3 & 0.6 & 16.8 & 0.8 \\
|
||||||
|
& 25.0 & 0.8 & 32.3 & 1.1 & 42.1 & 1.4 & 56.6 & 1.1 & 64.7 & 1.3 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
kernel table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{350x232} & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{875x580} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{1750x1160} \\
|
||||||
|
& \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2625x1740} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3500x2320} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU median filter & 288.0 & 1.6 & 1274.4 & 3.2 & 1694.9 & 4.1 & 4861.0 & 12.1 & 6576.8 & 38.3 \\
|
||||||
|
& 10562.2 & 131.8 & 14476.0 & 89.9 & 18433.5 & 95.8 & 25781.5 & 39.4 & 28397.5 & 36.9 \\
|
||||||
|
\hline
|
||||||
|
GPU median filter & 392.4 & 10.5 & 1223.3 & 2.2 & 1632.7 & 1.7 & 4038.3 & 2.6 & 5316.8 & 6.2 \\
|
||||||
|
& 8483.3 & 6.2 & 11461.9 & 16.7 & 14472.6 & 4.5 & 19834.1 & 5.4 & 22025.5 & 5.2 \\
|
||||||
|
\hline
|
||||||
|
CPU gaussian filter & 12.2 & 0.4 & 36.3 & 3.9 & 45.4 & 2.9 & 88.2 & 3.3 & 117.4 & 3.6 \\
|
||||||
|
& 186.4 & 4.4 & 255.4 & 40.1 & 332.1 & 24.4 & 427.6 & 13.7 & 488.4 & 14.5 \\
|
||||||
|
\hline
|
||||||
|
GPU gaussian filter & 13.1 & 0.7 & 31.2 & 0.9 & 43.0 & 3.3 & 102.7 & 2.8 & 139.5 & 1.0 \\
|
||||||
|
& 218.4 & 1.2 & 294.4 & 1.0 & 372.6 & 2.4 & 506.9 & 1.8 & 576.0 & 1.1 \\
|
||||||
|
\hline
|
||||||
|
CPU dilate & 10.0 & 0.0 & 15.7 & 0.4 & 24.2 & 0.4 & 56.8 & 0.7 & 79.4 & 1.6 \\
|
||||||
|
& 140.4 & 2.9 & 150.6 & 3.6 & 220.8 & 3.4 & 297.5 & 3.5 & 358.3 & 6.0 \\
|
||||||
|
\hline
|
||||||
|
GPU dilate & 107.1 & 11.4 & 306.4 & 2.4 & 419.8 & 2.0 & 1116.5 & 2.1 & 1489.3 & 0.9 \\
|
||||||
|
& 2442.1 & 1.0 & 3236.2 & 0.7 & 4273.7 & 0.7 & 5720.8 & 0.8 & 6355.9 & 0.5 \\
|
||||||
|
\hline
|
||||||
|
CPU erode & 10.0 & 0.0 & 15.4 & 0.4 & 24.2 & 0.4 & 56.4 & 1.0 & 79.9 & 1.2 \\
|
||||||
|
& 136.5 & 5.0 & 152.0 & 2.8 & 219.3 & 2.7 & 297.5 & 3.7 & 356.3 & 3.5 \\
|
||||||
|
\hline
|
||||||
|
GPU erode & 104.4 & 1.1 & 304.9 & 1.6 & 419.6 & 1.9 & 1118.6 & 1.1 & 1491.5 & 1.0 \\
|
||||||
|
& 2444.0 & 1.1 & 3240.2 & 1.3 & 4276.8 & 0.7 & 5724.3 & 0.7 & 6361.2 & 0.9 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
imgproc table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{350x232} & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{875x580} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{1750x1160} \\
|
||||||
|
& \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2625x1740} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3500x2320} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU edge detection & 58.4 & 0.6 & 193.3 & 3.0 & 287.4 & 1.1 & 714.9 & 11.6 & 905.4 & 8.4 \\
|
||||||
|
& 1395.3 & 3.1 & 1739.2 & 4.0 & 2154.4 & 7.9 & 2905.6 & 4.3 & 3029.8 & 16.7 \\
|
||||||
|
\hline
|
||||||
|
GPU edge detection & 53.6 & 4.0 & 98.8 & 9.5 & 103.2 & 6.2 & 241.3 & 8.5 & 309.9 & 8.6 \\
|
||||||
|
& 521.3 & 5.2 & 585.3 & 3.8 & 812.3 & 5.8 & 972.8 & 5.7 & 1151.8 & 4.4 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
pipeline table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{350x232} & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{875x580} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{1750x1160} \\
|
||||||
|
& \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2625x1740} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3500x2320} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU pipeline & 38.0 & 0.6 & 135.9 & 4.0 & 205.0 & 3.2 & 545.2 & 3.3 & 873.8 & 4.9 \\
|
||||||
|
& 1226.6 & 3.2 & 1830.5 & 3.3 & 2069.2 & 35.6 & 3011.7 & 16.5 & 3110.5 & 24.5 \\
|
||||||
|
\hline
|
||||||
|
GPU pipeline & 104.8 & 8.6 & 175.5 & 11.5 & 209.3 & 10.6 & 519.4 & 12.2 & 663.6 & 9.3 \\
|
||||||
|
& 1048.2 & 10.7 & 1345.0 & 5.7 & 1795.1 & 7.3 & 2304.6 & 10.1 & 2740.6 & 22.1 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
feature table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU - skyscraper image & 786.5 & 4.7 & 2439.7 & 23.0 & 4141.5 & 8.8 & 5747.2 & 10.4 & 7387.8 & 20.3 \\
|
||||||
|
\hline
|
||||||
|
GPU - skyscraper image & 1245.2 & 5.7 & 1502.3 & 26.5 & 2178.7 & 37.8 & 2887.4 & 19.7 & 3748.2 & 80.2 \\
|
||||||
|
\hline
|
||||||
|
CPU - motorcycle image & 824.0 & 2.2 & 2093.3 & 2.2 & 3717.3 & 6.2 & 5575.4 & 18.0 & 7658.0 & 18.6 \\
|
||||||
|
\hline
|
||||||
|
GPU - motorcycle image & 1271.4 & 12.2 & 1507.6 & 21.4 & 2165.9 & 28.6 & 2922.6 & 12.3 & 3972.3 & 30.1 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
|
feature matching table:
|
||||||
|
CPU feature matching number of features = (average time, standard deviation):
|
||||||
|
500=(99.2, 4.894895300208167)
|
||||||
|
1000=(387.3, 14.057382402140165)
|
||||||
|
1500=(808.7, 4.267317658670374)
|
||||||
|
2000=(1438.8, 40.835768634862255)
|
||||||
|
2500=(2271.9, 53.96749021401681)
|
||||||
|
3000=(3168.4, 69.92882095388138)
|
||||||
|
3500=(4343.9, 179.04102881741937)
|
||||||
|
4000=(5454.1, 110.52370786396918)
|
||||||
|
4500=(6876.5, 36.66128748421146)
|
||||||
|
5000=(8466.2, 43.76711093960852)
|
||||||
|
5500=(10235.4, 43.55272666550282)
|
||||||
|
6000=(12128.5, 11.13777356566383)
|
||||||
|
6500=(14238.7, 38.291121686364846)
|
||||||
|
7000=(16558.5, 74.38850717684822)
|
||||||
|
7500=(18984.4, 65.03568251352485)
|
||||||
|
8000=(21539.4, 32.75728926513914)
|
||||||
|
8500=(24464.7, 43.236674247680064)
|
||||||
|
9000=(27390.1, 50.84771381291394)
|
||||||
|
9500=(30487.7, 54.92185357396453)
|
||||||
|
10000=(33792.7, 66.10302564936042)
|
||||||
|
|
||||||
|
|
||||||
|
GPU feature matching number of features = (average time, standard deviation):
|
||||||
|
500=(30.7, 2.0024984394500787)
|
||||||
|
1000=(65.3, 4.360045871318329)
|
||||||
|
1500=(120.4, 2.33238075793812)
|
||||||
|
2000=(203.1, 1.0440306508910548)
|
||||||
|
2500=(317.3, 0.7810249675906655)
|
||||||
|
3000=(429.7, 0.7810249675906655)
|
||||||
|
3500=(595.5, 4.883646178829912)
|
||||||
|
4000=(757.3, 1.676305461424021)
|
||||||
|
4500=(933.9, 1.8681541692269406)
|
||||||
|
5000=(1154.6, 2.2891046284519194)
|
||||||
|
5500=(1398.0, 1.3416407864998738)
|
||||||
|
6000=(1632.7, 3.579106033634656)
|
||||||
|
6500=(1939.8, 1.1661903789690602)
|
||||||
|
7000=(2263.8, 1.4000000000000001)
|
||||||
|
7500=(2558.8, 1.2489995996796797)
|
||||||
|
8000=(2915.5, 9.912113800799505)
|
||||||
|
8500=(3329.3, 1.0049875621120892)
|
||||||
|
9000=(3699.7, 1.1874342087037917)
|
||||||
|
9500=(4114.3, 3.5227829907617068)
|
||||||
|
10000=(4594.3, 0.7810249675906654)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
stereo matching table:
|
||||||
|
\begin{tabular}{|l|rr|rr|rr|rr|rr|}
|
||||||
|
\hline
|
||||||
|
Task & \multicolumn{2}{c|}{741x500} & \multicolumn{2}{c|}{1482x1000} & \multicolumn{2}{c|}{2223x1500} & \multicolumn{2}{c|}{2964x2000} & \multicolumn{2}{c|}{3705x2500} \\
|
||||||
|
& \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$} & \multicolumn{1}{c}{$\overline{\mbox{time}}$} & \multicolumn{1}{c|}{$\sigma$}\\
|
||||||
|
\hline
|
||||||
|
CPU stereo matching & 1073.5 & 6.3 & 5578.0 & 18.1 & 13959.7 & 38.0 & 26444.8 & 57.6 & 40675.4 & 693.2 \\
|
||||||
|
\hline
|
||||||
|
GPU stereo matching & 559.2 & 18.7 & 2603.8 & 6.2 & 6239.9 & 6.4 & 11482.6 & 48.4 & 18108.7 & 10.1 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
|
||||||
@@ -31,20 +31,14 @@ configurations {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':gpu-opencvcore')
|
implementation project(':gpu-opencvcore')
|
||||||
implementation "org.eclipse.jdt:org.eclipse.jdt.annotation:${versionJdt}"
|
implementation "org.eclipse.jdt:org.eclipse.jdt.annotation:${versionJdt}"
|
||||||
implementation "com.fasterxml.jackson.core:jackson-databind:${versionJackson}"
|
|
||||||
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${versionJackson}"
|
|
||||||
implementation "javax.xml.bind:jaxb-api:${versionJaxb}"
|
|
||||||
implementation 'org.bytedeco:ffmpeg-platform:4.2.1-1.5.2'
|
|
||||||
implementation 'com.google.inject:guice:4.0'
|
|
||||||
implementation 'org.apache.logging.log4j:log4j-api:2.13.0'
|
implementation 'org.apache.logging.log4j:log4j-api:2.13.0'
|
||||||
implementation 'org.apache.logging.log4j:log4j-core:2.13.0'
|
implementation 'org.apache.logging.log4j:log4j-core:2.13.0'
|
||||||
implementation 'org.apache.logging.log4j:log4j-web:2.13.0'
|
implementation 'org.apache.logging.log4j:log4j-web:2.13.0'
|
||||||
implementation 'org.apache.logging.log4j:log4j-iostreams:2.13.0'
|
implementation 'org.apache.logging.log4j:log4j-iostreams:2.13.0'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-actuator:2.2.2.RELEASE'
|
implementation 'org.bytedeco:javacv-platform:1.5.2'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web:2.2.2.RELEASE'
|
implementation 'org.bytedeco:opencv-platform-gpu:4.1.2-1.5.2'
|
||||||
implementation 'org.springframework:spring-jdbc:5.0.9.RELEASE'
|
implementation 'com.google.guava:guava:28.2-jre'
|
||||||
|
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.2.2.RELEASE'
|
|
||||||
testImplementation "junit:junit:${versionJunit}"
|
testImplementation "junit:junit:${versionJunit}"
|
||||||
testImplementation 'org.assertj:assertj-core:3.6.2'
|
testImplementation 'org.assertj:assertj-core:3.6.2'
|
||||||
testImplementation 'org.mockito:mockito-core:3.1.0'
|
testImplementation 'org.mockito:mockito-core:3.1.0'
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
package de.unidue.nes.gpu;
|
package de.unidue.nes.gpu;
|
||||||
|
|
||||||
import org.opencv.core.Core;
|
import java.util.Arrays;
|
||||||
import org.opencv.core.CvType;
|
import java.util.List;
|
||||||
import org.opencv.core.Mat;
|
|
||||||
import org.opencv.core.Size;
|
import org.apache.logging.log4j.Level;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.core.LoggerContext;
|
||||||
|
import org.apache.logging.log4j.core.config.Configuration;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.ApplicationFinishedEvent;
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.initialization.Initializer;
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class containing the main method of this project.
|
* Class containing the main method of this project.
|
||||||
@@ -12,15 +21,77 @@ import org.opencv.core.Size;
|
|||||||
*/
|
*/
|
||||||
public class GpuTestSystem {
|
public class GpuTestSystem {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GpuTestSystem.class);
|
||||||
|
|
||||||
|
public static final int TEST_RUNS = 100;
|
||||||
|
|
||||||
|
public static boolean initPhase = false;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
|
Initializer.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println("Starting the system");
|
LOG.info("starting tests");
|
||||||
|
new GpuTestSystem().run();
|
||||||
Mat m = Mat.eye(new Size(3, 3), CvType.CV_8U);
|
|
||||||
System.out.println("A new mat:");
|
|
||||||
System.out.println(m.dump());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private LoggerContext ctx;
|
||||||
|
|
||||||
|
private Configuration config;
|
||||||
|
|
||||||
|
private Level originalLevel;
|
||||||
|
|
||||||
|
public void run() {
|
||||||
|
List<Task> tasks = getTasks();
|
||||||
|
GpuEventBus.INSTANCE.post(() -> tasks);
|
||||||
|
|
||||||
|
GpuEventBus.INSTANCE.stopListening();
|
||||||
|
LOG.info("Running tasks so dlls get loaded");
|
||||||
|
muteLogger();
|
||||||
|
initPhase = true;
|
||||||
|
|
||||||
|
// run tasks for the first time to load dlls and initialize everything
|
||||||
|
tasks.stream().peek(t -> System.out.println("starting " + t.getClass().getSimpleName())).forEach(Task::runTask);
|
||||||
|
|
||||||
|
// run again to be sure that nothing is loaded anymore
|
||||||
|
// 1 run should already be sufficient
|
||||||
|
// tasks.forEach(Task::runTask);// I'm not sure if this is necessary
|
||||||
|
|
||||||
|
resetLogger();
|
||||||
|
initPhase = false;
|
||||||
|
LOG.info("Now starting tasks to measure performance");
|
||||||
|
// now run tasks to get the runtime performance
|
||||||
|
GpuEventBus.INSTANCE.startListening();
|
||||||
|
tasks.forEach(Task::runTask);
|
||||||
|
|
||||||
|
GpuEventBus.INSTANCE.post(ApplicationFinishedEvent.EVENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetLogger() {
|
||||||
|
this.config.getRootLogger().setLevel(this.originalLevel);
|
||||||
|
this.ctx.updateLoggers();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void muteLogger() {
|
||||||
|
this.ctx = (LoggerContext) LogManager.getContext(false);
|
||||||
|
this.config = this.ctx.getConfiguration();
|
||||||
|
this.originalLevel = this.config.getRootLogger().getLevel();
|
||||||
|
this.config.getRootLogger().setLevel(Level.OFF);
|
||||||
|
this.ctx.updateLoggers();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Task> getTasks() {
|
||||||
|
|
||||||
|
return Arrays.asList(//
|
||||||
|
// new UploadDownloadTask(), //
|
||||||
|
// new PageLockedUploadDownloadTask(), //
|
||||||
|
// new PixelWiseTask(), //
|
||||||
|
// new KernelTask(), //
|
||||||
|
// new ImgProcTask(), //
|
||||||
|
new PipelineTask() //
|
||||||
|
// new FeatureBasedTask() //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package de.unidue.nes.gpu;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.CpuPipeline;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.GpuPipeline;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class PipelineTask implements Task {
|
||||||
|
|
||||||
|
public static final int TEST_RUNS = GpuTestSystem.TEST_RUNS;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
CpuPipeline cpuTask = new CpuPipeline();
|
||||||
|
GpuPipeline gpuTask = new GpuPipeline();
|
||||||
|
|
||||||
|
Mat[] images = ImageLoader.getTestImagesForPipeline();
|
||||||
|
Arrays.stream(images).forEach(cpuTask::doCannyPipeline);
|
||||||
|
|
||||||
|
images = ImageLoader.getTestImagesForPipeline();
|
||||||
|
Arrays.stream(images).forEach(gpuTask::doCannyPipeline);
|
||||||
|
|
||||||
|
Mat[][] stereoImages = ImageLoader.getStereoImages();
|
||||||
|
Arrays.stream(stereoImages).forEach(cpuTask::doStereoPipeline);
|
||||||
|
|
||||||
|
stereoImages = ImageLoader.getStereoImages();
|
||||||
|
Arrays.stream(stereoImages).forEach(gpuTask::doStereoPipeline);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package de.unidue.nes.gpu.events;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public enum ApplicationFinishedEvent {
|
||||||
|
EVENT
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package de.unidue.nes.gpu.events;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public interface ApplicationStartupEvent {
|
||||||
|
|
||||||
|
List<Task> getTasks();
|
||||||
|
}
|
||||||
@@ -0,0 +1,283 @@
|
|||||||
|
package de.unidue.nes.gpu.events;
|
||||||
|
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_CANNY;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_CANNY_PIPELINE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_DILATE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_ERODE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_FEATURE_DETECTION1;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_FEATURE_DETECTION2;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_FEATURE_MATCHING;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_GAUSSIAN_BLUR;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_GRAYSCALE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_HOUGH_CIRCLE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_MEDIAN_BLUR;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_STEREO_MATCHING;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_STEREO_PIPELINE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.CPU_THRESHOLD;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_CANNY;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_CANNY_PIPELINE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_COMBINED;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_DILATE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_DOWNLOAD;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_ERODE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_FEATURE_DETECTION1;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_FEATURE_DETECTION2;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_FEATURE_MATCHING;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_GAUSSIAN_BLUR;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_GRAYSCALE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_HOUGH_CIRCLE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_MEDIAN_BLUR;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_STEREO_MATCHING;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_STEREO_PIPELINE;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_THRESHOLD;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.GPU_UPLOAD;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.PAGE_LOCKED_GPU_COMBINED;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.PAGE_LOCKED_GPU_DOWNLOAD;
|
||||||
|
import static de.unidue.nes.gpu.events.TaskType.PAGE_LOCKED_GPU_UPLOAD;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
|
||||||
|
import com.google.common.eventbus.DeadEvent;
|
||||||
|
import com.google.common.eventbus.Subscribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class EventHandler {
|
||||||
|
|
||||||
|
private static final String HLINE_LINEBREAK = "\\hline\n";
|
||||||
|
|
||||||
|
private static final String LATEX_TABLE_END_OF_LINE = " \\\\\n";
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(EventHandler.class);
|
||||||
|
|
||||||
|
private List<TaskResultEvent> events;
|
||||||
|
|
||||||
|
private Set<TaskType> testedTasks;
|
||||||
|
|
||||||
|
public EventHandler() {
|
||||||
|
GpuEventBus.INSTANCE.register(this);
|
||||||
|
|
||||||
|
this.events = new ArrayList<>();
|
||||||
|
this.testedTasks = new HashSet<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onApplicationStartup(ApplicationStartupEvent event) {
|
||||||
|
LOG.info("The following tasks will be tested:");
|
||||||
|
event.getTasks().forEach(t -> LOG.info(t.getClass().getSimpleName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onApplicationFinished(ApplicationFinishedEvent event) {
|
||||||
|
LOG.info("All tasks are finished");
|
||||||
|
printUploadDownloadStuff();
|
||||||
|
printPixelwiseStuff();
|
||||||
|
printKernelTasks();
|
||||||
|
printImageProcTasks();
|
||||||
|
printPipelineTasks();
|
||||||
|
printFeatureTasks();
|
||||||
|
printMatchingTable();
|
||||||
|
printStereoTable();
|
||||||
|
|
||||||
|
List<TaskResultEvent> notTested = this.events.stream().filter(evt -> !this.testedTasks.contains(evt.getType())).collect(Collectors.toList());
|
||||||
|
if (!notTested.isEmpty()) {
|
||||||
|
LOG.warn("Following were not printed:");
|
||||||
|
notTested.stream().map(TaskResultEvent::getType).distinct().forEach(t -> LOG.warn(t::toString));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printMatchingTable() {
|
||||||
|
printFeatureMatchingTable("feature matching table", new TaskType[] { CPU_FEATURE_MATCHING, GPU_FEATURE_MATCHING });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printStereoTable() {
|
||||||
|
printTable("stereo matching table", new TaskType[] { CPU_STEREO_MATCHING, GPU_STEREO_MATCHING });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printFeatureTasks() {
|
||||||
|
printTable("feature table", new TaskType[] { CPU_FEATURE_DETECTION1, GPU_FEATURE_DETECTION1, CPU_FEATURE_DETECTION2, GPU_FEATURE_DETECTION2 });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printPipelineTasks() {
|
||||||
|
printTable("canny pipeline table", new TaskType[] { CPU_CANNY_PIPELINE, GPU_CANNY_PIPELINE });
|
||||||
|
printTable("stereo pipeline table", new TaskType[] { CPU_STEREO_PIPELINE, GPU_STEREO_PIPELINE });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printImageProcTasks() {
|
||||||
|
printTable("imgproc table", new TaskType[] { CPU_CANNY, GPU_CANNY, CPU_HOUGH_CIRCLE, GPU_HOUGH_CIRCLE });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printKernelTasks() {
|
||||||
|
printTable("kernel table",
|
||||||
|
new TaskType[] { CPU_MEDIAN_BLUR, GPU_MEDIAN_BLUR, CPU_GAUSSIAN_BLUR, GPU_GAUSSIAN_BLUR, CPU_DILATE, GPU_DILATE, CPU_ERODE, GPU_ERODE });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printPixelwiseStuff() {
|
||||||
|
printTable("pixel-wise table", new TaskType[] { CPU_THRESHOLD, GPU_THRESHOLD, CPU_GRAYSCALE, GPU_GRAYSCALE });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printUploadDownloadStuff() {
|
||||||
|
printTable("upload download times",
|
||||||
|
new TaskType[] { GPU_UPLOAD, GPU_DOWNLOAD, GPU_COMBINED, PAGE_LOCKED_GPU_UPLOAD, PAGE_LOCKED_GPU_DOWNLOAD, PAGE_LOCKED_GPU_COMBINED });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printFeatureMatchingTable(String tablename, TaskType[] types) {
|
||||||
|
this.testedTasks.addAll(Arrays.asList(types));
|
||||||
|
List<TaskResultEvent> eventList = this.events.stream().filter(ev -> Arrays.asList(types).contains(ev.getType())).collect(Collectors.toList());
|
||||||
|
if (eventList.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
System.out.println(tablename + ": ");
|
||||||
|
List<Integer> numberOfFeatures = IntStream.iterate(500, i -> true, i -> i + 500).limit(20).boxed().collect(Collectors.toList());
|
||||||
|
|
||||||
|
Map<TaskType, List<TaskResultEvent>> mappedEvents = new EnumMap<>(TaskType.class);
|
||||||
|
for (TaskResultEvent event : eventList) {
|
||||||
|
mappedEvents.computeIfAbsent(event.getType(), k -> new ArrayList<>()).add(event);
|
||||||
|
}
|
||||||
|
StringBuilder content = new StringBuilder();
|
||||||
|
mappedEvents.entrySet().stream().sorted(Comparator.comparingInt(entry -> entry.getKey().ordinal())).forEach(entry -> {
|
||||||
|
content.append(entry.getKey().getTitle());
|
||||||
|
content.append(" number of features = (average time, standard deviation):");
|
||||||
|
entry.getValue().sort(Comparator.comparingDouble(evt -> evt.getTimeDto().avgTime));
|
||||||
|
for (int i = 0; i < 20; i++) {
|
||||||
|
content.append("\n");
|
||||||
|
content.append(numberOfFeatures.get(i));
|
||||||
|
content.append("=");
|
||||||
|
content.append("(");
|
||||||
|
content.append(entry.getValue().get(i).getTimeDto().avgTime);
|
||||||
|
content.append(", ");
|
||||||
|
content.append(entry.getValue().get(i).getTimeDto().stdAbweichung);
|
||||||
|
content.append(")");
|
||||||
|
}
|
||||||
|
content.append("\n\n\n");
|
||||||
|
});
|
||||||
|
System.out.println(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printTable(String tablename, TaskType[] types) {
|
||||||
|
final boolean addHorizontalLines = true;
|
||||||
|
this.testedTasks.addAll(Arrays.asList(types));
|
||||||
|
List<TaskResultEvent> eventList = this.events.stream().filter(ev -> Arrays.asList(types).contains(ev.getType())).collect(Collectors.toList());
|
||||||
|
if (eventList.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
System.out.println(tablename + ": ");
|
||||||
|
|
||||||
|
List<Size> sizes = eventList.stream().map(TaskResultEvent::getImageSize).distinct().collect(Collectors.toList());
|
||||||
|
if (sizes.size() != 10 && sizes.size() != 5) {// currently only 5 or 10 elements
|
||||||
|
throw new RuntimeException(sizes.size() + "");
|
||||||
|
}
|
||||||
|
StringBuilder headline = new StringBuilder();
|
||||||
|
StringBuilder content = new StringBuilder();
|
||||||
|
buildDividedTable(addHorizontalLines, eventList, sizes, headline, content);
|
||||||
|
StringBuilder table = new StringBuilder();
|
||||||
|
table.append("\\begin{tabular}{|l|rr|rr|rr|rr|rr|}\n\\hline\n");
|
||||||
|
table.append(headline.toString());
|
||||||
|
table.append(content.toString());
|
||||||
|
table.append("\\end{tabular}");
|
||||||
|
System.out.println(table.toString());
|
||||||
|
System.out.println();
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildDividedTable(boolean addHorizontalLines, List<TaskResultEvent> eventList, List<Size> sizes, StringBuilder headline,
|
||||||
|
StringBuilder content) {
|
||||||
|
|
||||||
|
buildHeadline(sizes, headline);
|
||||||
|
buildContent(addHorizontalLines, eventList, sizes, content);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildContent(boolean addHorizontalLines, List<TaskResultEvent> eventList, List<Size> sizes, StringBuilder content) {
|
||||||
|
Map<TaskType, List<TaskResultEvent>> mappedEvents = new EnumMap<>(TaskType.class);
|
||||||
|
for (TaskResultEvent event : eventList) {
|
||||||
|
mappedEvents.computeIfAbsent(event.getType(), k -> new ArrayList<>()).add(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
mappedEvents.entrySet().stream().sorted(Comparator.comparingInt(entry -> entry.getKey().ordinal())).forEach(entry -> {
|
||||||
|
content.append(entry.getKey().getTitle());
|
||||||
|
entry.getValue().sort(Comparator.comparingDouble(evt -> evt.getImageSize().area()));
|
||||||
|
for (int i = 0; i < 5; i++) {
|
||||||
|
content.append(" & ");
|
||||||
|
content.append(((int) (entry.getValue().get(i).getTimeDto().avgTime * 10)) / 10.0);
|
||||||
|
content.append(" & ");
|
||||||
|
content.append(((int) (entry.getValue().get(i).getTimeDto().stdAbweichung * 10)) / 10.0);
|
||||||
|
}
|
||||||
|
if (sizes.size() == 10) {
|
||||||
|
content.append(LATEX_TABLE_END_OF_LINE);
|
||||||
|
for (int i = 5; i < 10; i++) {
|
||||||
|
content.append(" & ");
|
||||||
|
content.append(((int) (entry.getValue().get(i).getTimeDto().avgTime * 10)) / 10.0);
|
||||||
|
content.append(" & ");
|
||||||
|
content.append(((int) (entry.getValue().get(i).getTimeDto().stdAbweichung * 10)) / 10.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
content.append(LATEX_TABLE_END_OF_LINE);
|
||||||
|
if (addHorizontalLines) {
|
||||||
|
content.append(HLINE_LINEBREAK);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!addHorizontalLines) {
|
||||||
|
content.append(HLINE_LINEBREAK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildHeadline(List<Size> sizes, StringBuilder headline) {
|
||||||
|
headline.append("Task");
|
||||||
|
appendHeadlineRow(sizes, headline, 0);
|
||||||
|
if (sizes.size() == 10) {
|
||||||
|
headline.append(LATEX_TABLE_END_OF_LINE);
|
||||||
|
appendHeadlineRow(sizes, headline, 5);
|
||||||
|
}
|
||||||
|
headline.append(LATEX_TABLE_END_OF_LINE);
|
||||||
|
appendAvgAndSigmaRow(headline);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void appendAvgAndSigmaRow(StringBuilder headline) {
|
||||||
|
for (int i = 0; i < 5; i++) {
|
||||||
|
headline.append(" & ");
|
||||||
|
headline.append("\\multicolumn{1}{c}{");
|
||||||
|
headline.append("$\\overline{\\mbox{time}}$");
|
||||||
|
headline.append("}");
|
||||||
|
headline.append(" & ");
|
||||||
|
headline.append("\\multicolumn{1}{c|}{");
|
||||||
|
headline.append("$\\sigma$");
|
||||||
|
headline.append("}");
|
||||||
|
}
|
||||||
|
headline.append("\\\\\n\\hline\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void appendHeadlineRow(List<Size> sizes, StringBuilder headline, int index) {
|
||||||
|
for (int i = index; i < index + 5; i++) {
|
||||||
|
headline.append(" & ");
|
||||||
|
headline.append("\\multicolumn{2}{c|}{");
|
||||||
|
headline.append(sizes.get(i).toString());
|
||||||
|
headline.append("}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onTaskResult(TaskResultEvent event) {
|
||||||
|
LOG.debug(() -> "Task finished: " + event.getDescription());
|
||||||
|
this.events.add(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onDeadEvent(DeadEvent deadEvent) {
|
||||||
|
LOG.error("Dead events should not happen");
|
||||||
|
LOG.error(() -> "Following event class was not subscribed: " + deadEvent.getEvent().getClass());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package de.unidue.nes.gpu.events;
|
||||||
|
|
||||||
|
import com.google.common.eventbus.EventBus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class GpuEventBus {
|
||||||
|
|
||||||
|
public static final GpuEventBus INSTANCE;
|
||||||
|
|
||||||
|
static {
|
||||||
|
INSTANCE = new GpuEventBus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private EventBus eventBus;
|
||||||
|
private boolean listening = true;
|
||||||
|
|
||||||
|
private GpuEventBus() {
|
||||||
|
this.eventBus = new EventBus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void register(Object subscriber) {
|
||||||
|
this.eventBus.register(subscriber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void post(Object event) {
|
||||||
|
if (this.listening) {
|
||||||
|
this.eventBus.post(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void post(ApplicationStartupEvent event) {
|
||||||
|
if (this.listening) {
|
||||||
|
this.eventBus.post(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void post(ApplicationFinishedEvent event) {
|
||||||
|
if (this.listening) {
|
||||||
|
this.eventBus.post(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stopListening() {
|
||||||
|
this.listening = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startListening() {
|
||||||
|
this.listening = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package de.unidue.nes.gpu.events;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class TaskFinishedEvent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package de.unidue.nes.gpu.events;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class TaskResultEvent {
|
||||||
|
|
||||||
|
private long executionTime;
|
||||||
|
|
||||||
|
private TimeUnit unit;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private int executionRuns;
|
||||||
|
|
||||||
|
private Size imageSize;
|
||||||
|
|
||||||
|
private TaskType type;
|
||||||
|
|
||||||
|
private TimeDto timeDto;
|
||||||
|
|
||||||
|
public TaskResultEvent(long executionTime, String description, int executionRuns, Size imageSize, TaskType type) {
|
||||||
|
this(executionTime, TimeUnit.MILLISECONDS, description, executionRuns, imageSize, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TaskResultEvent(String description, int executionRuns, Size imageSize, TaskType type, TimeDto time) {
|
||||||
|
this(0, TimeUnit.MILLISECONDS, description, executionRuns, imageSize, type);
|
||||||
|
this.timeDto = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
private TaskResultEvent(long executionTime, TimeUnit unit, String description, int executionRuns, Size imageSize, TaskType type) {
|
||||||
|
this.executionTime = executionTime;
|
||||||
|
this.unit = unit;
|
||||||
|
this.description = description;
|
||||||
|
this.executionRuns = executionRuns;
|
||||||
|
this.imageSize = imageSize;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TaskResultEvent(TimeDto time, String description, int iterations, Size imageSize, TaskType type) {
|
||||||
|
this(description, iterations, imageSize, type, time);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the executionTime
|
||||||
|
*/
|
||||||
|
public long getExecutionTime() {
|
||||||
|
return this.executionTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the unit
|
||||||
|
*/
|
||||||
|
public TimeUnit getUnit() {
|
||||||
|
return this.unit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the description
|
||||||
|
*/
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the executionRuns
|
||||||
|
*/
|
||||||
|
public int getExecutionRuns() {
|
||||||
|
return this.executionRuns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Size getImageSize() {
|
||||||
|
return this.imageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TaskType getType() {
|
||||||
|
return this.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TimeDto getTimeDto() {
|
||||||
|
return this.timeDto;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package de.unidue.nes.gpu.events;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class TaskStartedEvent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package de.unidue.nes.gpu.events;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public enum TaskType {
|
||||||
|
GPU_UPLOAD("uploading"), GPU_DOWNLOAD("downloading"), GPU_COMBINED("combined"), //
|
||||||
|
PAGE_LOCKED_GPU_UPLOAD("page-locked uploading"), PAGE_LOCKED_GPU_DOWNLOAD("page-locked downloading"), PAGE_LOCKED_GPU_COMBINED("page-locked combined"),
|
||||||
|
CPU_THRESHOLD("CPU threshold"), GPU_THRESHOLD("GPU threshold"), CPU_GRAYSCALE("CPU grayscale"), GPU_GRAYSCALE("GPU grayscale"), //
|
||||||
|
CPU_MEDIAN_BLUR("CPU median filter"), GPU_MEDIAN_BLUR("GPU median filter"), //
|
||||||
|
CPU_GAUSSIAN_BLUR("CPU gaussian filter"), GPU_GAUSSIAN_BLUR("GPU gaussian filter"), //
|
||||||
|
CPU_CANNY("CPU edge detection"), GPU_CANNY("GPU edge detection"), CPU_HOUGH_CIRCLE("CPU circle detection"), GPU_HOUGH_CIRCLE("GPU circle detection"), //
|
||||||
|
CPU_CANNY_PIPELINE("CPU canny pipeline"), GPU_CANNY_PIPELINE("GPU canny pipeline"), CPU_STEREO_PIPELINE("CPU stereo pipeline"),
|
||||||
|
GPU_STEREO_PIPELINE("GPU stereo pipeline"), //
|
||||||
|
CPU_FEATURE_DETECTION("CPU feature detection"), GPU_FEATURE_DETECTION("GPU feature detection"), //
|
||||||
|
CPU_FEATURE_MATCHING("CPU feature matching"), GPU_FEATURE_MATCHING("GPU feature matching"), //
|
||||||
|
CPU_STEREO_MATCHING("CPU stereo matching"), GPU_STEREO_MATCHING("GPU stereo matching"), CPU_FEATURE_DETECTION1("CPU - skyscraper image"),
|
||||||
|
GPU_FEATURE_DETECTION1("GPU - skyscraper image"), CPU_FEATURE_DETECTION2("CPU - motorcycle image"), GPU_FEATURE_DETECTION2("GPU - motorcycle image"), //
|
||||||
|
CPU_DILATE("CPU dilate"), GPU_DILATE("GPU dilate"), CPU_ERODE("CPU erode"), GPU_ERODE("GPU erode");
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private TaskType(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return this.title;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package de.unidue.nes.gpu.initialization;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class InitializationException extends RuntimeException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1880968305764734752L;
|
||||||
|
|
||||||
|
public InitializationException(String string) {
|
||||||
|
super(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package de.unidue.nes.gpu.initialization;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_core;
|
||||||
|
import org.opencv.core.CvType;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.EventHandler;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class which is used to initialize everything
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class Initializer {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(Initializer.class);
|
||||||
|
|
||||||
|
private Initializer() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void init() {
|
||||||
|
System.out.println("some print statement");
|
||||||
|
|
||||||
|
LOG.info("Loading opencv dll");
|
||||||
|
System.loadLibrary("opencv_java411");
|
||||||
|
|
||||||
|
LOG.info("Loading CUDA module");
|
||||||
|
int count = opencv_core.getCudaEnabledDeviceCount();
|
||||||
|
LOG.info(() -> "Number of Cuda enabled devices: " + count);
|
||||||
|
if (count <= 0) {
|
||||||
|
LOG.warn("no cuda enabled device was found");
|
||||||
|
throw new InitializationException("no cuda enabled device was found");
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG.info("creating EventHandler");
|
||||||
|
new EventHandler();
|
||||||
|
|
||||||
|
LOG.info("loading and verifying test images");
|
||||||
|
Mat[] images = ImageLoader.getTestImages();
|
||||||
|
if (Arrays.stream(images).anyMatch(Mat::empty)) {
|
||||||
|
throw new RuntimeException("invalid test images");
|
||||||
|
}
|
||||||
|
if (images.length == 0) {
|
||||||
|
throw new RuntimeException("no test images");
|
||||||
|
}
|
||||||
|
Mat[][] stereoImages = ImageLoader.getStereoImages();
|
||||||
|
if (!Arrays.stream(stereoImages).allMatch(mats -> mats.length == 2 && !mats[0].empty() && !mats[1].empty() && mats[0].size().equals(mats[1].size()))) {
|
||||||
|
throw new RuntimeException("invalid stereo images");
|
||||||
|
}
|
||||||
|
if (stereoImages.length == 0) {
|
||||||
|
throw new RuntimeException("no stereo test images");
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sizeBuilder = new StringBuilder();
|
||||||
|
sizeBuilder.append(images[0].size().toString());
|
||||||
|
for (int i = 1; i < images.length; i++) {
|
||||||
|
sizeBuilder.append(", ");
|
||||||
|
sizeBuilder.append(images[i].size().toString());
|
||||||
|
}
|
||||||
|
LOG.info(() -> "test image sizes: " + sizeBuilder.toString());
|
||||||
|
|
||||||
|
StringBuilder sizeBuilder2 = new StringBuilder();
|
||||||
|
sizeBuilder2.append(stereoImages[0][0].size().toString());
|
||||||
|
for (int i = 1; i < stereoImages.length; i++) {
|
||||||
|
sizeBuilder2.append(", ");
|
||||||
|
sizeBuilder2.append(stereoImages[i][0].size().toString());
|
||||||
|
}
|
||||||
|
LOG.info(() -> "stereo test image sizes: " + sizeBuilder2.toString());
|
||||||
|
|
||||||
|
testInitialization();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void testInitialization() {
|
||||||
|
Mat m = Mat.eye(new Size(3, 3), CvType.CV_8U);
|
||||||
|
if (m.empty()) {
|
||||||
|
throw new InitializationException("OpenCV was not initialized");
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG.info(() -> "Some hardware information:");
|
||||||
|
LOG.info(() -> "OS name: " + System.getProperty("os.name"));
|
||||||
|
LOG.info(() -> "OS type: " + System.getProperty("os.arch"));
|
||||||
|
LOG.info(() -> "OS version: " + System.getProperty("os.version"));
|
||||||
|
LOG.info("System environment information:");
|
||||||
|
// Map<String, String> env = System.getenv();
|
||||||
|
// env.entrySet().stream().forEach(entry -> LOG.info(() -> entry.getKey() + ": " + entry.getValue()));
|
||||||
|
LOG.info(() -> "Processor identifier: " + System.getenv("PROCESSOR_IDENTIFIER"));
|
||||||
|
LOG.info(() -> "Processor architecture: " + System.getenv("PROCESSOR_ARCHITECTURE"));
|
||||||
|
LOG.info(() -> "Number of processors: " + System.getenv("NUMBER_OF_PROCESSORS"));
|
||||||
|
|
||||||
|
LOG.info("CUDA information following:");
|
||||||
|
opencv_core.printCudaDeviceInfo(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the top-level definition of a task which should be tested
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public interface Task {
|
||||||
|
|
||||||
|
void runTask();
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.PixelWiseTask;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUColoring {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUColoring.class);
|
||||||
|
|
||||||
|
public void grayScale(Mat image) {
|
||||||
|
LOG.debug(() -> "grayscaling an image of size " + image.size().toString());
|
||||||
|
Mat gray = new Mat();
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> Imgproc.cvtColor(image, gray, Imgproc.COLOR_BGR2GRAY), PixelWiseTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "Grayscaling the image of size " + image.size() + " took " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", PixelWiseTask.TEST_RUNS, image.size(), TaskType.CPU_GRAYSCALE, time));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.CvType;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.MatOfPoint;
|
||||||
|
import org.opencv.core.Scalar;
|
||||||
|
import org.opencv.highgui.HighGui;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUContourRecognition {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUContourRecognition.class);
|
||||||
|
|
||||||
|
public void findContours(Mat image) {
|
||||||
|
|
||||||
|
List<MatOfPoint> contours = new ArrayList<>();
|
||||||
|
Mat hierarchy = new Mat();
|
||||||
|
|
||||||
|
long time1 = System.currentTimeMillis();
|
||||||
|
for (int i = 0; i < 1000; i++) {
|
||||||
|
Imgproc.findContours(image, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);
|
||||||
|
contours.clear();
|
||||||
|
// hierarchy.create(0, 0, CvType.CV_8U);
|
||||||
|
}
|
||||||
|
long time2 = System.currentTimeMillis();
|
||||||
|
// drawContours(image, contours, hierarchy);
|
||||||
|
for (int i = 0; i < 1000; i++) {
|
||||||
|
Imgproc.findContours(image, contours, hierarchy, Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE);
|
||||||
|
contours.clear();
|
||||||
|
// hierarchy.create(0, 0, CvType.CV_8U);
|
||||||
|
}
|
||||||
|
// drawContours(image, contours, hierarchy);
|
||||||
|
long time3 = System.currentTimeMillis();
|
||||||
|
|
||||||
|
LOG.info(() -> "External Contours: " + (time2 - time1) + "ms");
|
||||||
|
LOG.info(() -> "All Contours: " + (time3 - time2) + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawContours(Mat image, List<MatOfPoint> contours, Mat hierarchy) {
|
||||||
|
HighGui.imshow("original image", image);
|
||||||
|
Mat contImg = new Mat(image.width(), image.height(), CvType.CV_8UC3);
|
||||||
|
contImg.setTo(new Scalar(0, 0, 0));
|
||||||
|
for (int i = 0; i < contours.size(); i++) {
|
||||||
|
Imgproc.drawContours(contImg, contours, i, new Scalar(0, 0, 255));
|
||||||
|
}
|
||||||
|
HighGui.imshow("contour image", contImg);
|
||||||
|
HighGui.waitKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.ImgProcTask;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUEdgeDetection {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUEdgeDetection.class);
|
||||||
|
|
||||||
|
public void findEdges(Mat img) {
|
||||||
|
Mat edges = new Mat();
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> Imgproc.Canny(img, edges, 35, 100), ImgProcTask.TEST_RUNS);
|
||||||
|
|
||||||
|
// HighGui.imshow("CPU edges", edges);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
LOG.info(() -> "cpu execution time for image of size " + img.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", ImgProcTask.TEST_RUNS, img.size(), TaskType.CPU_CANNY, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.MatOfDMatch;
|
||||||
|
import org.opencv.core.MatOfKeyPoint;
|
||||||
|
import org.opencv.features2d.DescriptorMatcher;
|
||||||
|
import org.opencv.features2d.ORB;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUFeatureMatching {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUFeatureMatching.class);
|
||||||
|
|
||||||
|
public void matchFeatures(Mat[] images) {
|
||||||
|
if (images.length != 2) {
|
||||||
|
throw new RuntimeException("This should not happen");
|
||||||
|
}
|
||||||
|
ORB orb = ORB.create();
|
||||||
|
DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
|
||||||
|
|
||||||
|
Mat mask = new Mat();
|
||||||
|
|
||||||
|
MatOfKeyPoint imageKeypoints = new MatOfKeyPoint();
|
||||||
|
Mat imageDescriptors = new Mat();
|
||||||
|
|
||||||
|
MatOfKeyPoint testKeyPoints = new MatOfKeyPoint();
|
||||||
|
Mat testDescriptors = new Mat();
|
||||||
|
MatOfDMatch matches = new MatOfDMatch();
|
||||||
|
|
||||||
|
long time = TimingService.measureTime(() -> {
|
||||||
|
orb.detectAndCompute(images[0], mask, imageKeypoints, imageDescriptors);
|
||||||
|
orb.detectAndCompute(images[1], mask, testKeyPoints, testDescriptors);
|
||||||
|
matcher.match(testDescriptors, imageDescriptors, matches);
|
||||||
|
}, GpuTestSystem.TEST_RUNS);
|
||||||
|
// Just for debugging
|
||||||
|
// List<DMatch> matchList = matches.toList();
|
||||||
|
// matchList = matchList.stream().sorted((match1, match2) -> Float.compare(match1.distance, match2.distance)).limit(25).collect(Collectors.toList());
|
||||||
|
// matches.fromList(matchList);
|
||||||
|
// Mat outImg = new Mat();
|
||||||
|
// Features2d.drawMatches(images[0], imageKeypoints, images[1], testKeyPoints, matches, outImg);
|
||||||
|
// Imgproc.resize(outImg, outImg, new Size(), 0.25, 0.25);
|
||||||
|
// HighGui.imshow("matches", outImg);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
LOG.info(() -> "cpu execution time for images of size " + images[0].size() + ": " + time + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.KernelTask;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUFiltering {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUFiltering.class);
|
||||||
|
|
||||||
|
public void runMedianFiltering(Mat img) {
|
||||||
|
Mat dst = new Mat();
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> Imgproc.medianBlur(img, dst, 15), KernelTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "median filter on size: " + img.size() + " took " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", KernelTask.TEST_RUNS, img.size(), TaskType.CPU_MEDIAN_BLUR, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void runGaussianBlur(Mat img) {
|
||||||
|
Mat dst = new Mat();
|
||||||
|
Size size = new Size(15, 15);
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> Imgproc.GaussianBlur(img, dst, size, 0, 0), KernelTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "gaussian filter on size: " + img.size() + " took " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", KernelTask.TEST_RUNS, img.size(), TaskType.CPU_GAUSSIAN_BLUR, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.MatOfFloat;
|
||||||
|
import org.opencv.core.MatOfInt;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUHistogramming {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUHistogramming.class);
|
||||||
|
|
||||||
|
public void calcHistogram(Mat img) {
|
||||||
|
MatOfInt channels = new MatOfInt(0);
|
||||||
|
Mat mask = new Mat();
|
||||||
|
Mat hist = new Mat();
|
||||||
|
MatOfInt histSize = new MatOfInt(256);
|
||||||
|
MatOfFloat ranges = new MatOfFloat(0, 256);
|
||||||
|
List<Mat> images = Collections.singletonList(img);
|
||||||
|
|
||||||
|
long time = TimingService.measureTime(() -> Imgproc.calcHist(images, channels, mask, hist, histSize, ranges), GpuTestSystem.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "histogram for image of size " + img.size() + ": " + time + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CPUHomography {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.ImgProcTask;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUHoughCircles {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUHoughCircles.class);
|
||||||
|
|
||||||
|
public void detectCircles(Mat img) {
|
||||||
|
Mat circles = new Mat();
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> Imgproc.HoughCircles(img, circles, Imgproc.HOUGH_GRADIENT, 2.5, (double) img.rows() / 5, 64, 50),
|
||||||
|
ImgProcTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "image size: " + img.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", ImgProcTask.TEST_RUNS, img.size(), TaskType.CPU_HOUGH_CIRCLE, time));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUMedianFilterImpl {
|
||||||
|
|
||||||
|
public void applyMedianFilter(Mat mat) {
|
||||||
|
Imgproc.medianBlur(mat, mat, 15);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.KernelTask;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CPUMorph {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUMorph.class);
|
||||||
|
|
||||||
|
public void morph(Mat img) {
|
||||||
|
|
||||||
|
Mat dst = new Mat();
|
||||||
|
Mat kernel = Imgproc.getStructuringElement(Imgproc.CV_SHAPE_RECT, new Size(15, 15));
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> Imgproc.dilate(img, dst, kernel), KernelTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "dilate on size: " + img.size() + " took " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", KernelTask.TEST_RUNS, img.size(), TaskType.CPU_DILATE, time));
|
||||||
|
|
||||||
|
TimeDto time2 = TimingService.testPerformance(() -> Imgproc.erode(img, dst, kernel), KernelTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "erode on size: " + img.size() + " took " + time2 + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", KernelTask.TEST_RUNS, img.size(), TaskType.CPU_ERODE, time2));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUResizing {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUResizing.class);
|
||||||
|
|
||||||
|
public void resize(Mat img, Size size) {
|
||||||
|
// LOG.debug(() -> "resizing image from size " + img.size() + " to size " + size);
|
||||||
|
|
||||||
|
Mat dst = new Mat();
|
||||||
|
long time = TimingService.measureTime(() -> Imgproc.resize(img, dst, size), GpuTestSystem.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "resizing image from size " + img.size() + " to size " + size + " took " + time + "ms.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.calib3d.StereoBM;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUStereoMatching {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUStereoMatching.class);
|
||||||
|
|
||||||
|
public void matchImages(Mat leftImage, Mat rightImage) {
|
||||||
|
StereoBM matcher = StereoBM.create(256, 15);
|
||||||
|
Mat disparity = new Mat();
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> matcher.compute(leftImage, rightImage, disparity), FeatureBasedTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "cpu stereo matching took of image size " + leftImage.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", FeatureBasedTask.TEST_RUNS, leftImage.size(), TaskType.CPU_STEREO_MATCHING, time));
|
||||||
|
// Just for debugging
|
||||||
|
// Imgproc.resize(disparity, disparity, new Size(), 0.5, 0.5);
|
||||||
|
// disparity.convertTo(disparity, CvType.CV_8U, 0.075);
|
||||||
|
// HighGui.imshow("cpu", disparity);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.PixelWiseTask;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUThresholding {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUThresholding.class);
|
||||||
|
|
||||||
|
public void threshold(Mat mat) {
|
||||||
|
Mat res = new Mat();
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> Imgproc.threshold(mat, res, 128, 255, Imgproc.THRESH_BINARY), PixelWiseTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "thresholding image from size " + mat.size() + " took " + time + "ms.");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", PixelWiseTask.TEST_RUNS, mat.size(), TaskType.CPU_THRESHOLD, time));
|
||||||
|
// Mat show = new Mat();
|
||||||
|
// Imgproc.resize(mat, show, new Size(1000, 662));
|
||||||
|
// Imgproc.resize(res, res, new Size(1000, 662));
|
||||||
|
//
|
||||||
|
// HighGui.imshow("image", show);
|
||||||
|
// HighGui.imshow("thresholded image", res);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.calib3d.Calib3d;
|
||||||
|
import org.opencv.core.Core;
|
||||||
|
import org.opencv.core.DMatch;
|
||||||
|
import org.opencv.core.KeyPoint;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.MatOfDMatch;
|
||||||
|
import org.opencv.core.MatOfKeyPoint;
|
||||||
|
import org.opencv.core.MatOfPoint2f;
|
||||||
|
import org.opencv.core.Point;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
import org.opencv.features2d.DescriptorMatcher;
|
||||||
|
import org.opencv.features2d.ORB;
|
||||||
|
import org.opencv.imgcodecs.Imgcodecs;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CPUWarping {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CPUWarping.class);
|
||||||
|
|
||||||
|
private static final String IMG_PATH = "src/main/resources/car.jpg";
|
||||||
|
|
||||||
|
private static final String IMG_PATH_MIRRORED = "src/main/resources/car_mirrored.jpg";
|
||||||
|
|
||||||
|
private Mat[] testImages;
|
||||||
|
|
||||||
|
private Mat[] mirroredTestImages;
|
||||||
|
|
||||||
|
private ORB orb;
|
||||||
|
|
||||||
|
private DescriptorMatcher matcher;
|
||||||
|
|
||||||
|
public CPUWarping() {
|
||||||
|
this.testImages = new Mat[] { Imgcodecs.imread(IMG_PATH), Imgcodecs.imread(IMG_PATH), Imgcodecs.imread(IMG_PATH), Imgcodecs.imread(IMG_PATH) };
|
||||||
|
Imgproc.resize(this.testImages[1], this.testImages[1], new Size(), 2.5, 2.5);
|
||||||
|
Imgproc.resize(this.testImages[2], this.testImages[2], new Size(), 5, 5);
|
||||||
|
Imgproc.resize(this.testImages[3], this.testImages[3], new Size(), 10, 10);
|
||||||
|
|
||||||
|
this.mirroredTestImages = new Mat[] { Imgcodecs.imread(IMG_PATH_MIRRORED), Imgcodecs.imread(IMG_PATH_MIRRORED), Imgcodecs.imread(IMG_PATH_MIRRORED),
|
||||||
|
Imgcodecs.imread(IMG_PATH_MIRRORED) };
|
||||||
|
Imgproc.resize(this.mirroredTestImages[1], this.mirroredTestImages[1], new Size(), 2.5, 2.5);
|
||||||
|
Imgproc.resize(this.mirroredTestImages[2], this.mirroredTestImages[2], new Size(), 5, 5);
|
||||||
|
Imgproc.resize(this.mirroredTestImages[3], this.mirroredTestImages[3], new Size(), 10, 10);
|
||||||
|
|
||||||
|
this.orb = ORB.create();
|
||||||
|
this.matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void warpImages() {
|
||||||
|
Mat homography1 = getHomography(this.testImages[0], this.mirroredTestImages[0]);
|
||||||
|
Mat warped = new Mat();
|
||||||
|
|
||||||
|
long time1 = TimingService.measureTime(() -> Imgproc.warpPerspective(this.mirroredTestImages[0], warped, homography1, this.testImages[0].size()), 100);
|
||||||
|
|
||||||
|
// HighGui.imshow("test image", this.testImages[0]);
|
||||||
|
// HighGui.imshow("warped image", warped);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
// HighGui.destroyAllWindows();
|
||||||
|
|
||||||
|
Imgproc.medianBlur(this.testImages[1], this.testImages[1], 9);
|
||||||
|
Imgproc.medianBlur(this.mirroredTestImages[1], this.mirroredTestImages[1], 9);
|
||||||
|
Mat homography2 = getHomography(this.testImages[1], this.mirroredTestImages[1]);
|
||||||
|
long time2 = TimingService.measureTime(() -> Imgproc.warpPerspective(this.mirroredTestImages[1], warped, homography2, this.testImages[1].size()), 100);
|
||||||
|
|
||||||
|
// HighGui.imshow("test image", this.testImages[1]);
|
||||||
|
// HighGui.imshow("warped image", warped);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
// HighGui.destroyAllWindows();
|
||||||
|
|
||||||
|
Imgproc.medianBlur(this.testImages[2], this.testImages[2], 15);
|
||||||
|
Imgproc.medianBlur(this.mirroredTestImages[2], this.mirroredTestImages[2], 15);
|
||||||
|
Mat homography3 = getHomography(this.testImages[2], this.mirroredTestImages[2]);
|
||||||
|
long time3 = TimingService.measureTime(() -> Imgproc.warpPerspective(this.mirroredTestImages[2], warped, homography3, this.testImages[2].size()), 100);
|
||||||
|
|
||||||
|
// HighGui.imshow("test image", this.testImages[2]);
|
||||||
|
// HighGui.imshow("warped image", warped);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
// HighGui.destroyAllWindows();
|
||||||
|
|
||||||
|
Imgproc.medianBlur(this.testImages[3], this.testImages[3], 15);
|
||||||
|
Imgproc.medianBlur(this.mirroredTestImages[3], this.mirroredTestImages[3], 15);
|
||||||
|
Mat homography4 = getHomography(this.testImages[3], this.mirroredTestImages[3]);
|
||||||
|
long time4 = TimingService.measureTime(() -> Imgproc.warpPerspective(this.mirroredTestImages[3], warped, homography4, this.testImages[3].size()), 100);
|
||||||
|
|
||||||
|
// HighGui.imshow("test image", this.testImages[3]);
|
||||||
|
// HighGui.imshow("warped image", warped);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
// HighGui.destroyAllWindows();
|
||||||
|
|
||||||
|
LOG.info(() -> "original image: " + time1 + "ms");
|
||||||
|
LOG.info(() -> "2.5x image: " + time2 + "ms");
|
||||||
|
LOG.info(() -> "5x image: " + time3 + "ms");
|
||||||
|
LOG.info(() -> "10x image: " + time4 + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mat getHomography(Mat ref, Mat image) {
|
||||||
|
Mat refGray = new Mat();
|
||||||
|
Mat imGray = new Mat();
|
||||||
|
Imgproc.cvtColor(ref, refGray, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.cvtColor(image, imGray, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
|
||||||
|
MatOfKeyPoint imgKeypoints = new MatOfKeyPoint();
|
||||||
|
Mat imgDescriptors = new Mat();
|
||||||
|
|
||||||
|
MatOfKeyPoint refKeypoints = new MatOfKeyPoint();
|
||||||
|
Mat refDescriptors = new Mat();
|
||||||
|
|
||||||
|
this.orb.detectAndCompute(imGray, new Mat(), imgKeypoints, imgDescriptors);
|
||||||
|
this.orb.detectAndCompute(refGray, new Mat(), refKeypoints, refDescriptors);
|
||||||
|
|
||||||
|
MatOfDMatch matches = new MatOfDMatch();
|
||||||
|
this.matcher.match(imgDescriptors, refDescriptors, matches, new Mat());
|
||||||
|
|
||||||
|
// Sort matches by score
|
||||||
|
List<DMatch> matchList = matches.toList();
|
||||||
|
matchList.sort((match1, match2) -> Float.compare(match1.distance, match2.distance));
|
||||||
|
|
||||||
|
// Remove not so good matches
|
||||||
|
final int numGoodMatches = (int) (matchList.size() * 0.1);
|
||||||
|
matchList = new ArrayList<>(matchList.subList(0, numGoodMatches));
|
||||||
|
|
||||||
|
matches.fromList(matchList);
|
||||||
|
|
||||||
|
// Mat outImg = new Mat();
|
||||||
|
// Features2d.drawMatches(ref, refKeypoints, image, imgKeypoints, matches, outImg);
|
||||||
|
// HighGui.imshow("Matches", outImg);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
|
||||||
|
// Extract location of good matches
|
||||||
|
List<Point> points1 = new ArrayList<>();
|
||||||
|
List<Point> points2 = new ArrayList<>();
|
||||||
|
List<KeyPoint> imgkpList = imgKeypoints.toList();
|
||||||
|
List<KeyPoint> refkpList = refKeypoints.toList();
|
||||||
|
for (int i = 0; i < matchList.size(); i++) {
|
||||||
|
points1.add(imgkpList.get(matchList.get(i).queryIdx).pt);
|
||||||
|
points2.add(refkpList.get(matchList.get(i).trainIdx).pt);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find homography
|
||||||
|
MatOfPoint2f p1 = new MatOfPoint2f();
|
||||||
|
MatOfPoint2f p2 = new MatOfPoint2f();
|
||||||
|
p1.fromArray(points1.toArray(new Point[0]));
|
||||||
|
p2.fromArray(points2.toArray(new Point[0]));
|
||||||
|
Mat h = Calib3d.findHomography(p1, p2, Calib3d.RANSAC);
|
||||||
|
if (h.empty()) {
|
||||||
|
LOG.error("this should not happen");
|
||||||
|
throw new RuntimeException("This should not happen");
|
||||||
|
}
|
||||||
|
|
||||||
|
double det = Core.determinant(h);
|
||||||
|
LOG.debug(() -> "Det(H)=" + det);
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.cputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.MatOfDMatch;
|
||||||
|
import org.opencv.core.MatOfKeyPoint;
|
||||||
|
import org.opencv.features2d.DescriptorMatcher;
|
||||||
|
import org.opencv.features2d.ORB;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CpuFeatureTask {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CpuFeatureTask.class);
|
||||||
|
|
||||||
|
public void detectAndCompute1(Mat image) {
|
||||||
|
ORB orb = ORB.create();
|
||||||
|
Mat mask = new Mat();
|
||||||
|
|
||||||
|
MatOfKeyPoint imageKeypoints = new MatOfKeyPoint();
|
||||||
|
Mat imageDescriptors = new Mat();
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
orb.detectAndCompute(image, mask, imageKeypoints, imageDescriptors);
|
||||||
|
}, FeatureBasedTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "cpu feature detection time for images of size " + image.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", FeatureBasedTask.TEST_RUNS, image.size(), TaskType.CPU_FEATURE_DETECTION1, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void detectAndCompute2(Mat image) {
|
||||||
|
ORB orb = ORB.create();
|
||||||
|
Mat mask = new Mat();
|
||||||
|
|
||||||
|
MatOfKeyPoint imageKeypoints = new MatOfKeyPoint();
|
||||||
|
Mat imageDescriptors = new Mat();
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
orb.detectAndCompute(image, mask, imageKeypoints, imageDescriptors);
|
||||||
|
}, FeatureBasedTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "cpu feature detection time for images of size " + image.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", FeatureBasedTask.TEST_RUNS, image.size(), TaskType.CPU_FEATURE_DETECTION2, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void match(Mat image, int nfeatures) {
|
||||||
|
ORB orb = ORB.create(nfeatures);
|
||||||
|
DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
|
||||||
|
Mat mask = new Mat();
|
||||||
|
|
||||||
|
MatOfKeyPoint imageKeypoints = new MatOfKeyPoint();
|
||||||
|
Mat imageDescriptors = new Mat();
|
||||||
|
|
||||||
|
MatOfKeyPoint testKeyPoints = new MatOfKeyPoint();
|
||||||
|
Mat testDescriptors = new Mat();
|
||||||
|
MatOfDMatch matches = new MatOfDMatch();
|
||||||
|
|
||||||
|
orb.detectAndCompute(image, mask, imageKeypoints, imageDescriptors);
|
||||||
|
orb.detectAndCompute(image, mask, testKeyPoints, testDescriptors);
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
matcher.match(testDescriptors, imageDescriptors, matches);
|
||||||
|
}, FeatureBasedTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "cpu feature matching time for " + imageKeypoints.toArray().length + " features in image of size " + image.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", FeatureBasedTask.TEST_RUNS, image.size(), TaskType.CPU_FEATURE_MATCHING, time));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudaimgproc;
|
||||||
|
import org.bytedeco.opencv.global.opencv_imgproc;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.PixelWiseTask;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUColoring {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUColoring.class);
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUColoring() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void grayScale(Mat image) {
|
||||||
|
LOG.debug(() -> "grayscaling an image of size " + image.size().toString());
|
||||||
|
|
||||||
|
TimeDto time;
|
||||||
|
try (GpuMat gpuImg = new GpuMat();
|
||||||
|
GpuMat grayImg = new GpuMat();
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat javacvMat = new org.bytedeco.opencv.opencv_core.Mat()) {
|
||||||
|
this.converter.convert(image, javacvMat);
|
||||||
|
gpuImg.upload(javacvMat);
|
||||||
|
time = TimingService.testPerformance(() -> opencv_cudaimgproc.cvtColor(gpuImg, grayImg, opencv_imgproc.COLOR_BGR2GRAY), PixelWiseTask.TEST_RUNS);
|
||||||
|
}
|
||||||
|
LOG.info(() -> "Grayscaling the image of size " + image.size() + " took " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", PixelWiseTask.TEST_RUNS, image.size(), TaskType.GPU_GRAYSCALE, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUContourRecognition {
|
||||||
|
|
||||||
|
public void findContours(Mat image) {
|
||||||
|
throw new UnsupportedOperationException("No GPU contour algorithm");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudaimgproc;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_cudaimgproc.CannyEdgeDetector;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.ImgProcTask;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUEdgeDetection {
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUEdgeDetection.class);
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUEdgeDetection() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findEdges(Mat img) {
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat javacvMat = new org.bytedeco.opencv.opencv_core.Mat();
|
||||||
|
this.converter.convert(img, javacvMat);
|
||||||
|
TimeDto time;
|
||||||
|
try (GpuMat gpuImg = new GpuMat(); GpuMat gpuEdges = new GpuMat(); CannyEdgeDetector detector = opencv_cudaimgproc.createCannyEdgeDetector(35, 100)) {
|
||||||
|
gpuImg.upload(javacvMat);
|
||||||
|
time = TimingService.testPerformance(() -> detector.detect(gpuImg, gpuEdges), ImgProcTask.TEST_RUNS);
|
||||||
|
|
||||||
|
// gpuEdges.download(javacvMat);
|
||||||
|
// opencv_highgui.imshow("GPU edges", javacvMat);
|
||||||
|
// opencv_highgui.waitKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG.info(() -> "gpu execution time for image of size " + img.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", ImgProcTask.TEST_RUNS, img.size(), TaskType.GPU_CANNY, time));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import static org.bytedeco.opencv.global.opencv_core.NORM_HAMMING;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.opencv_core.DMatchVector;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_core.KeyPointVector;
|
||||||
|
import org.bytedeco.opencv.opencv_core.Mat;
|
||||||
|
import org.bytedeco.opencv.opencv_cudafeatures2d.DescriptorMatcher;
|
||||||
|
import org.bytedeco.opencv.opencv_cudafeatures2d.ORB;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUFeatureMatching {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUFeatureMatching.class);
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUFeatureMatching() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void matchFeatures(org.opencv.core.Mat[] images) {
|
||||||
|
if (images.length != 2) {
|
||||||
|
throw new RuntimeException("This should not happen");
|
||||||
|
}
|
||||||
|
// Watch out:https://github.com/opencv/opencv/issues/10573 --> if picture too
|
||||||
|
// small, crash
|
||||||
|
|
||||||
|
Mat first = new Mat();
|
||||||
|
Mat second = new Mat();
|
||||||
|
this.converter.convert(images[0], first);
|
||||||
|
this.converter.convert(images[1], second);
|
||||||
|
|
||||||
|
try (GpuMat gpuImg = new GpuMat();
|
||||||
|
GpuMat gpuImg2 = new GpuMat();
|
||||||
|
GpuMat mask = new GpuMat();
|
||||||
|
GpuMat imgDescriptors = new GpuMat();
|
||||||
|
GpuMat testDescriptors = new GpuMat();
|
||||||
|
ORB orb = ORB.create();
|
||||||
|
DescriptorMatcher matcher = DescriptorMatcher.createBFMatcher(NORM_HAMMING);
|
||||||
|
KeyPointVector keypoints = new KeyPointVector();
|
||||||
|
KeyPointVector testKeyPoints = new KeyPointVector();
|
||||||
|
DMatchVector matches = new DMatchVector()) {
|
||||||
|
|
||||||
|
gpuImg.upload(first);
|
||||||
|
gpuImg2.upload(second);
|
||||||
|
|
||||||
|
long time = TimingService.measureTime(() -> {
|
||||||
|
orb.detectAndCompute(gpuImg, mask, keypoints, imgDescriptors);
|
||||||
|
orb.detectAndCompute(gpuImg2, mask, testKeyPoints, testDescriptors);
|
||||||
|
matcher.match(testDescriptors, imgDescriptors, matches);
|
||||||
|
}, GpuTestSystem.TEST_RUNS);
|
||||||
|
|
||||||
|
// Just for debugging
|
||||||
|
|
||||||
|
// Mat outImg = new Mat();
|
||||||
|
// opencv_features2d.drawMatches(first, keypoints, second, testKeyPoints, matches, outImg);
|
||||||
|
// opencv_imgproc.resize(outImg, outImg, new Size((int) (outImg.cols() * 0.25), (int) (outImg.rows() * 0.25)));
|
||||||
|
// opencv_highgui.imshow("matches", outImg);
|
||||||
|
// opencv_highgui.waitKey();
|
||||||
|
|
||||||
|
LOG.info(() -> "gpu execution time for images of size " + images[0].size() + ": " + time + "ms");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import static org.bytedeco.opencv.global.opencv_core.CV_8UC1;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudafilters;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_core.Mat;
|
||||||
|
import org.bytedeco.opencv.opencv_cudafilters.Filter;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.KernelTask;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUFiltering {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUFiltering.class);
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUFiltering() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void runMedianFiltering(org.opencv.core.Mat img) {
|
||||||
|
try (GpuMat gpuImg = new GpuMat();
|
||||||
|
Mat mat = this.converter.convert2Javacv(img);
|
||||||
|
GpuMat dst = new GpuMat();
|
||||||
|
Filter filter = opencv_cudafilters.createMedianFilter(CV_8UC1, 15)) {
|
||||||
|
|
||||||
|
gpuImg.upload(mat);
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> filter.apply(gpuImg, dst), KernelTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "median filter on size: " + img.size() + " took " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", KernelTask.TEST_RUNS, img.size(), TaskType.GPU_MEDIAN_BLUR, time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void runGaussianBlur(org.opencv.core.Mat img) {
|
||||||
|
try (GpuMat gpuImg = new GpuMat();
|
||||||
|
Mat mat = this.converter.convert2Javacv(img);
|
||||||
|
GpuMat dst = new GpuMat();
|
||||||
|
Filter filter = opencv_cudafilters.createGaussianFilter(CV_8UC1, CV_8UC1, new org.bytedeco.opencv.opencv_core.Size(15, 15), 0)) {
|
||||||
|
|
||||||
|
gpuImg.upload(mat);
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> filter.apply(gpuImg, dst), KernelTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "gaussian filter on size: " + img.size() + " took " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", KernelTask.TEST_RUNS, img.size(), TaskType.GPU_GAUSSIAN_BLUR, time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudaimgproc;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUHistogramming {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUHistogramming.class);
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUHistogramming() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void calcHistogram(org.opencv.core.Mat img) {
|
||||||
|
try (GpuMat gpuMat = new GpuMat(); GpuMat hist = new GpuMat()) {
|
||||||
|
Mat m = new Mat();
|
||||||
|
this.converter.convert(img, m);
|
||||||
|
gpuMat.upload(m);
|
||||||
|
|
||||||
|
long time = TimingService.measureTime(() -> opencv_cudaimgproc.calcHist(gpuMat, hist), GpuTestSystem.TEST_RUNS);
|
||||||
|
LOG.info(() -> "histogram for image of size " + img.size() + ": " + time + "ms");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class GPUHomography {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudaimgproc;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_cudaimgproc.HoughCirclesDetector;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.ImgProcTask;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUHoughCircles {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUHoughCircles.class);
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUHoughCircles() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void detectCircles(Mat img) {
|
||||||
|
GpuMat circles = new GpuMat();
|
||||||
|
GpuMat gpuImg = new GpuMat();
|
||||||
|
|
||||||
|
HoughCirclesDetector detector = opencv_cudaimgproc.createHoughCirclesDetector(1, img.rows() / 10, 64, 40, 32, 256);
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat tmp = this.converter.convert2Javacv(img);
|
||||||
|
gpuImg.upload(tmp);
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> detector.detect(gpuImg, circles), ImgProcTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "image of size " + img.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", ImgProcTask.TEST_RUNS, img.size(), TaskType.GPU_HOUGH_CIRCLE, time));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudafilters;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_cudafilters.Filter;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUMedianFilterImpl {
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUMedianFilterImpl() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void applyMedianFilter(org.opencv.core.Mat mat) {
|
||||||
|
GpuMat gpuMat = new GpuMat();
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat javacvMat = this.converter.toJavaCVMat(mat);
|
||||||
|
gpuMat.upload(javacvMat);
|
||||||
|
Filter filter = opencv_cudafilters.createMedianFilter(gpuMat.type(), 15);
|
||||||
|
filter.apply(gpuMat, gpuMat);
|
||||||
|
gpuMat.download(javacvMat);
|
||||||
|
org.opencv.core.Mat result = this.converter.toOrgOpenCvMat(javacvMat);
|
||||||
|
result.copyTo(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_core;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudafilters;
|
||||||
|
import org.bytedeco.opencv.global.opencv_imgproc;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_core.Mat;
|
||||||
|
import org.bytedeco.opencv.opencv_core.Size;
|
||||||
|
import org.bytedeco.opencv.opencv_cudafilters.Filter;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.KernelTask;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class GPUMorph {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUMorph.class);
|
||||||
|
|
||||||
|
public void morph(org.opencv.core.Mat img) {
|
||||||
|
|
||||||
|
Mat kernel = opencv_imgproc.getStructuringElement(opencv_imgproc.CV_SHAPE_RECT, new Size(15, 15));
|
||||||
|
|
||||||
|
Filter filter = opencv_cudafilters.createMorphologyFilter(opencv_imgproc.MORPH_DILATE, opencv_core.CV_8U, kernel);
|
||||||
|
Filter filter2 = opencv_cudafilters.createMorphologyFilter(opencv_imgproc.MORPH_ERODE, opencv_core.CV_8U, kernel);
|
||||||
|
|
||||||
|
GpuMat dst = new GpuMat();
|
||||||
|
GpuMat src = new GpuMat();
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
Mat mat = converter.convert2Javacv(img);
|
||||||
|
src.upload(mat);
|
||||||
|
|
||||||
|
// Mat dst = new Mat();
|
||||||
|
// Mat kernel = Imgproc.getStructuringElement(Imgproc.CV_SHAPE_RECT, new Size(15, 15));
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> filter.apply(src, dst), KernelTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "dilate on size: " + img.size() + " took " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", KernelTask.TEST_RUNS, img.size(), TaskType.GPU_DILATE, time));
|
||||||
|
|
||||||
|
TimeDto time2 = TimingService.testPerformance(() -> filter2.apply(src, dst), KernelTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "erode on size: " + img.size() + " took " + time2 + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", KernelTask.TEST_RUNS, img.size(), TaskType.GPU_ERODE, time2));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudawarping;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUResizing {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUResizing.class);
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUResizing() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void resize(Mat img, Size size) {
|
||||||
|
LOG.debug(() -> "resizing image from size " + img.size() + " to size " + size);
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat javacvMat = this.converter.convert2Javacv(img);
|
||||||
|
try (GpuMat gpuImg = new GpuMat();
|
||||||
|
GpuMat dst = new GpuMat();
|
||||||
|
org.bytedeco.opencv.opencv_core.Size javacvSize = new org.bytedeco.opencv.opencv_core.Size((int) size.width, (int) size.height)) {
|
||||||
|
|
||||||
|
LOG.trace("uploading mat");
|
||||||
|
gpuImg.upload(javacvMat);
|
||||||
|
LOG.trace("uploading done");
|
||||||
|
|
||||||
|
LOG.trace("resizing now");
|
||||||
|
long time = TimingService.measureTime(() -> opencv_cudawarping.resize(gpuImg, dst, javacvSize), GpuTestSystem.TEST_RUNS);
|
||||||
|
LOG.trace("resizing done");
|
||||||
|
|
||||||
|
// org.bytedeco.opencv.opencv_core.Mat res = new org.bytedeco.opencv.opencv_core.Mat();
|
||||||
|
// dst.download(res);
|
||||||
|
// Mat result = this.converter.convert2Opencv(res);
|
||||||
|
// HighGui.imshow(result.size().toString(), result);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
//
|
||||||
|
// long time = TimingService.measureTime(() -> Imgproc.resize(img, dst, size), 1000);
|
||||||
|
|
||||||
|
LOG.info(() -> "resizing image from size " + img.size() + " to size " + size + " took " + time + "ms.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudastereo;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_cudastereo.StereoBM;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUStereoMatching {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUStereoMatching.class);
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUStereoMatching() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void matchImages(Mat leftImage, Mat rightImage) {
|
||||||
|
try (StereoBM matcher = opencv_cudastereo.createStereoBM(256, 15);
|
||||||
|
GpuMat left = new GpuMat();
|
||||||
|
GpuMat right = new GpuMat();
|
||||||
|
GpuMat disparity = new GpuMat()) {
|
||||||
|
|
||||||
|
left.upload(this.converter.convert2Javacv(leftImage));
|
||||||
|
|
||||||
|
right.upload(this.converter.convert2Javacv(rightImage));
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> matcher.compute(left, right, disparity), FeatureBasedTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "gpu stereo matching took of image size " + leftImage.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", FeatureBasedTask.TEST_RUNS, leftImage.size(), TaskType.GPU_STEREO_MATCHING, time));
|
||||||
|
|
||||||
|
// Just for debugging
|
||||||
|
// org.bytedeco.opencv.opencv_core.Mat res = new org.bytedeco.opencv.opencv_core.Mat();
|
||||||
|
// disparity.download(res);
|
||||||
|
// Mat result = this.converter.convert2Opencv(res);
|
||||||
|
// Imgproc.resize(result, result, new Size(), 0.5, 0.5);
|
||||||
|
// result.convertTo(result, CvType.CV_8U, 1);
|
||||||
|
// HighGui.imshow("gpu", result);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudaarithm;
|
||||||
|
import org.bytedeco.opencv.global.opencv_imgproc;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.PixelWiseTask;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUThresholding {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUThresholding.class);
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUThresholding() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void threshold(Mat mat) {
|
||||||
|
try (GpuMat src = new GpuMat(); org.bytedeco.opencv.opencv_core.Mat javacvMat = new org.bytedeco.opencv.opencv_core.Mat(); GpuMat dst = new GpuMat();) {
|
||||||
|
|
||||||
|
this.converter.convert(mat, javacvMat);
|
||||||
|
src.upload(javacvMat);
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> opencv_cudaarithm.threshold(src, dst, 128, 255, opencv_imgproc.THRESH_BINARY),
|
||||||
|
PixelWiseTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "thresholding image from size " + mat.size() + " took " + time + "ms.");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", PixelWiseTask.TEST_RUNS, mat.size(), TaskType.GPU_THRESHOLD, time));
|
||||||
|
// dst.download(javacvMat);
|
||||||
|
// opencv_highgui.imshow("GPU result", javacvMat);
|
||||||
|
// opencv_highgui.waitKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,176 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudawarping;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.opencv.calib3d.Calib3d;
|
||||||
|
import org.opencv.core.Core;
|
||||||
|
import org.opencv.core.DMatch;
|
||||||
|
import org.opencv.core.KeyPoint;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.MatOfDMatch;
|
||||||
|
import org.opencv.core.MatOfKeyPoint;
|
||||||
|
import org.opencv.core.MatOfPoint2f;
|
||||||
|
import org.opencv.core.Point;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
import org.opencv.features2d.DescriptorMatcher;
|
||||||
|
import org.opencv.features2d.ORB;
|
||||||
|
import org.opencv.imgcodecs.Imgcodecs;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GPUWarping {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GPUWarping.class);
|
||||||
|
|
||||||
|
private static final String IMG_PATH = "src/main/resources/car.jpg";
|
||||||
|
|
||||||
|
private static final String IMG_PATH_MIRRORED = "src/main/resources/car_mirrored.jpg";
|
||||||
|
|
||||||
|
private Mat[] testImages;
|
||||||
|
|
||||||
|
private Mat[] mirroredTestImages;
|
||||||
|
|
||||||
|
private ORB orb;
|
||||||
|
|
||||||
|
private DescriptorMatcher matcher;
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GPUWarping() {
|
||||||
|
this.testImages = new Mat[] { Imgcodecs.imread(IMG_PATH), Imgcodecs.imread(IMG_PATH), Imgcodecs.imread(IMG_PATH), Imgcodecs.imread(IMG_PATH) };
|
||||||
|
Imgproc.resize(this.testImages[1], this.testImages[1], new Size(), 2.5, 2.5);
|
||||||
|
Imgproc.resize(this.testImages[2], this.testImages[2], new Size(), 5, 5);
|
||||||
|
Imgproc.resize(this.testImages[3], this.testImages[3], new Size(), 10, 10);
|
||||||
|
|
||||||
|
this.mirroredTestImages = new Mat[] { Imgcodecs.imread(IMG_PATH_MIRRORED), Imgcodecs.imread(IMG_PATH_MIRRORED), Imgcodecs.imread(IMG_PATH_MIRRORED),
|
||||||
|
Imgcodecs.imread(IMG_PATH_MIRRORED) };
|
||||||
|
Imgproc.resize(this.mirroredTestImages[1], this.mirroredTestImages[1], new Size(), 2.5, 2.5);
|
||||||
|
Imgproc.resize(this.mirroredTestImages[2], this.mirroredTestImages[2], new Size(), 5, 5);
|
||||||
|
Imgproc.resize(this.mirroredTestImages[3], this.mirroredTestImages[3], new Size(), 10, 10);
|
||||||
|
|
||||||
|
this.orb = ORB.create();
|
||||||
|
this.matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
|
||||||
|
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void warpImages() {
|
||||||
|
Mat homography1 = getHomography(this.testImages[0], this.mirroredTestImages[0]);
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat M1 = this.converter.convert2Javacv(homography1);
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat img1 = this.converter.convert2Javacv(this.mirroredTestImages[0]);
|
||||||
|
GpuMat src1 = new GpuMat();
|
||||||
|
src1.upload(img1);
|
||||||
|
GpuMat dst1 = new GpuMat();
|
||||||
|
|
||||||
|
long time1 = TimingService.measureTime(() -> opencv_cudawarping.warpPerspective(src1, dst1, M1, img1.size()), 100);
|
||||||
|
|
||||||
|
Imgproc.medianBlur(this.testImages[1], this.testImages[1], 9);
|
||||||
|
Imgproc.medianBlur(this.mirroredTestImages[1], this.mirroredTestImages[1], 9);
|
||||||
|
Mat homography2 = getHomography(this.testImages[1], this.mirroredTestImages[1]);
|
||||||
|
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat M2 = this.converter.convert2Javacv(homography2);
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat img2 = this.converter.convert2Javacv(this.mirroredTestImages[1]);
|
||||||
|
GpuMat src2 = new GpuMat();
|
||||||
|
src2.upload(img2);
|
||||||
|
GpuMat dst2 = new GpuMat();
|
||||||
|
long time2 = TimingService.measureTime(() -> opencv_cudawarping.warpPerspective(src2, dst2, M2, img2.size()), 100);
|
||||||
|
|
||||||
|
Imgproc.medianBlur(this.testImages[2], this.testImages[2], 15);
|
||||||
|
Imgproc.medianBlur(this.mirroredTestImages[2], this.mirroredTestImages[2], 15);
|
||||||
|
Mat homography3 = getHomography(this.testImages[2], this.mirroredTestImages[2]);
|
||||||
|
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat M3 = this.converter.convert2Javacv(homography3);
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat img3 = this.converter.convert2Javacv(this.mirroredTestImages[2]);
|
||||||
|
GpuMat src3 = new GpuMat();
|
||||||
|
|
||||||
|
src3.upload(img3);
|
||||||
|
GpuMat dst3 = new GpuMat();
|
||||||
|
long time3 = TimingService.measureTime(() -> opencv_cudawarping.warpPerspective(src3, dst3, M3, img3.size()), 100);
|
||||||
|
|
||||||
|
Imgproc.medianBlur(this.testImages[3], this.testImages[3], 15);
|
||||||
|
Imgproc.medianBlur(this.mirroredTestImages[3], this.mirroredTestImages[3], 15);
|
||||||
|
Mat homography4 = getHomography(this.testImages[3], this.mirroredTestImages[3]);
|
||||||
|
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat M4 = this.converter.convert2Javacv(homography4);
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat img4 = this.converter.convert2Javacv(this.mirroredTestImages[3]);
|
||||||
|
GpuMat src4 = new GpuMat();
|
||||||
|
src4.upload(img4);
|
||||||
|
GpuMat dst4 = new GpuMat();
|
||||||
|
long time4 = TimingService.measureTime(() -> opencv_cudawarping.warpPerspective(src4, dst4, M4, img4.size()), 100);
|
||||||
|
|
||||||
|
LOG.info(() -> "original image: " + time1 + "ms");
|
||||||
|
LOG.info(() -> "2.5x image: " + time2 + "ms");
|
||||||
|
LOG.info(() -> "5x image: " + time3 + "ms");
|
||||||
|
LOG.info(() -> "10x image: " + time4 + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mat getHomography(Mat ref, Mat image) {
|
||||||
|
Mat refGray = new Mat();
|
||||||
|
Mat imGray = new Mat();
|
||||||
|
Imgproc.cvtColor(ref, refGray, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.cvtColor(image, imGray, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
|
||||||
|
MatOfKeyPoint imgKeypoints = new MatOfKeyPoint();
|
||||||
|
Mat imgDescriptors = new Mat();
|
||||||
|
|
||||||
|
MatOfKeyPoint refKeypoints = new MatOfKeyPoint();
|
||||||
|
Mat refDescriptors = new Mat();
|
||||||
|
|
||||||
|
this.orb.detectAndCompute(imGray, new Mat(), imgKeypoints, imgDescriptors);
|
||||||
|
this.orb.detectAndCompute(refGray, new Mat(), refKeypoints, refDescriptors);
|
||||||
|
|
||||||
|
MatOfDMatch matches = new MatOfDMatch();
|
||||||
|
this.matcher.match(imgDescriptors, refDescriptors, matches, new Mat());
|
||||||
|
|
||||||
|
// Sort matches by score
|
||||||
|
List<DMatch> matchList = matches.toList();
|
||||||
|
matchList.sort((match1, match2) -> Float.compare(match1.distance, match2.distance));
|
||||||
|
|
||||||
|
// Remove not so good matches
|
||||||
|
final int numGoodMatches = (int) (matchList.size() * 0.1);
|
||||||
|
matchList = new ArrayList<>(matchList.subList(0, numGoodMatches));
|
||||||
|
|
||||||
|
matches.fromList(matchList);
|
||||||
|
|
||||||
|
// Mat outImg = new Mat();
|
||||||
|
// Features2d.drawMatches(ref, refKeypoints, image, imgKeypoints, matches, outImg);
|
||||||
|
// HighGui.imshow("Matches", outImg);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
|
||||||
|
// Extract location of good matches
|
||||||
|
List<Point> points1 = new ArrayList<>();
|
||||||
|
List<Point> points2 = new ArrayList<>();
|
||||||
|
List<KeyPoint> imgkpList = imgKeypoints.toList();
|
||||||
|
List<KeyPoint> refkpList = refKeypoints.toList();
|
||||||
|
for (int i = 0; i < matchList.size(); i++) {
|
||||||
|
points1.add(imgkpList.get(matchList.get(i).queryIdx).pt);
|
||||||
|
points2.add(refkpList.get(matchList.get(i).trainIdx).pt);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find homography
|
||||||
|
MatOfPoint2f p1 = new MatOfPoint2f();
|
||||||
|
MatOfPoint2f p2 = new MatOfPoint2f();
|
||||||
|
p1.fromArray(points1.toArray(new Point[0]));
|
||||||
|
p2.fromArray(points2.toArray(new Point[0]));
|
||||||
|
Mat h = Calib3d.findHomography(p1, p2, Calib3d.RANSAC);
|
||||||
|
if (h.empty()) {
|
||||||
|
LOG.error("this should not happen");
|
||||||
|
throw new RuntimeException("This should not happen");
|
||||||
|
}
|
||||||
|
|
||||||
|
double det = Core.determinant(h);
|
||||||
|
LOG.debug(() -> "Det(H)=" + det);
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.gputasks;
|
||||||
|
|
||||||
|
import static org.bytedeco.opencv.global.opencv_core.NORM_HAMMING;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.opencv_core.DMatchVector;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_core.KeyPointVector;
|
||||||
|
import org.bytedeco.opencv.opencv_core.Mat;
|
||||||
|
import org.bytedeco.opencv.opencv_cudafeatures2d.DescriptorMatcher;
|
||||||
|
import org.bytedeco.opencv.opencv_cudafeatures2d.ORB;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.taskdefinitions.FeatureBasedTask;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GpuFeatureTask {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GpuFeatureTask.class);
|
||||||
|
|
||||||
|
private MatConverter converter;
|
||||||
|
|
||||||
|
public GpuFeatureTask() {
|
||||||
|
this.converter = new MatConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void detectAndCompute1(org.opencv.core.Mat image) {
|
||||||
|
Mat first = new Mat();
|
||||||
|
this.converter.convert(image, first);
|
||||||
|
|
||||||
|
try (GpuMat gpuImg = new GpuMat();
|
||||||
|
GpuMat mask = new GpuMat();
|
||||||
|
GpuMat imgDescriptors = new GpuMat();
|
||||||
|
ORB orb = ORB.create();
|
||||||
|
KeyPointVector keypoints = new KeyPointVector()) {
|
||||||
|
orb.setBlurForDescriptor(true);
|
||||||
|
gpuImg.upload(first);
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
orb.detectAndCompute(gpuImg, mask, keypoints, imgDescriptors);
|
||||||
|
}, FeatureBasedTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "gpu detection time for images of size " + image.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", FeatureBasedTask.TEST_RUNS, image.size(), TaskType.GPU_FEATURE_DETECTION1, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void detectAndCompute2(org.opencv.core.Mat image) {
|
||||||
|
Mat first = new Mat();
|
||||||
|
this.converter.convert(image, first);
|
||||||
|
|
||||||
|
try (GpuMat gpuImg = new GpuMat();
|
||||||
|
GpuMat mask = new GpuMat();
|
||||||
|
GpuMat imgDescriptors = new GpuMat();
|
||||||
|
ORB orb = ORB.create();
|
||||||
|
KeyPointVector keypoints = new KeyPointVector()) {
|
||||||
|
|
||||||
|
orb.setBlurForDescriptor(true);
|
||||||
|
gpuImg.upload(first);
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
orb.detectAndCompute(gpuImg, mask, keypoints, imgDescriptors);
|
||||||
|
}, FeatureBasedTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "gpu detection time for images of size " + image.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", FeatureBasedTask.TEST_RUNS, image.size(), TaskType.GPU_FEATURE_DETECTION2, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void match(org.opencv.core.Mat image, int nfeatures) {
|
||||||
|
|
||||||
|
Mat first = new Mat();
|
||||||
|
this.converter.convert(image, first);
|
||||||
|
|
||||||
|
try (GpuMat gpuImg = new GpuMat();
|
||||||
|
GpuMat mask = new GpuMat();
|
||||||
|
GpuMat imgDescriptors = new GpuMat();
|
||||||
|
GpuMat testDescriptors = new GpuMat();
|
||||||
|
|
||||||
|
/* =cv::ORB::HARRIS_SCORE */
|
||||||
|
|
||||||
|
ORB orb = ORB.create(nfeatures, 1.2f, 8, 31, org.bytedeco.opencv.opencv_features2d.ORB.HARRIS_SCORE, 2, 0, 31, 20, false);
|
||||||
|
DescriptorMatcher matcher = DescriptorMatcher.createBFMatcher(NORM_HAMMING);
|
||||||
|
KeyPointVector keypoints = new KeyPointVector();
|
||||||
|
KeyPointVector testKeyPoints = new KeyPointVector();
|
||||||
|
DMatchVector matches = new DMatchVector()) {
|
||||||
|
|
||||||
|
gpuImg.upload(first);
|
||||||
|
orb.detectAndCompute(gpuImg, mask, keypoints, imgDescriptors);
|
||||||
|
orb.detectAndCompute(gpuImg, mask, testKeyPoints, testDescriptors);
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
matcher.match(testDescriptors, imgDescriptors, matches);
|
||||||
|
}, FeatureBasedTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "gpu feature matching time for " + keypoints.size() + " features in image of size " + image.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", FeatureBasedTask.TEST_RUNS, image.size(), TaskType.GPU_FEATURE_MATCHING, time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUColoring;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUColoring;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class ColoringTask implements Task {
|
||||||
|
|
||||||
|
private CPUColoring cpuTask;
|
||||||
|
|
||||||
|
private GPUColoring gpuTask;
|
||||||
|
|
||||||
|
public ColoringTask() {
|
||||||
|
this.cpuTask = new CPUColoring();
|
||||||
|
this.gpuTask = new GPUColoring();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat[] images = ImageLoader.getTestImagesForPixelWiseOperations();
|
||||||
|
Arrays.stream(images).forEach(this.cpuTask::grayScale);
|
||||||
|
Arrays.stream(images).forEach(this.gpuTask::grayScale);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgcodecs.Imgcodecs;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUContourRecognition;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUContourRecognition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class ContourRecognitionTask implements Task {
|
||||||
|
|
||||||
|
private CPUContourRecognition cpuTask;
|
||||||
|
|
||||||
|
private GPUContourRecognition gpuTask;
|
||||||
|
|
||||||
|
public ContourRecognitionTask() {
|
||||||
|
this.cpuTask = new CPUContourRecognition();
|
||||||
|
this.gpuTask = new GPUContourRecognition();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat image = loadTestImage();
|
||||||
|
Mat gray = new Mat();
|
||||||
|
// change the image so it can be used for finding contours
|
||||||
|
Imgproc.cvtColor(image, gray, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.threshold(gray, gray, 64, 255, Imgproc.THRESH_BINARY_INV);
|
||||||
|
|
||||||
|
Mat contImg = new Mat();
|
||||||
|
gray.copyTo(contImg);
|
||||||
|
this.cpuTask.findContours(contImg);
|
||||||
|
// gray.copyTo(contImg);
|
||||||
|
// this.gpuTask.findContours(contImg);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mat loadTestImage() {
|
||||||
|
return Imgcodecs.imread("src/main/resources/contourImage.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ConvertingTask implements Task {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(ConvertingTask.class);
|
||||||
|
|
||||||
|
private static final int CONVERT_RUNS = GpuTestSystem.TEST_RUNS;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat[] imgs = ImageLoader.getTestImages();
|
||||||
|
|
||||||
|
// Arrays.stream(imgs).forEach(this::testConverter);
|
||||||
|
// Arrays.stream(imgs).forEach(this::testCopyConvert);
|
||||||
|
// Arrays.stream(imgs).forEach(this::testAddressConvert);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testConverter(Mat img) {
|
||||||
|
long time1 = TimingService.measureTime(() -> {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
converter.toJavaCVMat(img);
|
||||||
|
}, CONVERT_RUNS);
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat javacvMat = new MatConverter().convert2Javacv(img);
|
||||||
|
long time2 = TimingService.measureTime(() -> {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
converter.toOrgOpenCvMat(javacvMat);
|
||||||
|
}, CONVERT_RUNS);
|
||||||
|
long time3 = TimingService.measureTime(() -> {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat javacvImg = converter.toJavaCVMat(img);
|
||||||
|
converter.toOrgOpenCvMat(javacvImg);
|
||||||
|
}, CONVERT_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "converter - Converting image of size " + img.size() + ":");
|
||||||
|
LOG.info(() -> "converter - from opencv to javacv: " + time1 + "ms");
|
||||||
|
LOG.info(() -> "converter - from javacv to opencv: " + time2 + "ms");
|
||||||
|
LOG.info(() -> "converter - both converts: " + time3 + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testCopyConvert(Mat img) {
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat result = new org.bytedeco.opencv.opencv_core.Mat();
|
||||||
|
long time1 = TimingService.measureTime(() -> {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
converter.convert(img, result);
|
||||||
|
}, CONVERT_RUNS);
|
||||||
|
Mat mat = new Mat();
|
||||||
|
long time2 = TimingService.measureTime(() -> {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
converter.convert(result, mat);
|
||||||
|
}, CONVERT_RUNS);
|
||||||
|
long time3 = TimingService.measureTime(() -> {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
converter.convert(img, result);
|
||||||
|
converter.convert(result, img);
|
||||||
|
}, CONVERT_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "copying - Converting image of size " + img.size() + ":");
|
||||||
|
LOG.info(() -> "copying - from opencv to javacv: " + time1 + "ms");
|
||||||
|
LOG.info(() -> "copying - from javacv to opencv: " + time2 + "ms");
|
||||||
|
LOG.info(() -> "copying - both converts: " + time3 + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testAddressConvert(Mat img) {
|
||||||
|
long time1 = TimingService.measureTime(() -> {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
converter.convert2Javacv(img);
|
||||||
|
}, CONVERT_RUNS);
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat javacvMat = new MatConverter().convert2Javacv(img);
|
||||||
|
long time2 = TimingService.measureTime(() -> {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
converter.convert2Opencv(javacvMat);
|
||||||
|
}, CONVERT_RUNS);
|
||||||
|
long time3 = TimingService.measureTime(() -> {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat javacvImg = converter.convert2Javacv(img);
|
||||||
|
converter.convert2Opencv(javacvImg);
|
||||||
|
}, CONVERT_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "address - Converting image of size " + img.size() + ":");
|
||||||
|
LOG.info(() -> "address - from opencv to javacv: " + time1 + "ms");
|
||||||
|
LOG.info(() -> "address - from javacv to opencv: " + time2 + "ms");
|
||||||
|
LOG.info(() -> "address - both converts: " + time3 + "ms");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.calib3d.StereoBM;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.PipelineTask;
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CpuPipeline {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(CpuPipeline.class);
|
||||||
|
|
||||||
|
public void doCannyPipeline(Mat img) {
|
||||||
|
Mat edges = new Mat();
|
||||||
|
Mat gray = new Mat();
|
||||||
|
Size ksize = new Size(15, 15);
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
Imgproc.cvtColor(img, gray, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.GaussianBlur(gray, edges, ksize, 0, 0);
|
||||||
|
Imgproc.Canny(edges, edges, 35, 100);
|
||||||
|
}, PipelineTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> " canny pipeline cpu execution time for image of size " + img.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", PipelineTask.TEST_RUNS, img.size(), TaskType.CPU_CANNY_PIPELINE, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doStereoPipeline(Mat[] images) {
|
||||||
|
Mat left = images[0];
|
||||||
|
Mat right = images[1];
|
||||||
|
StereoBM matcher = StereoBM.create(256, 15);
|
||||||
|
Mat disparity = new Mat();
|
||||||
|
Mat leftGray = new Mat();
|
||||||
|
Mat rightGray = new Mat();
|
||||||
|
Size kernelsize = new Size(15, 15);
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
Imgproc.cvtColor(left, leftGray, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.cvtColor(right, rightGray, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.GaussianBlur(leftGray, leftGray, kernelsize, 0, 0);
|
||||||
|
Imgproc.GaussianBlur(rightGray, rightGray, kernelsize, 0, 0);
|
||||||
|
matcher.compute(leftGray, rightGray, disparity);
|
||||||
|
}, PipelineTask.TEST_RUNS);
|
||||||
|
|
||||||
|
// Imgproc.resize(disparity, disparity, new Size(750, 500), 0, 0);
|
||||||
|
// disparity.convertTo(disparity, CvType.CV_8U, 0.075);
|
||||||
|
// HighGui.imshow("cpu", disparity);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
|
||||||
|
LOG.info(() -> " stereo pipeline cpu execution time for image of size " + images[0].size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", PipelineTask.TEST_RUNS, images[0].size(), TaskType.CPU_STEREO_PIPELINE, time));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUEdgeDetection;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUEdgeDetection;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class EdgeDetectionTask implements Task {
|
||||||
|
|
||||||
|
private CPUEdgeDetection cpuTask;
|
||||||
|
|
||||||
|
private GPUEdgeDetection gpuTask;
|
||||||
|
|
||||||
|
public EdgeDetectionTask() {
|
||||||
|
this.cpuTask = new CPUEdgeDetection();
|
||||||
|
this.gpuTask = new GPUEdgeDetection();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat[] images = ImageLoader.getImgprocImages();
|
||||||
|
Arrays.stream(images).forEach(img -> Imgproc.cvtColor(img, img, Imgproc.COLOR_BGR2GRAY));
|
||||||
|
|
||||||
|
Arrays.stream(images).forEach(this.cpuTask::findEdges);
|
||||||
|
Arrays.stream(images).forEach(this.gpuTask::findEdges);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CpuFeatureTask;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GpuFeatureTask;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class FeatureBasedTask implements Task {
|
||||||
|
|
||||||
|
public static final int TEST_RUNS = GpuTestSystem.TEST_RUNS;
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(FeatureBasedTask.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat[][] stereoimages = ImageLoader.getStereoImages();
|
||||||
|
Mat[] featureimages = ImageLoader.getFeatureImages();
|
||||||
|
|
||||||
|
Stream.concat(Arrays.stream(stereoimages).flatMap(Stream::of), Arrays.stream(featureimages))
|
||||||
|
.forEach(mat -> Imgproc.cvtColor(mat, mat, Imgproc.COLOR_BGR2GRAY));
|
||||||
|
|
||||||
|
CpuFeatureTask cpuTask = new CpuFeatureTask();
|
||||||
|
GpuFeatureTask gpuTask = new GpuFeatureTask();
|
||||||
|
CPUStereoMatching cpuStereo = new CPUStereoMatching();
|
||||||
|
GPUStereoMatching gpuStereo = new GPUStereoMatching();
|
||||||
|
|
||||||
|
for (int i = 0; i < featureimages.length; i += 2) {
|
||||||
|
final int index = i;
|
||||||
|
LOG.info(() -> "Image sizes: " + featureimages[index].size() + ", " + featureimages[index + 1].size());
|
||||||
|
Mat resizedImage = new Mat();
|
||||||
|
Imgproc.resize(featureimages[i], resizedImage, featureimages[i + 1].size());
|
||||||
|
cpuTask.detectAndCompute1(resizedImage);
|
||||||
|
cpuTask.detectAndCompute2(featureimages[i + 1]);
|
||||||
|
gpuTask.detectAndCompute1(resizedImage);
|
||||||
|
gpuTask.detectAndCompute2(featureimages[i + 1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
Arrays.stream(stereoimages).forEach(arr -> cpuStereo.matchImages(arr[0], arr[1]));
|
||||||
|
Arrays.stream(stereoimages).forEach(arr -> gpuStereo.matchImages(arr[0], arr[1]));
|
||||||
|
|
||||||
|
Mat matchingImage = stereoimages[4][0];
|
||||||
|
IntStream.iterate(500, i -> true, i -> i + 500).limit(20).forEach(i -> cpuTask.match(matchingImage, i));
|
||||||
|
IntStream.iterate(500, i -> true, i -> i + 500).limit(20).forEach(i -> gpuTask.match(matchingImage, i));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUFeatureMatching;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUFeatureMatching;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class FeatureMatchingTask implements Task {
|
||||||
|
|
||||||
|
private CPUFeatureMatching cpuTask;
|
||||||
|
private GPUFeatureMatching gpuTask;
|
||||||
|
|
||||||
|
public FeatureMatchingTask() {
|
||||||
|
this.cpuTask = new CPUFeatureMatching();
|
||||||
|
this.gpuTask = new GPUFeatureMatching();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat[][] stereoImages = ImageLoader.getStereoImages();
|
||||||
|
for (int i = 0; i < stereoImages.length; i++) {
|
||||||
|
Imgproc.cvtColor(stereoImages[i][0], stereoImages[i][0], Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.cvtColor(stereoImages[i][1], stereoImages[i][1], Imgproc.COLOR_BGR2GRAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
Arrays.stream(stereoImages).forEach(this.cpuTask::matchFeatures);
|
||||||
|
Arrays.stream(stereoImages).forEach(this.gpuTask::matchFeatures);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUFiltering;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUFiltering;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class FilteringTask implements Task {
|
||||||
|
|
||||||
|
private CPUFiltering cpuTask;
|
||||||
|
|
||||||
|
private GPUFiltering gpuTask;
|
||||||
|
|
||||||
|
public FilteringTask() {
|
||||||
|
this.cpuTask = new CPUFiltering();
|
||||||
|
this.gpuTask = new GPUFiltering();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat[] images = ImageLoader.getTestImagesForKernelOperations();
|
||||||
|
Arrays.stream(images).forEach(img -> Imgproc.cvtColor(img, img, Imgproc.COLOR_BGR2GRAY));
|
||||||
|
|
||||||
|
Arrays.stream(images).forEach(this.cpuTask::runMedianFiltering);
|
||||||
|
Arrays.stream(images).forEach(this.cpuTask::runGaussianBlur);
|
||||||
|
Arrays.stream(images).forEach(this.gpuTask::runMedianFiltering);
|
||||||
|
Arrays.stream(images).forEach(this.gpuTask::runGaussianBlur);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import static org.bytedeco.opencv.global.opencv_core.CV_8UC1;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudafilters;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudaimgproc;
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudastereo;
|
||||||
|
import org.bytedeco.opencv.global.opencv_imgproc;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_core.Mat;
|
||||||
|
import org.bytedeco.opencv.opencv_cudafilters.Filter;
|
||||||
|
import org.bytedeco.opencv.opencv_cudaimgproc.CannyEdgeDetector;
|
||||||
|
import org.bytedeco.opencv.opencv_cudastereo.StereoBM;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.PipelineTask;
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GpuPipeline {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(GpuPipeline.class);
|
||||||
|
|
||||||
|
public void doCannyPipeline(org.opencv.core.Mat img) {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
Mat javacvimg = converter.convert2Javacv(img);
|
||||||
|
|
||||||
|
GpuMat image = new GpuMat();
|
||||||
|
GpuMat gray = new GpuMat();
|
||||||
|
GpuMat edges = new GpuMat();
|
||||||
|
Filter filter = opencv_cudafilters.createGaussianFilter(CV_8UC1, CV_8UC1, new org.bytedeco.opencv.opencv_core.Size(15, 15), 0);
|
||||||
|
CannyEdgeDetector detector = opencv_cudaimgproc.createCannyEdgeDetector(35, 100);
|
||||||
|
Mat res = new Mat();
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
image.upload(javacvimg);
|
||||||
|
opencv_cudaimgproc.cvtColor(image, gray, opencv_imgproc.COLOR_BGR2GRAY);
|
||||||
|
filter.apply(gray, edges);
|
||||||
|
detector.detect(edges, edges);
|
||||||
|
edges.download(res);
|
||||||
|
}, PipelineTask.TEST_RUNS);
|
||||||
|
|
||||||
|
LOG.info(() -> "canny pipeline gpu execution time for image of size " + img.size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", PipelineTask.TEST_RUNS, img.size(), TaskType.GPU_CANNY_PIPELINE, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doStereoPipeline(org.opencv.core.Mat[] images) {
|
||||||
|
|
||||||
|
try (StereoBM matcher = opencv_cudastereo.createStereoBM(256, 15);
|
||||||
|
GpuMat left = new GpuMat();
|
||||||
|
GpuMat right = new GpuMat();
|
||||||
|
GpuMat disparity = new GpuMat();
|
||||||
|
GpuMat leftGray = new GpuMat();
|
||||||
|
GpuMat rightGray = new GpuMat();
|
||||||
|
Filter filter = opencv_cudafilters.createGaussianFilter(CV_8UC1, CV_8UC1, new org.bytedeco.opencv.opencv_core.Size(15, 15), 0);
|
||||||
|
Mat result = new Mat()) {
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
Mat javacvleft = converter.convert2Javacv(images[0]);
|
||||||
|
Mat javacvright = converter.convert2Javacv(images[1]);
|
||||||
|
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
left.upload(javacvleft);
|
||||||
|
right.upload(javacvright);
|
||||||
|
opencv_cudaimgproc.cvtColor(left, leftGray, opencv_imgproc.COLOR_BGR2GRAY);
|
||||||
|
opencv_cudaimgproc.cvtColor(right, rightGray, opencv_imgproc.COLOR_BGR2GRAY);
|
||||||
|
filter.apply(leftGray, leftGray);
|
||||||
|
filter.apply(rightGray, rightGray);
|
||||||
|
matcher.compute(leftGray, rightGray, disparity);
|
||||||
|
disparity.download(result);
|
||||||
|
}, PipelineTask.TEST_RUNS);
|
||||||
|
LOG.info(() -> " stereo pipeline gpu execution time for image of size " + images[0].size() + ": " + time + "ms");
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("", PipelineTask.TEST_RUNS, images[0].size(), TaskType.GPU_STEREO_PIPELINE, time));
|
||||||
|
|
||||||
|
// Debugging
|
||||||
|
// org.opencv.core.Mat res = new org.opencv.core.Mat();
|
||||||
|
// converter.convert(result, res);
|
||||||
|
// Imgproc.resize(res, res, new Size(750, 500), 0, 0);
|
||||||
|
// res.convertTo(res, CvType.CV_8U);
|
||||||
|
// HighGui.imshow("gpu", res);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUHistogramming;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUHistogramming;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class HistogramTask implements Task {
|
||||||
|
|
||||||
|
private CPUHistogramming cpuTask;
|
||||||
|
|
||||||
|
private GPUHistogramming gpuTask;
|
||||||
|
|
||||||
|
public HistogramTask() {
|
||||||
|
this.cpuTask = new CPUHistogramming();
|
||||||
|
this.gpuTask = new GPUHistogramming();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat[] images = ImageLoader.getTestImages();
|
||||||
|
Arrays.stream(images).forEach(img -> Imgproc.cvtColor(img, img, Imgproc.COLOR_BGR2GRAY));
|
||||||
|
|
||||||
|
Arrays.stream(images).forEach(this.cpuTask::calcHistogram);
|
||||||
|
Arrays.stream(images).forEach(this.gpuTask::calcHistogram);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUHomography;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUHomography;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class HomographyTask {
|
||||||
|
|
||||||
|
private CPUHomography cpuTask;
|
||||||
|
|
||||||
|
private GPUHomography gpuTask;
|
||||||
|
|
||||||
|
public HomographyTask() {
|
||||||
|
this.cpuTask = new CPUHomography();
|
||||||
|
|
||||||
|
// no gpu implementation for findHomography
|
||||||
|
this.gpuTask = new GPUHomography();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUHoughCircles;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUHoughCircles;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class HoughCircleTask implements Task {
|
||||||
|
|
||||||
|
private CPUHoughCircles cpuTask;
|
||||||
|
|
||||||
|
private GPUHoughCircles gpuTask;
|
||||||
|
|
||||||
|
public HoughCircleTask() {
|
||||||
|
this.cpuTask = new CPUHoughCircles();
|
||||||
|
this.gpuTask = new GPUHoughCircles();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat[] images = ImageLoader.getImgprocImages();
|
||||||
|
Arrays.stream(images).forEach(img -> Imgproc.cvtColor(img, img, Imgproc.COLOR_BGR2GRAY));
|
||||||
|
|
||||||
|
Arrays.stream(images).forEach(this.cpuTask::detectCircles);
|
||||||
|
Arrays.stream(images).forEach(this.gpuTask::detectCircles);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUWarping;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUWarping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class ImageWarpingTask implements Task {
|
||||||
|
|
||||||
|
private CPUWarping cpuTask;
|
||||||
|
|
||||||
|
private GPUWarping gpuTask;
|
||||||
|
|
||||||
|
public ImageWarpingTask() {
|
||||||
|
this.cpuTask = new CPUWarping();
|
||||||
|
this.gpuTask = new GPUWarping();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
this.cpuTask.warpImages();
|
||||||
|
this.gpuTask.warpImages();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class ImgProcTask implements Task {
|
||||||
|
|
||||||
|
public static final int TEST_RUNS = GpuTestSystem.TEST_RUNS;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
EdgeDetectionTask edgeTask = new EdgeDetectionTask();
|
||||||
|
HoughCircleTask circleTask = new HoughCircleTask();
|
||||||
|
edgeTask.runTask();
|
||||||
|
// circleTask.runTask();//TODO: takes forever to test :(
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class KernelTask implements Task {
|
||||||
|
|
||||||
|
public static final int TEST_RUNS = GpuTestSystem.TEST_RUNS;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
FilteringTask task = new FilteringTask();
|
||||||
|
task.runTask();
|
||||||
|
|
||||||
|
MorphTask morph = new MorphTask();
|
||||||
|
morph.runTask();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
import org.opencv.imgcodecs.Imgcodecs;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUMedianFilterImpl;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUMedianFilterImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A task testing median filter behavior
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class MedianFilterTask implements Task {
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(MedianFilterTask.class);
|
||||||
|
|
||||||
|
private CPUMedianFilterImpl cpuImpl;
|
||||||
|
private GPUMedianFilterImpl gpuImpl;
|
||||||
|
|
||||||
|
public MedianFilterTask() {
|
||||||
|
this.cpuImpl = new CPUMedianFilterImpl();
|
||||||
|
this.gpuImpl = new GPUMedianFilterImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat img = Imgcodecs.imread("src/main/resources/car.jpg");
|
||||||
|
Imgproc.resize(img, img, new Size(), 2.5, 2.5);
|
||||||
|
Imgproc.cvtColor(img, img, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
// HighGui.imshow("image for median filtering", img);
|
||||||
|
Mat cpuImg = new Mat();
|
||||||
|
Mat gpuImg = new Mat();
|
||||||
|
img.copyTo(cpuImg);
|
||||||
|
img.copyTo(gpuImg);
|
||||||
|
|
||||||
|
long time1 = System.currentTimeMillis();
|
||||||
|
this.cpuImpl.applyMedianFilter(cpuImg);
|
||||||
|
long time2 = System.currentTimeMillis();
|
||||||
|
this.gpuImpl.applyMedianFilter(gpuImg);
|
||||||
|
long time3 = System.currentTimeMillis();
|
||||||
|
|
||||||
|
LOG.info(() -> "CPU processing time: " + (time2 - time1) + "ms");
|
||||||
|
LOG.info(() -> "GPU processing time: " + (time3 - time2) + "ms");
|
||||||
|
|
||||||
|
// HighGui.imshow("CPU result", cpuImg);
|
||||||
|
// HighGui.imshow("GPU result", gpuImg);
|
||||||
|
// HighGui.waitKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUMorph;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUMorph;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class MorphTask implements Task {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat[] images = ImageLoader.getTestImagesForKernelOperations();
|
||||||
|
Arrays.stream(images).forEach(img -> Imgproc.cvtColor(img, img, Imgproc.COLOR_BGR2GRAY));
|
||||||
|
|
||||||
|
CPUMorph cpuTask = new CPUMorph();
|
||||||
|
GPUMorph gpuTask = new GPUMorph();
|
||||||
|
|
||||||
|
Arrays.stream(images).forEach(cpuTask::morph);
|
||||||
|
Arrays.stream(images).forEach(gpuTask::morph);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+85
@@ -0,0 +1,85 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.global.opencv_core;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class PageLockedUploadDownloadTask implements Task {
|
||||||
|
|
||||||
|
private static final String MS = "ms.";
|
||||||
|
|
||||||
|
private static final String MAT_OF_SIZE = " Mat of size ";
|
||||||
|
|
||||||
|
private static final String TOOK = " took ";
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(PageLockedUploadDownloadTask.class);
|
||||||
|
|
||||||
|
private static final int ITERATIONS = GpuTestSystem.TEST_RUNS;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
org.opencv.core.Mat[] images = ImageLoader.getUploadDownloadTestImages();
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
List<Mat> matList = Arrays.stream(images).map(converter::convert2Javacv).collect(Collectors.toList());
|
||||||
|
matList.forEach(opencv_core::registerPageLocked);
|
||||||
|
matList.forEach(this::testUpload);
|
||||||
|
matList.forEach(this::testDownload);
|
||||||
|
matList.forEach(this::testUploadAndDownload);
|
||||||
|
matList.forEach(opencv_core::unregisterPageLocked);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testUpload(Mat m) {
|
||||||
|
try (GpuMat gpuMat = new GpuMat()) {
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> gpuMat.upload(m), ITERATIONS);
|
||||||
|
LOG.info(() -> "uploading" + MAT_OF_SIZE + getSizeOfMat(m) + TOOK + time + MS);
|
||||||
|
GpuEventBus.INSTANCE
|
||||||
|
.post(new TaskResultEvent("uploading Mat of size " + getSizeOfMat(m), ITERATIONS, getSizeOfMat(m), TaskType.PAGE_LOCKED_GPU_UPLOAD, time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testDownload(Mat m) {
|
||||||
|
try (GpuMat gpuMat = new GpuMat(); Mat res = new Mat()) {
|
||||||
|
gpuMat.upload(m);
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> gpuMat.download(res), ITERATIONS);
|
||||||
|
LOG.info(() -> "downloading" + MAT_OF_SIZE + getSizeOfMat(m) + TOOK + time + MS);
|
||||||
|
GpuEventBus.INSTANCE.post(
|
||||||
|
new TaskResultEvent(time, "downloading Mat of size " + getSizeOfMat(m), ITERATIONS, getSizeOfMat(m), TaskType.PAGE_LOCKED_GPU_DOWNLOAD));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testUploadAndDownload(Mat m) {
|
||||||
|
try (GpuMat gpuMat = new GpuMat()) {
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
gpuMat.upload(m);
|
||||||
|
gpuMat.download(m);
|
||||||
|
}, ITERATIONS);
|
||||||
|
LOG.info(() -> "uploading and downloading" + MAT_OF_SIZE + getSizeOfMat(m) + TOOK + time + MS);
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent(time, "uploading and downloading Mat of size " + getSizeOfMat(m), ITERATIONS, getSizeOfMat(m),
|
||||||
|
TaskType.PAGE_LOCKED_GPU_COMBINED));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private org.opencv.core.Size getSizeOfMat(Mat m) {
|
||||||
|
return new org.opencv.core.Size(m.cols(), m.rows());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class PixelWiseTask implements Task {
|
||||||
|
|
||||||
|
public static final int TEST_RUNS = GpuTestSystem.TEST_RUNS;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
ThresholdingTask thr = new ThresholdingTask();
|
||||||
|
ColoringTask col = new ColoringTask();
|
||||||
|
thr.runTask();
|
||||||
|
col.runTask();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUResizing;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUResizing;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class ResizingTask implements Task {
|
||||||
|
|
||||||
|
private CPUResizing cpuTask;
|
||||||
|
|
||||||
|
private GPUResizing gpuTask;
|
||||||
|
|
||||||
|
public ResizingTask() {
|
||||||
|
this.cpuTask = new CPUResizing();
|
||||||
|
this.gpuTask = new GPUResizing();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
|
||||||
|
Mat[] images = ImageLoader.getTestImages();
|
||||||
|
Size[] sizes = Arrays.stream(images).map(Mat::size).toArray(Size[]::new);
|
||||||
|
|
||||||
|
for (int i = 0; i < images.length; i++) {
|
||||||
|
for (int j = 0; j < images.length; j++) {
|
||||||
|
if (i != j) {
|
||||||
|
this.cpuTask.resize(images[i], sizes[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < images.length; i++) {
|
||||||
|
for (int j = 0; j < images.length; j++) {
|
||||||
|
if (i != j) {
|
||||||
|
this.gpuTask.resize(images[i], sizes[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUStereoMatching;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUStereoMatching;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class StereoMatchingTask implements Task {
|
||||||
|
|
||||||
|
private CPUStereoMatching cpuTask;
|
||||||
|
|
||||||
|
private GPUStereoMatching gpuTask;
|
||||||
|
|
||||||
|
public StereoMatchingTask() {
|
||||||
|
this.cpuTask = new CPUStereoMatching();
|
||||||
|
this.gpuTask = new GPUStereoMatching();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
Mat[][] images = ImageLoader.getStereoImages();
|
||||||
|
for (int i = 0; i < images.length; i++) {
|
||||||
|
Imgproc.cvtColor(images[i][0], images[i][0], Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.cvtColor(images[i][1], images[i][1], Imgproc.COLOR_BGR2GRAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
Arrays.stream(images).forEach(imgs -> this.cpuTask.matchImages(imgs[0], imgs[1]));
|
||||||
|
Arrays.stream(images).forEach(imgs -> this.gpuTask.matchImages(imgs[0], imgs[1]));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.tasks.cputasks.CPUThresholding;
|
||||||
|
import de.unidue.nes.gpu.tasks.gputasks.GPUThresholding;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class ThresholdingTask implements Task {
|
||||||
|
|
||||||
|
private CPUThresholding cpuTask;
|
||||||
|
|
||||||
|
private GPUThresholding gpuTask;
|
||||||
|
|
||||||
|
public ThresholdingTask() {
|
||||||
|
this.cpuTask = new CPUThresholding();
|
||||||
|
this.gpuTask = new GPUThresholding();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
// load images to threshold
|
||||||
|
Mat[] images = ImageLoader.getTestImagesForPixelWiseOperations();
|
||||||
|
// convert to grayscale
|
||||||
|
Arrays.stream(images).forEach(img -> Imgproc.cvtColor(img, img, Imgproc.COLOR_BGR2GRAY));
|
||||||
|
|
||||||
|
Arrays.stream(images).forEach(this.cpuTask::threshold);
|
||||||
|
Arrays.stream(images).forEach(this.gpuTask::threshold);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package de.unidue.nes.gpu.tasks.taskdefinitions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.GpuTestSystem;
|
||||||
|
import de.unidue.nes.gpu.events.GpuEventBus;
|
||||||
|
import de.unidue.nes.gpu.events.TaskResultEvent;
|
||||||
|
import de.unidue.nes.gpu.events.TaskType;
|
||||||
|
import de.unidue.nes.gpu.tasks.Task;
|
||||||
|
import de.unidue.nes.gpu.utils.ImageLoader;
|
||||||
|
import de.unidue.nes.gpu.utils.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.utils.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.utils.TimingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class UploadDownloadTask implements Task {
|
||||||
|
|
||||||
|
private static final String MS = "ms.";
|
||||||
|
|
||||||
|
private static final String MAT_OF_SIZE = " Mat of size ";
|
||||||
|
|
||||||
|
private static final String TOOK = " took ";
|
||||||
|
|
||||||
|
private static final Logger LOG = LogManager.getLogger(UploadDownloadTask.class);
|
||||||
|
|
||||||
|
private static final int ITERATIONS = GpuTestSystem.TEST_RUNS;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runTask() {
|
||||||
|
org.opencv.core.Mat[] images = ImageLoader.getUploadDownloadTestImages();
|
||||||
|
MatConverter converter = new MatConverter();
|
||||||
|
List<Mat> matList = Arrays.stream(images).map(converter::convert2Javacv).collect(Collectors.toList());
|
||||||
|
|
||||||
|
matList.forEach(this::testUpload);
|
||||||
|
matList.forEach(this::testDownload);
|
||||||
|
matList.forEach(this::testUploadAndDownload);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testUpload(Mat m) {
|
||||||
|
try (GpuMat gpuMat = new GpuMat()) {
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> gpuMat.upload(m), ITERATIONS);
|
||||||
|
// long time = TimingService.measureTime(() -> gpuMat.upload(m), ITERATIONS);
|
||||||
|
LOG.info(() -> "uploading" + MAT_OF_SIZE + getSizeOfMat(m) + TOOK + time + MS);
|
||||||
|
GpuEventBus.INSTANCE.post(new TaskResultEvent("uploading Mat of size " + getSizeOfMat(m), ITERATIONS, getSizeOfMat(m), TaskType.GPU_UPLOAD, time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testDownload(Mat m) {
|
||||||
|
try (GpuMat gpuMat = new GpuMat(); Mat res = new Mat()) {
|
||||||
|
gpuMat.upload(m);
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> gpuMat.download(res), ITERATIONS);
|
||||||
|
LOG.info(() -> "downloading" + MAT_OF_SIZE + getSizeOfMat(m) + TOOK + time + MS);
|
||||||
|
GpuEventBus.INSTANCE
|
||||||
|
.post(new TaskResultEvent("downloading Mat of size " + getSizeOfMat(m), ITERATIONS, getSizeOfMat(m), TaskType.GPU_DOWNLOAD, time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testUploadAndDownload(Mat m) {
|
||||||
|
try (GpuMat gpuMat = new GpuMat()) {
|
||||||
|
TimeDto time = TimingService.testPerformance(() -> {
|
||||||
|
gpuMat.upload(m);
|
||||||
|
gpuMat.download(m);
|
||||||
|
}, ITERATIONS);
|
||||||
|
LOG.info(() -> "uploading and downloading" + MAT_OF_SIZE + getSizeOfMat(m) + TOOK + time + MS);
|
||||||
|
GpuEventBus.INSTANCE.post(
|
||||||
|
new TaskResultEvent("uploading and downloading Mat of size " + getSizeOfMat(m), ITERATIONS, getSizeOfMat(m), TaskType.GPU_COMBINED, time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private org.opencv.core.Size getSizeOfMat(Mat m) {
|
||||||
|
return new org.opencv.core.Size(m.cols(), m.rows());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
import org.opencv.core.CvType;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.MatOfDMatch;
|
||||||
|
import org.opencv.core.MatOfKeyPoint;
|
||||||
|
import org.opencv.core.Size;
|
||||||
|
import org.opencv.imgcodecs.Imgcodecs;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.input.MatArrayInput;
|
||||||
|
import de.unidue.nes.gpu.testframework.opencv.DescriptorMatcher;
|
||||||
|
import de.unidue.nes.gpu.testframework.opencv.Features2d;
|
||||||
|
import de.unidue.nes.gpu.testframework.opencv.Imgproc;
|
||||||
|
import de.unidue.nes.gpu.testframework.opencv.MatFunctions;
|
||||||
|
import de.unidue.nes.gpu.testframework.opencv.ORB;
|
||||||
|
import de.unidue.nes.gpu.testframework.opencv.StereoBM;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CustomTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.DummyTask;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class Main {
|
||||||
|
|
||||||
|
static {
|
||||||
|
System.loadLibrary("opencv_java411");
|
||||||
|
}
|
||||||
|
|
||||||
|
// main method only used to test
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(Instant.now());// Just to time
|
||||||
|
TestUtils<Mat[]> utils = new TestUtils<>();
|
||||||
|
utils.setCommandPipeline(arr -> {
|
||||||
|
|
||||||
|
Mat skyscraper = arr.get()[2];
|
||||||
|
Mat morph = new Mat();
|
||||||
|
MatFunctions.copyTo(skyscraper, morph);
|
||||||
|
Imgproc.cvtColor(morph, morph, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.threshold(morph, morph, 128, 255, Imgproc.THRESH_BINARY);
|
||||||
|
Mat dil = new Mat();
|
||||||
|
Mat ero = new Mat();
|
||||||
|
Mat open = new Mat();
|
||||||
|
Mat closed = new Mat();
|
||||||
|
|
||||||
|
Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(11, 11));
|
||||||
|
Imgproc.dilate(morph, dil, kernel);
|
||||||
|
Imgproc.erode(morph, ero, kernel);
|
||||||
|
Imgproc.morphologyEx(morph, open, Imgproc.MORPH_OPEN, kernel);
|
||||||
|
Imgproc.morphologyEx(morph, closed, Imgproc.MORPH_CLOSE, kernel);
|
||||||
|
|
||||||
|
CustomTask.addTask(new DummyTask(morph, dil, ero, open, closed));
|
||||||
|
|
||||||
|
Mat left = arr.get()[0];
|
||||||
|
Mat right = arr.get()[1];
|
||||||
|
|
||||||
|
Mat grayLeft = new Mat();
|
||||||
|
Mat grayRight = new Mat();
|
||||||
|
Imgproc.cvtColor(left, grayLeft, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.cvtColor(right, grayRight, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
|
||||||
|
StereoBM stereobm = StereoBM.create();
|
||||||
|
Mat disparity = new Mat();
|
||||||
|
stereobm.compute(grayLeft, grayRight, disparity);
|
||||||
|
Mat disparityConverted = new Mat();
|
||||||
|
MatFunctions.convertTo(disparity, disparityConverted, CvType.CV_8U, 0.25);
|
||||||
|
MatFunctions.copyTo(disparityConverted, disparity);
|
||||||
|
CustomTask.addTask(new DummyTask(left, right, disparity));
|
||||||
|
|
||||||
|
ORB orb = ORB.create(1000);
|
||||||
|
MatOfKeyPoint keypoints1 = new MatOfKeyPoint();
|
||||||
|
Mat descriptors1 = new Mat();
|
||||||
|
MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
|
||||||
|
Mat descriptors2 = new Mat();
|
||||||
|
Mat gray1 = new Mat();
|
||||||
|
Mat gray2 = new Mat();
|
||||||
|
|
||||||
|
Imgproc.cvtColor(left, gray1, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.cvtColor(right, gray2, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
orb.detectAndCompute(gray1, new Mat(), keypoints1, descriptors1);
|
||||||
|
orb.detectAndCompute(gray2, new Mat(), keypoints2, descriptors2);
|
||||||
|
DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
|
||||||
|
MatOfDMatch matches = new MatOfDMatch();
|
||||||
|
matcher.match(descriptors2, descriptors1, matches);
|
||||||
|
|
||||||
|
Mat outImg = new Mat();
|
||||||
|
Features2d.drawMatches(left, keypoints1, right, keypoints2, matches, outImg);
|
||||||
|
CustomTask.addTask(new DummyTask(outImg));
|
||||||
|
|
||||||
|
Mat image = new Mat();
|
||||||
|
MatFunctions.copyTo(skyscraper, image);
|
||||||
|
Mat gray = new Mat();
|
||||||
|
Mat edges = new Mat();
|
||||||
|
Imgproc.cvtColor(image, gray, Imgproc.COLOR_BGR2GRAY);
|
||||||
|
Imgproc.medianBlur(gray, gray, 15);
|
||||||
|
Imgproc.Canny(gray, edges, 15, 45);
|
||||||
|
|
||||||
|
CustomTask.addTask(new DummyTask(image, gray, edges));
|
||||||
|
|
||||||
|
});
|
||||||
|
utils.setInput(new MatArrayInput(Imgcodecs.imread("src/main/resources/left_small.png"), Imgcodecs.imread("src/main/resources/right_small.png"),
|
||||||
|
Imgcodecs.imread("src/main/resources/skyscraper_small.jpg")));
|
||||||
|
// utils.setInput(new MatArrayInput(Imgcodecs.imread("src/main/resources/skyscraper_small.jpg")));
|
||||||
|
// utils.setInput(new MatArrayInput(Imgcodecs.imread("src/main/resources/left_small.png"), Imgcodecs.imread("src/main/resources/right_small.png")));
|
||||||
|
// utils.setInput(new MatInput(Imgcodecs.imread("src/main/resources/car.jpg")));
|
||||||
|
// utils.setInput(new MatInput(Imgcodecs.imread("src/main/resources/skyscraper_small.jpg")));
|
||||||
|
|
||||||
|
utils.initializeCommands(true);
|
||||||
|
utils.warmup(2);
|
||||||
|
utils.runTests(5);
|
||||||
|
utils.evaluate();
|
||||||
|
System.out.println(Instant.now());// Just to time
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,450 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.exception.AlreadyInitializedException;
|
||||||
|
import de.unidue.nes.gpu.testframework.exception.NotInitializedException;
|
||||||
|
import de.unidue.nes.gpu.testframework.input.Input;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatPool;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatTaskTuple;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.UploadDownloadCaptor;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.pipeline.TestPipeline;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.resulthandling.Result;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.resulthandling.ResultHandler;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.resulthandling.TestExecution;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.tasks.general.DownloadTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.tasks.general.GenericGpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.tasks.general.PipelineTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.tasks.general.UploadTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.timing.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.timing.TimingUtil;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The "main" interface to the testing framework
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*
|
||||||
|
* @param <T> Type of input
|
||||||
|
*/
|
||||||
|
public class TestUtils<T> {
|
||||||
|
|
||||||
|
private static final Runnable NOOP = () -> {
|
||||||
|
};
|
||||||
|
|
||||||
|
private Consumer<Input<T>> commands;
|
||||||
|
|
||||||
|
private Input<T> originalInput;
|
||||||
|
|
||||||
|
private Input<T> input;
|
||||||
|
|
||||||
|
private boolean initialized;
|
||||||
|
|
||||||
|
private boolean testFullGraph;
|
||||||
|
|
||||||
|
private int warmupIterations;
|
||||||
|
|
||||||
|
private int testIterations;
|
||||||
|
|
||||||
|
public TestUtils() {
|
||||||
|
this.initialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param commands the command pipeline
|
||||||
|
*/
|
||||||
|
public void setCommandPipeline(Consumer<Input<T>> commands) {
|
||||||
|
checkNotInitialized();
|
||||||
|
this.commands = commands;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* used to specify the input to the command pipeline
|
||||||
|
*/
|
||||||
|
public void setInput(Input<T> input) {
|
||||||
|
checkNotInitialized();
|
||||||
|
this.originalInput = input;
|
||||||
|
this.input = input.createCopy();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* use this to initialize the commands
|
||||||
|
*
|
||||||
|
* @param testFullGraph
|
||||||
|
*/
|
||||||
|
public void initializeCommands(boolean testFullGraph) {
|
||||||
|
checkNotInitialized();
|
||||||
|
checkFieldsAreSet();
|
||||||
|
this.commands.accept(this.input);
|
||||||
|
initDescriptions();
|
||||||
|
this.initialized = true;
|
||||||
|
this.testFullGraph = testFullGraph;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initDescriptions() {
|
||||||
|
List<Task> tasks = TestPipeline.INSTANCE.getPipeline();
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
for (Task t : tasks) {
|
||||||
|
t.initDescription();
|
||||||
|
t.toCpuTask().run();
|
||||||
|
}
|
||||||
|
resetTasks();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkFieldsAreSet() {
|
||||||
|
Objects.requireNonNull(this.commands);
|
||||||
|
Objects.requireNonNull(this.originalInput);
|
||||||
|
Objects.requireNonNull(this.input);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* warmup method
|
||||||
|
*
|
||||||
|
* @param iterations the number of warmup iterations
|
||||||
|
*/
|
||||||
|
public void warmup(int iterations) {
|
||||||
|
this.warmupIterations = iterations;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* run the tests
|
||||||
|
*
|
||||||
|
* @param iterations the number of iterations to test
|
||||||
|
*/
|
||||||
|
public void runTests(int iterations) {
|
||||||
|
this.testIterations = iterations;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* only warmup cpu tests
|
||||||
|
*
|
||||||
|
* @param iterations the number of warmup iterations
|
||||||
|
*/
|
||||||
|
private void warmupCPUTests(int iterations) {
|
||||||
|
checkInitialized();
|
||||||
|
for (int i = 0; i < iterations; i++) {
|
||||||
|
List<Task> tasks = TestPipeline.INSTANCE.getPipeline();
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
for (Task t : tasks) {
|
||||||
|
t.toCpuTask().run();
|
||||||
|
}
|
||||||
|
resetTasks();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* only warmup gpu tests
|
||||||
|
*
|
||||||
|
* @param iterations the number of warmup iterations
|
||||||
|
*/
|
||||||
|
private void warmupGPUTests(int iterations) {
|
||||||
|
checkInitialized();
|
||||||
|
for (int i = 0; i < iterations; i++) {
|
||||||
|
List<Task> tasks = TestPipeline.INSTANCE.getPipeline();
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
for (Task t : tasks) {
|
||||||
|
GpuTask task = t.toGpuTask();
|
||||||
|
if (task == null) {
|
||||||
|
task = new GenericGpuTask(t);
|
||||||
|
}
|
||||||
|
task.init();
|
||||||
|
task.run();
|
||||||
|
task.cleanUp();
|
||||||
|
}
|
||||||
|
MatPool.reset();
|
||||||
|
resetTasks();
|
||||||
|
|
||||||
|
warmupUploadAndDownload(iterations);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void warmupUploadAndDownload(int iterations) {
|
||||||
|
List<MatTaskTuple> uploads = UploadDownloadCaptor.getUploads();
|
||||||
|
List<MatTaskTuple> downloads = UploadDownloadCaptor.getDownloads();
|
||||||
|
for (MatTaskTuple mtt : uploads) {
|
||||||
|
warmupUpload(mtt.getMat(), iterations);
|
||||||
|
}
|
||||||
|
for (MatTaskTuple mtt : downloads) {
|
||||||
|
warmupDownload(mtt.getMat(), iterations);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void warmupDownload(Mat mat, int iterations) {
|
||||||
|
for (int i = 0; i < iterations; i++) {
|
||||||
|
try (org.bytedeco.opencv.opencv_core.Mat jcvMat = new org.bytedeco.opencv.opencv_core.Mat(); GpuMat gpuMat = new GpuMat()) {
|
||||||
|
MatConverter.copyMat(mat, jcvMat);
|
||||||
|
gpuMat.upload(jcvMat);
|
||||||
|
gpuMat.download(jcvMat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void warmupUpload(Mat mat, int iterations) {
|
||||||
|
for (int i = 0; i < iterations; i++) {
|
||||||
|
try (org.bytedeco.opencv.opencv_core.Mat jcvMat = new org.bytedeco.opencv.opencv_core.Mat(); GpuMat gpuMat = new GpuMat()) {
|
||||||
|
MatConverter.copyMat(mat, jcvMat);
|
||||||
|
gpuMat.upload(jcvMat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* only run cpu tests
|
||||||
|
*
|
||||||
|
* @param iterations the number of iterations
|
||||||
|
*/
|
||||||
|
private void runCPUTests(int iterations) {
|
||||||
|
checkInitialized();
|
||||||
|
List<Task> tasks = TestPipeline.INSTANCE.getPipeline();
|
||||||
|
for (int i = 0; i < tasks.size(); i++) {
|
||||||
|
testCPUTaskInIsolation(tasks, i, iterations);
|
||||||
|
resetTasks();
|
||||||
|
}
|
||||||
|
testCPUPipeline(tasks, iterations);
|
||||||
|
resetTasks();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testCPUPipeline(List<Task> tasks, int iterations) {
|
||||||
|
Runnable setup = () -> this.originalInput.copyTo(this.input);
|
||||||
|
PipelineTask task = new PipelineTask(() -> tasks.forEach(t -> t.toCpuTask().run()), NOOP);
|
||||||
|
|
||||||
|
TimeDto time = TimingUtil.testPerformance(setup, task.toCpuTask(), this::resetTasks, iterations);
|
||||||
|
ResultHandler.newResult(new Result(task, TestExecution.CPU, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testCPUTaskInIsolation(List<Task> tasks, int index, int iterations) {
|
||||||
|
Runnable setup = () -> {
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
for (int j = 0; j < index; j++) {
|
||||||
|
tasks.get(j).toCpuTask().run();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
TimeDto time = TimingUtil.testPerformance(setup, tasks.get(index).toCpuTask(), this::resetTasks, iterations);
|
||||||
|
ResultHandler.newResult(new Result(tasks.get(index), TestExecution.CPU, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* only run gpu tests
|
||||||
|
*
|
||||||
|
* @param iterations the number of iterations
|
||||||
|
*/
|
||||||
|
private void runGPUTests(int iterations) {
|
||||||
|
testUploadAndDownload(iterations);
|
||||||
|
List<Task> tasks = TestPipeline.INSTANCE.getPipeline();
|
||||||
|
for (int i = 0; i < tasks.size(); i++) {
|
||||||
|
testGPUTaskInIsolation(tasks, i, iterations);
|
||||||
|
resetTasks();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testUploadAndDownload(int iterations) {
|
||||||
|
testUploads(iterations);
|
||||||
|
testDownloads(iterations);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testUploads(int iterations) {
|
||||||
|
List<MatTaskTuple> uploads = UploadDownloadCaptor.getUploads();
|
||||||
|
for (MatTaskTuple mtt : uploads) {
|
||||||
|
UploadTask task = new UploadTask(mtt.getMat(), mtt.getTask());
|
||||||
|
testSpecialGpuMethod(iterations, task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testDownloads(int iterations) {
|
||||||
|
List<MatTaskTuple> downloads = UploadDownloadCaptor.getDownloads();
|
||||||
|
for (MatTaskTuple mtt : downloads) {
|
||||||
|
DownloadTask task = new DownloadTask(mtt.getMat(), mtt.getTask());
|
||||||
|
testSpecialGpuMethod(iterations, task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testSpecialGpuMethod(int iterations, Task task) {
|
||||||
|
GpuTask gpuTask = task.toGpuTask();
|
||||||
|
TimeDto time = TimingUtil.testPerformance(() -> {
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
gpuTask.init();
|
||||||
|
}, gpuTask::run, gpuTask::cleanUp, iterations);
|
||||||
|
ResultHandler.newResult(new Result(task, TestExecution.GPU, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testGPUTaskInIsolation(List<Task> tasks, int index, int iterations) {
|
||||||
|
Task task = tasks.get(index);
|
||||||
|
GpuTask t = task.toGpuTask();
|
||||||
|
GpuTask toTest = t != null ? t : new GenericGpuTask(task);
|
||||||
|
Runnable setup = () -> {
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
for (int j = 0; j < index; j++) {
|
||||||
|
GpuTask gpuTask = tasks.get(j).toGpuTask();
|
||||||
|
if (gpuTask == null) {
|
||||||
|
gpuTask = new GenericGpuTask(tasks.get(j));
|
||||||
|
}
|
||||||
|
gpuTask.init();
|
||||||
|
gpuTask.run();
|
||||||
|
gpuTask.cleanUp();
|
||||||
|
}
|
||||||
|
toTest.init();
|
||||||
|
};
|
||||||
|
Runnable cleanUp = () -> {
|
||||||
|
toTest.cleanUp();
|
||||||
|
MatPool.reset();
|
||||||
|
resetTasks();
|
||||||
|
};
|
||||||
|
TimeDto time = TimingUtil.testPerformance(setup, toTest, cleanUp, iterations);
|
||||||
|
if (!(toTest instanceof GenericGpuTask)) {
|
||||||
|
ResultHandler.newResult(new Result(task, TestExecution.GPU, time));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkNotInitialized() {
|
||||||
|
if (this.initialized) {
|
||||||
|
throw new AlreadyInitializedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkInitialized() {
|
||||||
|
if (!this.initialized) {
|
||||||
|
throw new NotInitializedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* used to start the evaluation
|
||||||
|
*/
|
||||||
|
public void evaluate() {
|
||||||
|
warmupCPUTests(this.warmupIterations);
|
||||||
|
warmupGPUTests(this.warmupIterations);
|
||||||
|
runCPUTests(this.testIterations);
|
||||||
|
runGPUTests(this.testIterations);
|
||||||
|
ResultHandler.buildGraph();
|
||||||
|
|
||||||
|
if (this.testFullGraph) {
|
||||||
|
MatPool.reset();
|
||||||
|
UploadDownloadCaptor.reset();
|
||||||
|
resetTasks();
|
||||||
|
warmupAdditionalUploadsAndDownloads(this.warmupIterations);
|
||||||
|
testAdditionalUploadsAndDownloads(this.testIterations);
|
||||||
|
ResultHandler.addAdditionalEdges();
|
||||||
|
}
|
||||||
|
ResultHandler.evaluate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testAdditionalUploadsAndDownloads(int iterations) {
|
||||||
|
List<Task> tasks = TestPipeline.INSTANCE.getPipeline();
|
||||||
|
for (int i = 0; i < tasks.size(); i++) {
|
||||||
|
MatPool.reset();
|
||||||
|
UploadDownloadCaptor.reset();
|
||||||
|
resetTasks();
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
for (int j = 0; j < i; j++) {
|
||||||
|
Task t = tasks.get(j);
|
||||||
|
t.toCpuTask().run();
|
||||||
|
}
|
||||||
|
GpuTask gpuTask = tasks.get(i).toGpuTask();
|
||||||
|
if (gpuTask != null) {
|
||||||
|
gpuTask.init();
|
||||||
|
gpuTask.run();
|
||||||
|
gpuTask.cleanUp();
|
||||||
|
|
||||||
|
if (i != 0) {
|
||||||
|
testUploadsAndDownloads1(iterations, tasks.get(i - 1), tasks.get(i));
|
||||||
|
}
|
||||||
|
UploadDownloadCaptor.reset();
|
||||||
|
if (i != tasks.size() - 1) {
|
||||||
|
gpuTask = new GenericGpuTask(tasks.get(i + 1));
|
||||||
|
gpuTask.init();
|
||||||
|
gpuTask.run();
|
||||||
|
gpuTask.cleanUp();
|
||||||
|
testUploadsAndDownloads2(iterations, tasks.get(i), tasks.get(i + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testUploadsAndDownloads2(int iterations, Task gpuBefore, Task cpuTask) {
|
||||||
|
List<MatTaskTuple> uploads = UploadDownloadCaptor.getUploads();
|
||||||
|
List<MatTaskTuple> downloads = UploadDownloadCaptor.getDownloads();
|
||||||
|
for (int i = 0; i < uploads.size(); i++) {
|
||||||
|
UploadTask task = new UploadTask(uploads.get(i).getMat(), uploads.get(i).getTask());
|
||||||
|
TimeDto time = testUpload(iterations, task);
|
||||||
|
ResultHandler.newResultGpuToCpu(gpuBefore, cpuTask, time, true, task);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < downloads.size(); i++) {
|
||||||
|
DownloadTask task = new DownloadTask(downloads.get(i).getMat(), downloads.get(i).getTask());
|
||||||
|
TimeDto time = testDownload(iterations, task);
|
||||||
|
ResultHandler.newResultGpuToCpu(gpuBefore, cpuTask, time, false, task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testUploadsAndDownloads1(int iterations, Task cpuBefore, Task gpuTask) {
|
||||||
|
List<MatTaskTuple> uploads = UploadDownloadCaptor.getUploads();
|
||||||
|
List<MatTaskTuple> downloads = UploadDownloadCaptor.getDownloads();
|
||||||
|
for (int i = 0; i < uploads.size(); i++) {
|
||||||
|
UploadTask task = new UploadTask(uploads.get(i).getMat(), uploads.get(i).getTask());
|
||||||
|
TimeDto time = testUpload(iterations, task);
|
||||||
|
ResultHandler.newResultCpuToGpu(cpuBefore, gpuTask, time, true, task);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < downloads.size(); i++) {
|
||||||
|
DownloadTask task = new DownloadTask(downloads.get(i).getMat(), downloads.get(i).getTask());
|
||||||
|
TimeDto time = testDownload(iterations, task);
|
||||||
|
ResultHandler.newResultCpuToGpu(cpuBefore, gpuTask, time, false, task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private TimeDto testDownload(int iterations, DownloadTask task) {
|
||||||
|
GpuTask gpuTask = task.toGpuTask();
|
||||||
|
return TimingUtil.testPerformance(() -> {
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
gpuTask.init();
|
||||||
|
}, gpuTask::run, gpuTask::cleanUp, iterations);
|
||||||
|
}
|
||||||
|
|
||||||
|
private TimeDto testUpload(int iterations, UploadTask task) {
|
||||||
|
GpuTask gpuTask = task.toGpuTask();
|
||||||
|
return TimingUtil.testPerformance(() -> {
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
gpuTask.init();
|
||||||
|
}, gpuTask::run, gpuTask::cleanUp, iterations);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void warmupAdditionalUploadsAndDownloads(int iterations) {
|
||||||
|
List<Task> tasks = TestPipeline.INSTANCE.getPipeline();
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
for (int i = 0; i < tasks.size(); i++) {
|
||||||
|
MatPool.reset();
|
||||||
|
resetTasks();
|
||||||
|
this.originalInput.copyTo(this.input);
|
||||||
|
for (int j = 0; j < i; j++) {
|
||||||
|
Task t = tasks.get(j);
|
||||||
|
t.toCpuTask().run();
|
||||||
|
}
|
||||||
|
GpuTask gpuTask = tasks.get(i).toGpuTask();
|
||||||
|
if (gpuTask != null) {
|
||||||
|
gpuTask.init();
|
||||||
|
gpuTask.run();
|
||||||
|
gpuTask.cleanUp();
|
||||||
|
|
||||||
|
if (i != tasks.size() - 1) {
|
||||||
|
gpuTask = new GenericGpuTask(tasks.get(i + 1));
|
||||||
|
gpuTask.init();
|
||||||
|
gpuTask.run();
|
||||||
|
gpuTask.cleanUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
warmupUploadAndDownload(iterations);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetTasks() {
|
||||||
|
List<Task> tasks = TestPipeline.INSTANCE.getPipeline();
|
||||||
|
tasks.forEach(Task::reset);
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This exception is thrown when the initialization is triggered twice
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class AlreadyInitializedException extends RuntimeException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -6841426411699819018L;
|
||||||
|
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This exception is thrown when the testing framework was not initialized
|
||||||
|
* properly.
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class NotInitializedException extends RuntimeException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1239370038183374164L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.input;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A generic interface for all kinds of input
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public interface Input<T> {
|
||||||
|
|
||||||
|
void copyTo(Input<T> other);
|
||||||
|
|
||||||
|
Input<T> createCopy();
|
||||||
|
|
||||||
|
T get();
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.input;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Input for an array of Mats. The Mats are given as a vararg.
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class MatArrayInput implements Input<Mat[]> {
|
||||||
|
|
||||||
|
private final Mat[] arr;
|
||||||
|
|
||||||
|
public MatArrayInput(Mat... mats) {
|
||||||
|
this.arr = mats;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void copyTo(Input<Mat[]> other) {
|
||||||
|
for (int i = 0; i < this.arr.length; i++) {
|
||||||
|
this.arr[i].copyTo(other.get()[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Input<Mat[]> createCopy() {
|
||||||
|
Mat[] newArr = new Mat[this.arr.length];
|
||||||
|
for (int i = 0; i < this.arr.length; i++) {
|
||||||
|
newArr[i] = new Mat();
|
||||||
|
this.arr[i].copyTo(newArr[i]);
|
||||||
|
}
|
||||||
|
return new MatArrayInput(newArr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mat[] get() {
|
||||||
|
return this.arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.input;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An implementation for the input interface wrapping a Mat as input
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class MatInput implements Input<Mat> {
|
||||||
|
|
||||||
|
private final Mat mat;
|
||||||
|
|
||||||
|
public MatInput(Mat mat) {
|
||||||
|
this.mat = mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void copyTo(Input<Mat> other) {
|
||||||
|
this.mat.copyTo(other.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Input<Mat> createCopy() {
|
||||||
|
Mat newMat = new Mat();
|
||||||
|
this.mat.copyTo(newMat);
|
||||||
|
return new MatInput(newMat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mat get() {
|
||||||
|
return this.mat;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.input;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A tuple of Mats. Contains fields "left" and "right" (which can be used for
|
||||||
|
* stereo matching)
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class MatTuple {
|
||||||
|
|
||||||
|
public final Mat left;
|
||||||
|
public final Mat right;
|
||||||
|
|
||||||
|
public MatTuple(Mat left, Mat right) {
|
||||||
|
this.left = left;
|
||||||
|
this.right = right;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.input;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Input implementation for a MatTuple
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class MatTupleInput implements Input<MatTuple> {
|
||||||
|
|
||||||
|
private final MatTuple tuple;
|
||||||
|
|
||||||
|
public MatTupleInput(Mat left, Mat right) {
|
||||||
|
this.tuple = new MatTuple(left, right);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void copyTo(Input<MatTuple> other) {
|
||||||
|
this.tuple.left.copyTo(other.get().left);
|
||||||
|
this.tuple.right.copyTo(other.get().right);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Input<MatTuple> createCopy() {
|
||||||
|
return new MatTupleInput(this.tuple.left, this.tuple.right);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MatTuple get() {
|
||||||
|
return this.tuple;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+96
@@ -0,0 +1,96 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.mathandling;
|
||||||
|
|
||||||
|
import org.bytedeco.javacpp.indexer.ShortIndexer;
|
||||||
|
import org.opencv.core.CvType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A converter to convert between JavaCV and OpenCV Mats
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class MatConverter {
|
||||||
|
|
||||||
|
private MatConverter() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void copyMat(org.opencv.core.Mat src, org.bytedeco.opencv.opencv_core.Mat dst) {
|
||||||
|
final int cols = src.cols();
|
||||||
|
final int rows = src.rows();
|
||||||
|
final int type = src.type();
|
||||||
|
dst.create(rows, cols, type);
|
||||||
|
if (src.total() != 0) {
|
||||||
|
switch (CvType.depth(type)) {
|
||||||
|
case CvType.CV_8U:
|
||||||
|
convert8U(src, dst);
|
||||||
|
break;
|
||||||
|
case CvType.CV_16S:
|
||||||
|
convert16S(src, dst);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void convert16S(org.opencv.core.Mat src, org.bytedeco.opencv.opencv_core.Mat dst) {
|
||||||
|
try (ShortIndexer idx = dst.createIndexer()) {
|
||||||
|
for (int row = 0; row < src.rows(); row++) {
|
||||||
|
for (int col = 0; col < src.cols(); col++) {
|
||||||
|
short[] data = new short[src.channels()];
|
||||||
|
src.get(row, col, data);
|
||||||
|
idx.put(row, col, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new IllegalStateException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void convert8U(org.opencv.core.Mat src, org.bytedeco.opencv.opencv_core.Mat dst) {
|
||||||
|
byte[] buffer = new byte[(int) (src.total() * src.channels())];
|
||||||
|
src.get(0, 0, buffer);
|
||||||
|
dst.data().put(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void copyMat(org.bytedeco.opencv.opencv_core.Mat src, org.opencv.core.Mat dst) {
|
||||||
|
final int cols = src.cols();
|
||||||
|
final int rows = src.rows();
|
||||||
|
final int type = src.type();
|
||||||
|
dst.create(rows, cols, type);
|
||||||
|
if (src.total() != 0) {
|
||||||
|
switch (CvType.depth(type)) {
|
||||||
|
case CvType.CV_8U:
|
||||||
|
convert8U(src, dst);
|
||||||
|
break;
|
||||||
|
case CvType.CV_16S:
|
||||||
|
convert16S(src, dst);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void convert8U(org.bytedeco.opencv.opencv_core.Mat src, org.opencv.core.Mat dst) {
|
||||||
|
byte[] buffer = new byte[(int) (src.total() * src.channels())];
|
||||||
|
src.data().get(buffer);
|
||||||
|
dst.put(0, 0, buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void convert16S(org.bytedeco.opencv.opencv_core.Mat src, org.opencv.core.Mat dst) {
|
||||||
|
try (ShortIndexer idx = src.createIndexer()) {
|
||||||
|
for (int row = 0; row < src.rows(); row++) {
|
||||||
|
for (int col = 0; col < src.cols(); col++) {
|
||||||
|
short[] data = new short[src.channels()];
|
||||||
|
idx.get(row, col, data);
|
||||||
|
dst.put(row, col, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new IllegalStateException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+66
@@ -0,0 +1,66 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.mathandling;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A pool of Mats and GpuMats
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class MatPool {
|
||||||
|
|
||||||
|
private static final Map<Long, GpuMat> gpuMats = new HashMap<>();
|
||||||
|
|
||||||
|
private static final Map<Long, Mat> mats = new HashMap<>();
|
||||||
|
|
||||||
|
private static final Map<Long, State> states = new HashMap<>();
|
||||||
|
|
||||||
|
private enum State {
|
||||||
|
CPU, GPU
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GpuMat getUploadedGpuMat(org.opencv.core.Mat mat, Task task) {
|
||||||
|
if (gpuMats.containsKey(mat.getNativeObjAddr())) {
|
||||||
|
if (states.get(mat.getNativeObjAddr()) == State.CPU) {
|
||||||
|
UploadDownloadCaptor.captureUpload(mat, task);
|
||||||
|
MatConverter.copyMat(mat, mats.get(mat.getNativeObjAddr()));
|
||||||
|
gpuMats.get(mat.getNativeObjAddr()).upload(mats.get(mat.getNativeObjAddr()));
|
||||||
|
states.put(mat.getNativeObjAddr(), State.GPU);
|
||||||
|
}
|
||||||
|
return gpuMats.get(mat.getNativeObjAddr());
|
||||||
|
}
|
||||||
|
GpuMat gpuMat = new GpuMat();
|
||||||
|
Mat jcvMat = new Mat();
|
||||||
|
MatConverter.copyMat(mat, jcvMat);
|
||||||
|
gpuMat.upload(jcvMat);
|
||||||
|
gpuMats.put(mat.getNativeObjAddr(), gpuMat);
|
||||||
|
mats.put(mat.getNativeObjAddr(), jcvMat);
|
||||||
|
states.put(mat.getNativeObjAddr(), State.GPU);
|
||||||
|
UploadDownloadCaptor.captureUpload(mat, task);
|
||||||
|
return gpuMat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void download(org.opencv.core.Mat mat, Task task) {
|
||||||
|
if (gpuMats.containsKey(mat.getNativeObjAddr()) && states.get(mat.getNativeObjAddr()) == State.GPU) {
|
||||||
|
gpuMats.get(mat.getNativeObjAddr()).download(mats.get(mat.getNativeObjAddr()));
|
||||||
|
MatConverter.copyMat(mats.get(mat.getNativeObjAddr()), mat);
|
||||||
|
states.put(mat.getNativeObjAddr(), State.CPU);
|
||||||
|
UploadDownloadCaptor.captureDownload(mat, task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void reset() {
|
||||||
|
gpuMats.values().forEach(GpuMat::close);
|
||||||
|
mats.values().forEach(Mat::close);
|
||||||
|
gpuMats.clear();
|
||||||
|
mats.clear();
|
||||||
|
states.clear();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.mathandling;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A combination of a Mat and a Task
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public final class MatTaskTuple {
|
||||||
|
|
||||||
|
private final Mat mat;
|
||||||
|
|
||||||
|
private final Task task;
|
||||||
|
|
||||||
|
private final long nativeMat;
|
||||||
|
|
||||||
|
MatTaskTuple(Mat mat, Task task) {
|
||||||
|
this.mat = new Mat();
|
||||||
|
mat.copyTo(this.mat);
|
||||||
|
this.task = task;
|
||||||
|
this.nativeMat = mat.getNativeObjAddr();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mat getMat() {
|
||||||
|
return this.mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task getTask() {
|
||||||
|
return this.task;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getNativeMat() {
|
||||||
|
return this.nativeMat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (!(obj instanceof MatTaskTuple)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
MatTaskTuple other = (MatTaskTuple) obj;
|
||||||
|
return other.nativeMat == this.nativeMat && other.task == this.task;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(this.nativeMat, this.task);
|
||||||
|
}
|
||||||
|
}
|
||||||
+51
@@ -0,0 +1,51 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.mathandling;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is used to capture uploads and downloads
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class UploadDownloadCaptor {
|
||||||
|
|
||||||
|
private UploadDownloadCaptor() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final List<MatTaskTuple> uploads = new ArrayList<>();
|
||||||
|
|
||||||
|
private static final List<MatTaskTuple> downloads = new ArrayList<>();
|
||||||
|
|
||||||
|
public static void captureUpload(Mat mat, Task task) {
|
||||||
|
MatTaskTuple tuple = new MatTaskTuple(mat, task);
|
||||||
|
if (!uploads.contains(tuple)) {
|
||||||
|
uploads.add(tuple);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void captureDownload(Mat mat, Task task) {
|
||||||
|
MatTaskTuple tuple = new MatTaskTuple(mat, task);
|
||||||
|
if (!downloads.contains(tuple)) {
|
||||||
|
downloads.add(tuple);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void reset() {
|
||||||
|
uploads.clear();
|
||||||
|
downloads.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<MatTaskTuple> getUploads() {
|
||||||
|
return new ArrayList<>(uploads);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<MatTaskTuple> getDownloads() {
|
||||||
|
return new ArrayList<>(downloads);
|
||||||
|
}
|
||||||
|
}
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.pipeline;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The pipeline of tasks
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class TestPipeline {
|
||||||
|
|
||||||
|
public static final TestPipeline INSTANCE = new TestPipeline();
|
||||||
|
|
||||||
|
private TestPipeline() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Task> pipeline = new ArrayList<>();
|
||||||
|
|
||||||
|
public void addTask(Task task) {
|
||||||
|
this.pipeline.add(task);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Task> getPipeline() {
|
||||||
|
return new ArrayList<>(this.pipeline);
|
||||||
|
}
|
||||||
|
}
|
||||||
+69
@@ -0,0 +1,69 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.resulthandling;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.timing.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* a testing result
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class Result {
|
||||||
|
|
||||||
|
private final Task task;
|
||||||
|
|
||||||
|
private final TestExecution execution;
|
||||||
|
|
||||||
|
private final TimeDto time;
|
||||||
|
|
||||||
|
private final Task before;
|
||||||
|
|
||||||
|
private final Task after;
|
||||||
|
|
||||||
|
public Result(Task task, TestExecution execution, TimeDto time) {
|
||||||
|
this.task = task;
|
||||||
|
this.execution = execution;
|
||||||
|
this.time = time;
|
||||||
|
|
||||||
|
this.before = null;
|
||||||
|
this.after = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result(Task before, Task after, TimeDto time, Task task) {
|
||||||
|
this.task = task;
|
||||||
|
this.execution = TestExecution.GPU;
|
||||||
|
this.time = time;
|
||||||
|
|
||||||
|
this.before = before;
|
||||||
|
this.after = after;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task getAfter() {
|
||||||
|
return this.after;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task getBefore() {
|
||||||
|
return this.before;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task getTask() {
|
||||||
|
return this.task;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestExecution getExecution() {
|
||||||
|
return this.execution;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TimeDto getTime() {
|
||||||
|
return this.time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result createCopy() {
|
||||||
|
return new Result(this.task, this.execution, this.time.createCopy());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return this.task.getDescription() + " on " + this.execution + " took " + this.time.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
+409
@@ -0,0 +1,409 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.resulthandling;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.google.common.graph.GraphBuilder;
|
||||||
|
import com.google.common.graph.MutableGraph;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.pipeline.TestPipeline;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.tasks.general.DownloadTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.tasks.general.PipelineTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.tasks.general.UploadTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.timing.TimeDto;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* a class collecting all results and computing the final result
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class ResultHandler {
|
||||||
|
|
||||||
|
private static final List<Result> cpuResults = new ArrayList<>();
|
||||||
|
|
||||||
|
private static final List<Result> gpuResults = new ArrayList<>();
|
||||||
|
|
||||||
|
private static Result cpuPipeline;
|
||||||
|
|
||||||
|
private ResultHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void newResult(Result result) {
|
||||||
|
if (result.getTask().getClass() == PipelineTask.class) {
|
||||||
|
cpuPipeline = result;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (result.getExecution() == TestExecution.CPU) {
|
||||||
|
cpuResults.add(result);
|
||||||
|
} else if (result.getExecution() == TestExecution.GPU) {
|
||||||
|
gpuResults.add(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static MutableGraph<Result> graph;
|
||||||
|
|
||||||
|
public static void buildGraph() {
|
||||||
|
List<Task> tasks = TestPipeline.INSTANCE.getPipeline();
|
||||||
|
graph = buildResultGraph(tasks);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void evaluate() {
|
||||||
|
List<List<Result>> paths = getPaths(graph);
|
||||||
|
evaluatePaths(paths);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addAdditionalEdges() {
|
||||||
|
if (newUploads.size() > 0) {
|
||||||
|
addnewUploads();
|
||||||
|
}
|
||||||
|
if (newDownloads.size() > 0) {
|
||||||
|
addnewDownloads();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addnewDownloads() {
|
||||||
|
outer: for (int i = 0;;) {
|
||||||
|
List<Result> results = new ArrayList<>();
|
||||||
|
Result res = newDownloads.get(i);
|
||||||
|
results.add(res);
|
||||||
|
i++;
|
||||||
|
for (;;) {
|
||||||
|
if (i >= newDownloads.size()) {
|
||||||
|
addDownloadsToGraph(results);
|
||||||
|
break outer;
|
||||||
|
}
|
||||||
|
Result next = newDownloads.get(i);
|
||||||
|
if (next.getBefore() == res.getBefore() && next.getAfter() == res.getAfter()) {
|
||||||
|
results.add(next);
|
||||||
|
res = next;
|
||||||
|
i++;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addDownloadsToGraph(results);
|
||||||
|
if (i >= newDownloads.size()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param results
|
||||||
|
*/
|
||||||
|
private static void addDownloadsToGraph(List<Result> results) {
|
||||||
|
Task before = results.get(0).getBefore();
|
||||||
|
Task after = results.get(0).getAfter();
|
||||||
|
List<Result> l = graph.nodes().stream().filter(res -> res.getTask() == before && res.getExecution() == TestExecution.GPU).collect(Collectors.toList());
|
||||||
|
if (l.size() != 1) {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
Result nodeBefore = l.get(0);
|
||||||
|
l = graph.nodes().stream().filter(res -> res.getTask() == after && res.getExecution() == TestExecution.CPU).collect(Collectors.toList());
|
||||||
|
if (l.size() != 1) {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
Result nodeAfter = l.get(0);
|
||||||
|
Result tmp = nodeBefore;
|
||||||
|
for (int i = 0; i < results.size(); i++) {
|
||||||
|
Result r = results.get(i);
|
||||||
|
graph.addNode(r);
|
||||||
|
graph.putEdge(tmp, r);
|
||||||
|
tmp = r;
|
||||||
|
}
|
||||||
|
if (tmp == nodeBefore) {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
graph.putEdge(tmp, nodeAfter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addnewUploads() {
|
||||||
|
outer: for (int i = 0;;) {
|
||||||
|
List<Result> results = new ArrayList<>();
|
||||||
|
Result res = newUploads.get(i);
|
||||||
|
results.add(res);
|
||||||
|
i++;
|
||||||
|
for (;;) {
|
||||||
|
if (i >= newUploads.size()) {
|
||||||
|
addUploadsToGraph(results);
|
||||||
|
break outer;
|
||||||
|
}
|
||||||
|
Result next = newUploads.get(i);
|
||||||
|
if (next.getBefore() == res.getBefore() && next.getAfter() == res.getAfter()) {
|
||||||
|
results.add(next);
|
||||||
|
res = next;
|
||||||
|
i++;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addUploadsToGraph(results);
|
||||||
|
if (i >= newUploads.size()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addUploadsToGraph(List<Result> results) {
|
||||||
|
Task before = results.get(0).getBefore();
|
||||||
|
Task after = results.get(0).getAfter();
|
||||||
|
List<Result> l = graph.nodes().stream().filter(res -> res.getTask() == before && res.getExecution() == TestExecution.CPU).collect(Collectors.toList());
|
||||||
|
if (l.size() != 1) {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
Result nodeBefore = l.get(0);
|
||||||
|
l = graph.nodes().stream().filter(res -> res.getTask() == after && res.getExecution() == TestExecution.GPU).collect(Collectors.toList());
|
||||||
|
if (l.size() != 1) {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
Result nodeAfter = l.get(0);
|
||||||
|
Result tmp = nodeBefore;
|
||||||
|
for (int i = 0; i < results.size(); i++) {
|
||||||
|
Result r = results.get(i);
|
||||||
|
graph.addNode(r);
|
||||||
|
graph.putEdge(tmp, r);
|
||||||
|
tmp = r;
|
||||||
|
}
|
||||||
|
if (tmp == nodeBefore) {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
graph.putEdge(tmp, nodeAfter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final List<Result> newUploads = new ArrayList<>();
|
||||||
|
private static final List<Result> newDownloads = new ArrayList<>();
|
||||||
|
|
||||||
|
public static void newResultCpuToGpu(Task cpuBefore, Task gpuTask, TimeDto time, boolean upload, Task task) {
|
||||||
|
if (!upload) {
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
newUploads.add(new Result(cpuBefore, gpuTask, time, task));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void newResultGpuToCpu(Task gpuBefore, Task cpuTask, TimeDto time, boolean upload, Task task) {
|
||||||
|
if (upload) {
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
newDownloads.add(new Result(gpuBefore, cpuTask, time, task));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void removeDuplicatePaths(List<List<Result>> paths) {
|
||||||
|
boolean modified = true;
|
||||||
|
while (modified) {
|
||||||
|
outer: for (int i = 0; i < paths.size(); i++) {
|
||||||
|
for (int j = 0; j < paths.size(); j++) {
|
||||||
|
if (i != j) {
|
||||||
|
modified = checkPathsEquality(paths.get(i), paths.get(j));
|
||||||
|
if (modified) {
|
||||||
|
break outer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paths.removeIf(List::isEmpty);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean checkPathsEquality(List<Result> path1, List<Result> path2) {
|
||||||
|
if (path1.size() != path2.size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (path1.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < path1.size(); i++) {
|
||||||
|
Result r1 = path1.get(i);
|
||||||
|
Result r2 = path2.get(i);
|
||||||
|
if (!r1.equals(r2)) {// TODO: improve equality check?
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("AAAAA");
|
||||||
|
path2.clear();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void evaluatePaths(List<List<Result>> paths) {
|
||||||
|
|
||||||
|
// removeDuplicatePaths(paths); // Are duplicate paths even possible? Takes incredibly long to compute.
|
||||||
|
|
||||||
|
System.out.println("Found " + paths.size() + " different paths");
|
||||||
|
final boolean printAll = paths.size() <= 32;
|
||||||
|
List<Result> fastest = Collections.emptyList();
|
||||||
|
double time = Double.POSITIVE_INFINITY;
|
||||||
|
for (int i = 0; i < paths.size(); i++) {
|
||||||
|
if (printAll) {
|
||||||
|
System.out.println("Path " + i + ":");
|
||||||
|
printPath(paths.get(i));
|
||||||
|
}
|
||||||
|
double pathTime = getTime(paths.get(i));
|
||||||
|
if (printAll) {
|
||||||
|
System.out.println("Estimated execution time: " + new TimeDto(pathTime, 0, 0, 0, TimeUnit.NANOSECONDS).toString());
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
if (pathTime < time) {
|
||||||
|
time = pathTime;
|
||||||
|
fastest = paths.get(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("Fastest path: ");
|
||||||
|
printPath(fastest);
|
||||||
|
System.out.println("Estimated execution time: " + new TimeDto(time, 0, 0, 0, TimeUnit.NANOSECONDS).toString());
|
||||||
|
System.out.println("Measured CPU execution time: " + cpuPipeline.getTime().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static double getTime(List<Result> list) {
|
||||||
|
double time = 0;
|
||||||
|
for (Result r : list) {
|
||||||
|
time += r.getTime().getAvgTime();
|
||||||
|
}
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void printPath(List<Result> path) {
|
||||||
|
for (int i = 1; i < path.size() - 1; i++) {
|
||||||
|
System.out.println(path.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static MutableGraph<Result> buildResultGraph(List<Task> tasks) {
|
||||||
|
MutableGraph<Result> graph = GraphBuilder.directed().build();
|
||||||
|
addSpecialValues(tasks, graph);
|
||||||
|
|
||||||
|
for (int i = 1; i < tasks.size(); i++) {
|
||||||
|
Task prev = tasks.get(i - 1);
|
||||||
|
Task t = tasks.get(i);
|
||||||
|
Result prevCpuResult = getResult(prev, cpuResults);
|
||||||
|
Result prevGpuResult = getResult(prev, gpuResults);
|
||||||
|
Result cpuResult = getResult(t, cpuResults);
|
||||||
|
Result gpuResult = getResult(t, gpuResults);
|
||||||
|
List<Result> uploads = getUploads(t);
|
||||||
|
List<Result> downloads = getDownloads(t);
|
||||||
|
|
||||||
|
if (cpuResult == null || prevCpuResult == null) {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
graph.addNode(cpuResult);
|
||||||
|
graph.putEdge(prevCpuResult, cpuResult);
|
||||||
|
|
||||||
|
Result tmp = prevGpuResult != null ? prevGpuResult : prevCpuResult;
|
||||||
|
for (Result up : uploads) {
|
||||||
|
graph.addNode(up);
|
||||||
|
graph.putEdge(tmp, up);
|
||||||
|
tmp = up;
|
||||||
|
}
|
||||||
|
for (Result down : downloads) {
|
||||||
|
graph.addNode(down);
|
||||||
|
graph.putEdge(tmp, down);
|
||||||
|
tmp = down;
|
||||||
|
}
|
||||||
|
if (gpuResult != null) {
|
||||||
|
graph.addNode(gpuResult);
|
||||||
|
graph.putEdge(tmp, gpuResult);
|
||||||
|
} else {
|
||||||
|
if (tmp != prevCpuResult) {
|
||||||
|
graph.putEdge(tmp, cpuResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return graph;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<List<Result>> getPaths(MutableGraph<Result> graph) {
|
||||||
|
Result first = graph.nodes().stream().filter(res -> graph.inDegree(res) == 0).findAny().get();
|
||||||
|
return addPaths(first, graph, new ArrayList<Result>());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<List<Result>> addPaths(Result node, MutableGraph<Result> graph, List<Result> currentPath) {
|
||||||
|
currentPath.add(node);
|
||||||
|
Set<Result> next = graph.successors(node);
|
||||||
|
if (next.isEmpty()) {
|
||||||
|
return Collections.singletonList(currentPath);
|
||||||
|
}
|
||||||
|
List<List<Result>> paths = new ArrayList<>();
|
||||||
|
for (Result r : next) {
|
||||||
|
List<Result> path = new ArrayList<>(currentPath);
|
||||||
|
paths.addAll(addPaths(r, graph, path));
|
||||||
|
}
|
||||||
|
|
||||||
|
return paths;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addSpecialValues(List<Task> tasks, MutableGraph<Result> graph) {
|
||||||
|
Task first = new DummyTask();
|
||||||
|
tasks.add(0, first);
|
||||||
|
Task last = new DummyTask();
|
||||||
|
tasks.add(last);
|
||||||
|
Result firstResult = new Result(first, TestExecution.CPU, new TimeDto(0, 0, 0, 0, TimeUnit.NANOSECONDS));
|
||||||
|
Result lastResult = new Result(last, TestExecution.CPU, new TimeDto(0, 0, 0, 0, TimeUnit.NANOSECONDS));
|
||||||
|
cpuResults.add(firstResult);
|
||||||
|
cpuResults.add(lastResult);
|
||||||
|
graph.addNode(firstResult);
|
||||||
|
graph.addNode(lastResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<Result> getDownloads(Task t) {
|
||||||
|
return gpuResults.stream().filter(res -> res.getTask().getClass() == DownloadTask.class && ((DownloadTask) res.getTask()).getTask() == t)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<Result> getUploads(Task t) {
|
||||||
|
return gpuResults.stream().filter(res -> res.getTask().getClass() == UploadTask.class && ((UploadTask) res.getTask()).getTask() == t)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Result getResult(Task t, List<Result> results) {
|
||||||
|
for (Result r : results) {
|
||||||
|
if (r.getTask() == t) {
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this task is used as first and last node of the resulting graph. It is never
|
||||||
|
* run.
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
private static final class DummyTask implements Task {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return "DummyTask";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.resulthandling;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An enum to differentiate between CPU and GPU test execution
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public enum TestExecution {
|
||||||
|
CPU, GPU
|
||||||
|
}
|
||||||
+86
@@ -0,0 +1,86 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.descriptormatcher;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.global.opencv_core;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A task for the DescriptorMatcher.create(int) function
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class DescriptorMatcher_create implements Task {
|
||||||
|
|
||||||
|
private final int matcherType;
|
||||||
|
|
||||||
|
private final int cudaNormType;
|
||||||
|
|
||||||
|
private String descr;
|
||||||
|
|
||||||
|
public DescriptorMatcher_create(int id, int matcherType) {
|
||||||
|
this.descr = "";
|
||||||
|
this.matcherType = matcherType;
|
||||||
|
this.cudaNormType = getNormType(matcherType);
|
||||||
|
DescriptorMatchers.addMatcher(org.opencv.features2d.DescriptorMatcher.create(matcherType), id);
|
||||||
|
DescriptorMatchers.addCudaMatcher(org.bytedeco.opencv.opencv_cudafeatures2d.DescriptorMatcher.createBFMatcher(this.cudaNormType), id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getNormType(int type) {
|
||||||
|
switch (type) {
|
||||||
|
case org.opencv.features2d.DescriptorMatcher.BRUTEFORCE_HAMMING:
|
||||||
|
return opencv_core.NORM_HAMMING;
|
||||||
|
case org.opencv.features2d.DescriptorMatcher.BRUTEFORCE_L1:
|
||||||
|
return opencv_core.NORM_L1;
|
||||||
|
case org.opencv.features2d.DescriptorMatcher.BRUTEFORCE_HAMMINGLUT:
|
||||||
|
return opencv_core.NORM_HAMMING2;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return () -> org.opencv.features2d.DescriptorMatcher.create(this.matcherType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
return new GpuTask() {
|
||||||
|
|
||||||
|
private org.bytedeco.opencv.opencv_cudafeatures2d.DescriptorMatcher matcher;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
this.matcher = org.bytedeco.opencv.opencv_cudafeatures2d.DescriptorMatcher.createBFMatcher(DescriptorMatcher_create.this.cudaNormType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
// nothing to init
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
this.matcher.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return this.descr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
// Nothing to reset
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
this.descr = "DescriptorMatcher.create(" + this.matcherType + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+131
@@ -0,0 +1,131 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.descriptormatcher;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.opencv_core.DMatchVector;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.MatOfDMatch;
|
||||||
|
import org.opencv.features2d.DescriptorMatcher;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatPool;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The DescriptorMatcher.match function
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class DescriptorMatcher_match implements Task {
|
||||||
|
|
||||||
|
private final int id;
|
||||||
|
|
||||||
|
private final DescriptorMatcher theMatcher;
|
||||||
|
|
||||||
|
private final Mat queryDescriptors;
|
||||||
|
private final Mat trainDescriptors;
|
||||||
|
private final MatOfDMatch matches;
|
||||||
|
|
||||||
|
private final Mat originalQueryDescriptors;
|
||||||
|
private final Mat originalTrainDescriptors;
|
||||||
|
private final MatOfDMatch originalMatches;
|
||||||
|
|
||||||
|
private String descr;
|
||||||
|
|
||||||
|
public DescriptorMatcher_match(int id, Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches) {
|
||||||
|
this.descr = "";
|
||||||
|
|
||||||
|
this.id = id;
|
||||||
|
|
||||||
|
this.theMatcher = DescriptorMatchers.getById(this.id);
|
||||||
|
|
||||||
|
this.queryDescriptors = queryDescriptors;
|
||||||
|
this.trainDescriptors = trainDescriptors;
|
||||||
|
this.matches = matches;
|
||||||
|
|
||||||
|
this.originalQueryDescriptors = new Mat();
|
||||||
|
this.queryDescriptors.copyTo(this.originalQueryDescriptors);
|
||||||
|
this.originalTrainDescriptors = new Mat();
|
||||||
|
this.trainDescriptors.copyTo(this.originalTrainDescriptors);
|
||||||
|
this.originalMatches = new MatOfDMatch();
|
||||||
|
this.matches.copyTo(this.originalMatches);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return () -> this.theMatcher.match(this.queryDescriptors, this.trainDescriptors, this.matches);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
|
||||||
|
org.bytedeco.opencv.opencv_cudafeatures2d.DescriptorMatcher cudaMatcher = DescriptorMatchers.getCudaMatcherById(this.id);
|
||||||
|
if (cudaMatcher == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new GpuTask() {
|
||||||
|
|
||||||
|
private GpuMat gpuQueryDescriptors;
|
||||||
|
private GpuMat gpuTrainDescriptors;
|
||||||
|
private DMatchVector javaCvMatches;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
cudaMatcher.match(this.gpuQueryDescriptors, this.gpuTrainDescriptors, this.javaCvMatches);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
this.gpuQueryDescriptors = MatPool.getUploadedGpuMat(DescriptorMatcher_match.this.queryDescriptors, DescriptorMatcher_match.this);
|
||||||
|
this.gpuTrainDescriptors = MatPool.getUploadedGpuMat(DescriptorMatcher_match.this.trainDescriptors, DescriptorMatcher_match.this);
|
||||||
|
this.javaCvMatches = convertToDMatchVector(DescriptorMatcher_match.this.matches);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DMatchVector convertToDMatchVector(MatOfDMatch matches) {
|
||||||
|
org.opencv.core.DMatch[] matchArray = matches.toArray();
|
||||||
|
org.bytedeco.opencv.opencv_core.DMatch[] javacvmatchArray = new org.bytedeco.opencv.opencv_core.DMatch[matchArray.length];
|
||||||
|
|
||||||
|
for (int i = 0; i < matchArray.length; i++) {
|
||||||
|
org.opencv.core.DMatch m = matchArray[i];
|
||||||
|
javacvmatchArray[i] = new org.bytedeco.opencv.opencv_core.DMatch(m.queryIdx, m.trainIdx, m.imgIdx, m.distance);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new DMatchVector(javacvmatchArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
copyMatches(this.javaCvMatches, DescriptorMatcher_match.this.matches);
|
||||||
|
this.javaCvMatches.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void copyMatches(DMatchVector vec, MatOfDMatch matches) {
|
||||||
|
org.bytedeco.opencv.opencv_core.DMatch[] matchesArray = vec.get();
|
||||||
|
org.opencv.core.DMatch[] opencvMatches = new org.opencv.core.DMatch[matchesArray.length];
|
||||||
|
for (int i = 0; i < matchesArray.length; i++) {
|
||||||
|
org.bytedeco.opencv.opencv_core.DMatch m = matchesArray[i];
|
||||||
|
opencvMatches[i] = new org.opencv.core.DMatch(m.queryIdx(), m.trainIdx(), m.imgIdx(), m.distance());
|
||||||
|
}
|
||||||
|
matches.fromArray(opencvMatches);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return this.descr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
this.originalQueryDescriptors.copyTo(this.queryDescriptors);
|
||||||
|
this.originalTrainDescriptors.copyTo(this.trainDescriptors);
|
||||||
|
this.originalMatches.copyTo(this.matches);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
this.descr = "DescriptorMatcher.match(" + this.queryDescriptors + ", " + this.trainDescriptors + ", " + this.matches + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.descriptormatcher;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.opencv.features2d.DescriptorMatcher;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* a pool of DescriptorMatchers
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class DescriptorMatchers {
|
||||||
|
|
||||||
|
private DescriptorMatchers() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Integer, DescriptorMatcher> DESCRIPTOR_MATCHER_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
private static final Map<Integer, org.bytedeco.opencv.opencv_cudafeatures2d.DescriptorMatcher> CUDA_DESCRIPTOR_MATCHER_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
public static void addMatcher(DescriptorMatcher matcher, int id) {
|
||||||
|
if (DESCRIPTOR_MATCHER_MAP.containsKey(id)) {
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
DESCRIPTOR_MATCHER_MAP.put(id, matcher);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCudaMatcher(org.bytedeco.opencv.opencv_cudafeatures2d.DescriptorMatcher matcher, int id) {
|
||||||
|
if (CUDA_DESCRIPTOR_MATCHER_MAP.containsKey(id)) {
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
CUDA_DESCRIPTOR_MATCHER_MAP.put(id, matcher);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DescriptorMatcher getById(int id) {
|
||||||
|
if (!DESCRIPTOR_MATCHER_MAP.containsKey(id)) {
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
return DESCRIPTOR_MATCHER_MAP.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static org.bytedeco.opencv.opencv_cudafeatures2d.DescriptorMatcher getCudaMatcherById(int id) {
|
||||||
|
if (!CUDA_DESCRIPTOR_MATCHER_MAP.containsKey(id)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return CUDA_DESCRIPTOR_MATCHER_MAP.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+68
@@ -0,0 +1,68 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.features2d;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.MatOfKeyPoint;
|
||||||
|
import org.opencv.features2d.Features2d;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The function Features2d.drawKeypoints
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class DrawKeypoints implements Task {
|
||||||
|
|
||||||
|
private final Mat image;
|
||||||
|
private final MatOfKeyPoint keypoints;
|
||||||
|
private final Mat outImage;
|
||||||
|
|
||||||
|
private final Mat originalImage;
|
||||||
|
private final MatOfKeyPoint originalKeypoints;
|
||||||
|
private final Mat originalOutImage;
|
||||||
|
|
||||||
|
private String descr = "";
|
||||||
|
|
||||||
|
public DrawKeypoints(Mat image, MatOfKeyPoint keypoints, Mat outImage) {
|
||||||
|
this.image = image;
|
||||||
|
this.keypoints = keypoints;
|
||||||
|
this.outImage = outImage;
|
||||||
|
|
||||||
|
this.originalImage = new Mat();
|
||||||
|
this.image.copyTo(this.originalImage);
|
||||||
|
this.originalKeypoints = new MatOfKeyPoint();
|
||||||
|
this.keypoints.copyTo(this.originalKeypoints);
|
||||||
|
this.originalOutImage = new Mat();
|
||||||
|
this.outImage.copyTo(this.originalOutImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return () -> Features2d.drawKeypoints(this.image, this.keypoints, this.outImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
return null; // no drawing keypoints on gpu
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return this.descr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
this.originalImage.copyTo(this.image);
|
||||||
|
this.originalKeypoints.copyTo(this.keypoints);
|
||||||
|
this.originalOutImage.copyTo(this.outImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
this.descr = "Features2d.drawKeypoints(" + this.image + ", " + this.keypoints + ", " + this.outImage + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+88
@@ -0,0 +1,88 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.features2d;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.core.MatOfDMatch;
|
||||||
|
import org.opencv.core.MatOfKeyPoint;
|
||||||
|
import org.opencv.features2d.Features2d;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The function Features2d.drawMatches
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class DrawMatches implements Task {
|
||||||
|
|
||||||
|
private final Mat img1;
|
||||||
|
private final MatOfKeyPoint keypoints1;
|
||||||
|
private final Mat img2;
|
||||||
|
private final MatOfKeyPoint keypoints2;
|
||||||
|
private final MatOfDMatch matches1to2;
|
||||||
|
private final Mat outImg;
|
||||||
|
|
||||||
|
private final Mat originalImg1;
|
||||||
|
private final MatOfKeyPoint originalKeypoints1;
|
||||||
|
private final Mat originalImg2;
|
||||||
|
private final MatOfKeyPoint originalKeypoints2;
|
||||||
|
private final MatOfDMatch originalMatches1to2;
|
||||||
|
private final Mat originalOutImg;
|
||||||
|
|
||||||
|
private String descr = "";
|
||||||
|
|
||||||
|
public DrawMatches(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, MatOfDMatch matches1to2, Mat outImg) {
|
||||||
|
this.img1 = img1;
|
||||||
|
this.keypoints1 = keypoints1;
|
||||||
|
this.img2 = img2;
|
||||||
|
this.keypoints2 = keypoints2;
|
||||||
|
this.matches1to2 = matches1to2;
|
||||||
|
this.outImg = outImg;
|
||||||
|
|
||||||
|
this.originalImg1 = new Mat();
|
||||||
|
this.img1.copyTo(this.originalImg1);
|
||||||
|
this.originalKeypoints1 = new MatOfKeyPoint();
|
||||||
|
this.keypoints1.copyTo(this.originalKeypoints1);
|
||||||
|
this.originalImg2 = new Mat();
|
||||||
|
this.img2.copyTo(this.originalImg2);
|
||||||
|
this.originalKeypoints2 = new MatOfKeyPoint();
|
||||||
|
this.keypoints2.copyTo(this.originalKeypoints2);
|
||||||
|
this.originalMatches1to2 = new MatOfDMatch();
|
||||||
|
this.matches1to2.copyTo(this.originalMatches1to2);
|
||||||
|
this.originalOutImg = new Mat();
|
||||||
|
this.outImg.copyTo(this.originalOutImg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return () -> Features2d.drawMatches(this.img1, this.keypoints1, this.img2, this.keypoints2, this.matches1to2, this.outImg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
return null;// drawMatches has no gpu counterpart
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return this.descr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
this.originalImg1.copyTo(this.img1);
|
||||||
|
this.originalKeypoints1.copyTo(this.keypoints1);
|
||||||
|
this.originalImg2.copyTo(this.img2);
|
||||||
|
this.originalKeypoints2.copyTo(this.keypoints2);
|
||||||
|
this.originalMatches1to2.copyTo(this.matches1to2);
|
||||||
|
this.originalOutImg.copyTo(this.outImg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
this.descr = "Features2d.drawMatches(" + this.img1 + ", " + this.keypoints1 + ", " + this.img2 + ", " + this.keypoints2 + ", " + this.matches1to2 + ", "
|
||||||
|
+ this.outImg + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+88
@@ -0,0 +1,88 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.general;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The task to download Mats
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class DownloadTask implements Task {
|
||||||
|
|
||||||
|
private final Mat mat;
|
||||||
|
|
||||||
|
private final Task task;
|
||||||
|
|
||||||
|
private final Mat originalMat;
|
||||||
|
|
||||||
|
public DownloadTask(Mat mat, Task task) {
|
||||||
|
this.mat = mat;
|
||||||
|
this.task = task;
|
||||||
|
this.originalMat = new Mat();
|
||||||
|
this.mat.copyTo(this.originalMat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
this.originalMat.copyTo(this.mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mat getMat() {
|
||||||
|
return this.mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task getTask() {
|
||||||
|
return this.task;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return () -> {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
return new GpuTask() {
|
||||||
|
|
||||||
|
private org.bytedeco.opencv.opencv_core.Mat jcvMat;
|
||||||
|
private GpuMat gpuMat;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
this.gpuMat.download(this.jcvMat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
this.jcvMat = new org.bytedeco.opencv.opencv_core.Mat();
|
||||||
|
this.gpuMat = new GpuMat();
|
||||||
|
MatConverter.copyMat(DownloadTask.this.mat, this.jcvMat);
|
||||||
|
this.gpuMat.upload(this.jcvMat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
this.gpuMat.close();
|
||||||
|
this.jcvMat.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return "Download of " + this.mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
// description is build in getDescription()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+57
@@ -0,0 +1,57 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.general;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatPool;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Some generic GPU task to delegate to the cpu implementation if no gpu
|
||||||
|
* implementation is present
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class GenericGpuTask implements GpuTask {
|
||||||
|
|
||||||
|
private Task task;
|
||||||
|
|
||||||
|
public GenericGpuTask(Task task) {
|
||||||
|
this.task = task;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
try {
|
||||||
|
Class<?> classType = this.task.getClass();
|
||||||
|
Field[] fields = classType.getDeclaredFields();
|
||||||
|
for (Field f : fields) {
|
||||||
|
f.setAccessible(true);
|
||||||
|
if (f.getType().equals(Mat.class)) {
|
||||||
|
Mat m = (Mat) f.get(this.task);
|
||||||
|
MatPool.download(m, this.task);
|
||||||
|
} else if (f.getType().isArray() && f.getType().getComponentType().equals(Mat.class)) {
|
||||||
|
Mat[] mats = (Mat[]) f.get(this.task);
|
||||||
|
for (Mat m : mats) {
|
||||||
|
MatPool.download(m, this.task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new IllegalStateException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
this.task.toCpuTask().run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
// No clean up needed
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+94
@@ -0,0 +1,94 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.general;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.global.opencv_core;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* a task testing the time of page-locked uploading
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class PagelockedUploadTask implements Task {
|
||||||
|
|
||||||
|
private final Mat mat;
|
||||||
|
|
||||||
|
private final Task task;
|
||||||
|
|
||||||
|
private final Mat originalMat;
|
||||||
|
|
||||||
|
public PagelockedUploadTask(Mat mat, Task task) {
|
||||||
|
this.mat = mat;
|
||||||
|
this.task = task;
|
||||||
|
this.originalMat = new Mat();
|
||||||
|
this.mat.copyTo(this.originalMat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
this.originalMat.copyTo(this.mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mat getMat() {
|
||||||
|
return this.mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task getTask() {
|
||||||
|
return this.task;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return () -> {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
return new GpuTask() {
|
||||||
|
|
||||||
|
private org.bytedeco.opencv.opencv_core.Mat jcvMat;
|
||||||
|
private GpuMat gpuMat;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
this.gpuMat.upload(this.jcvMat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
this.jcvMat = new org.bytedeco.opencv.opencv_core.Mat();
|
||||||
|
this.gpuMat = new GpuMat();
|
||||||
|
MatConverter.copyMat(PagelockedUploadTask.this.mat, this.jcvMat);
|
||||||
|
if (!this.jcvMat.empty()) {
|
||||||
|
opencv_core.registerPageLocked(this.jcvMat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
if (!this.jcvMat.empty()) {
|
||||||
|
opencv_core.unregisterPageLocked(this.jcvMat);
|
||||||
|
}
|
||||||
|
this.gpuMat.close();
|
||||||
|
this.jcvMat.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return "Page-locked upload of " + this.mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+64
@@ -0,0 +1,64 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.general;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* a task testing the pipeline of opencv functions
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class PipelineTask implements Task {
|
||||||
|
|
||||||
|
private final Runnable cpuPipeline;
|
||||||
|
|
||||||
|
private final Runnable gpuPipeline;
|
||||||
|
|
||||||
|
public PipelineTask(Runnable cpuPipeline, Runnable gpuPipeline) {
|
||||||
|
this.cpuPipeline = cpuPipeline;
|
||||||
|
this.gpuPipeline = gpuPipeline;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return this.cpuPipeline::run;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
return new GpuTask() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
PipelineTask.this.gpuPipeline.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
// nothing to init
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
// nothing to clean up
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return "Pipeline";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
// Nothing to reset
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
// no description for complete pipeline
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+87
@@ -0,0 +1,87 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.general;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* a task testing uploading of Mats
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class UploadTask implements Task {
|
||||||
|
|
||||||
|
private final Mat mat;
|
||||||
|
|
||||||
|
private final Task task;
|
||||||
|
|
||||||
|
private final Mat originalMat;
|
||||||
|
|
||||||
|
public UploadTask(Mat mat, Task task) {
|
||||||
|
this.mat = mat;
|
||||||
|
this.task = task;
|
||||||
|
this.originalMat = new Mat();
|
||||||
|
this.mat.copyTo(this.originalMat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
this.originalMat.copyTo(this.mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mat getMat() {
|
||||||
|
return this.mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task getTask() {
|
||||||
|
return this.task;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return () -> {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
return new GpuTask() {
|
||||||
|
|
||||||
|
private org.bytedeco.opencv.opencv_core.Mat jcvMat;
|
||||||
|
private GpuMat gpuMat;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
this.gpuMat.upload(this.jcvMat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
this.jcvMat = new org.bytedeco.opencv.opencv_core.Mat();
|
||||||
|
this.gpuMat = new GpuMat();
|
||||||
|
MatConverter.copyMat(UploadTask.this.mat, this.jcvMat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
this.gpuMat.close();
|
||||||
|
this.jcvMat.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return "Upload of " + this.mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+95
@@ -0,0 +1,95 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.imgproc;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudaimgproc;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_cudaimgproc.CannyEdgeDetector;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatPool;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the Imgproc.Canny function
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class Canny implements Task {
|
||||||
|
|
||||||
|
private final Mat image;
|
||||||
|
private final Mat edges;
|
||||||
|
private final double threshold1;
|
||||||
|
private final double threshold2;
|
||||||
|
|
||||||
|
private final Mat originalImage;
|
||||||
|
private final Mat originalEdges;
|
||||||
|
|
||||||
|
private String descr = "";
|
||||||
|
|
||||||
|
public Canny(Mat image, Mat edges, double threshold1, double threshold2) {
|
||||||
|
this.image = image;
|
||||||
|
this.edges = edges;
|
||||||
|
this.threshold1 = threshold1;
|
||||||
|
this.threshold2 = threshold2;
|
||||||
|
this.originalImage = new Mat();
|
||||||
|
this.originalEdges = new Mat();
|
||||||
|
this.image.copyTo(this.originalImage);
|
||||||
|
this.edges.copyTo(this.originalEdges);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return () -> Imgproc.Canny(this.image, this.edges, this.threshold1, this.threshold2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
return new GpuTask() {
|
||||||
|
|
||||||
|
private GpuMat gpuImage;
|
||||||
|
|
||||||
|
private GpuMat gpuEdges;
|
||||||
|
|
||||||
|
private CannyEdgeDetector detector;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
this.detector.detect(this.gpuImage, this.gpuEdges);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
this.gpuImage = MatPool.getUploadedGpuMat(Canny.this.image, Canny.this);
|
||||||
|
this.gpuEdges = MatPool.getUploadedGpuMat(Canny.this.edges, Canny.this);
|
||||||
|
this.detector = opencv_cudaimgproc.createCannyEdgeDetector(Canny.this.threshold1, Canny.this.threshold2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
this.detector.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return this.descr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
this.originalImage.copyTo(this.image);
|
||||||
|
this.originalEdges.copyTo(this.edges);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
this.descr = "Imgproc.Canny(" + Objects.toString(this.image) + ", " + Objects.toString(this.edges) + ", " + this.threshold1 + ", " + this.threshold2
|
||||||
|
+ ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+129
@@ -0,0 +1,129 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.imgproc;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudaimgproc;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatPool;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the Imgproc.cvtColor function
|
||||||
|
*
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class CvtColor implements Task {
|
||||||
|
|
||||||
|
private final int numParams;
|
||||||
|
|
||||||
|
private final Mat src;
|
||||||
|
|
||||||
|
private final Mat dst;
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
|
||||||
|
private final int dstCn;
|
||||||
|
|
||||||
|
private final Mat originalSrc;
|
||||||
|
|
||||||
|
private final Mat originalDst;
|
||||||
|
|
||||||
|
private String descr = "";
|
||||||
|
|
||||||
|
public CvtColor(Mat src, Mat dst, int code) {
|
||||||
|
this.src = src;
|
||||||
|
this.dst = dst;
|
||||||
|
this.code = code;
|
||||||
|
this.numParams = 3;
|
||||||
|
this.dstCn = 0;
|
||||||
|
this.originalSrc = new Mat();
|
||||||
|
this.originalDst = new Mat();
|
||||||
|
this.src.copyTo(this.originalSrc);
|
||||||
|
this.dst.copyTo(this.originalDst);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CvtColor(Mat src, Mat dst, int code, int dstCn) {
|
||||||
|
this.src = src;
|
||||||
|
this.dst = dst;
|
||||||
|
this.code = code;
|
||||||
|
this.dstCn = dstCn;
|
||||||
|
this.numParams = 4;
|
||||||
|
this.originalSrc = new Mat();
|
||||||
|
this.originalDst = new Mat();
|
||||||
|
this.src.copyTo(this.originalSrc);
|
||||||
|
this.dst.copyTo(this.originalDst);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return () -> {
|
||||||
|
if (CvtColor.this.numParams == 3) {
|
||||||
|
Imgproc.cvtColor(CvtColor.this.src, CvtColor.this.dst, CvtColor.this.code);
|
||||||
|
} else if (CvtColor.this.numParams == 4) {
|
||||||
|
Imgproc.cvtColor(CvtColor.this.src, CvtColor.this.dst, CvtColor.this.code, CvtColor.this.dstCn);
|
||||||
|
} else {
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
return new GpuTask() {
|
||||||
|
|
||||||
|
private GpuMat gpuSrc;
|
||||||
|
|
||||||
|
private GpuMat gpuDst;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (CvtColor.this.numParams == 3) {
|
||||||
|
opencv_cudaimgproc.cvtColor(this.gpuSrc, this.gpuDst, CvtColor.this.code);
|
||||||
|
} else if (CvtColor.this.numParams == 4) {
|
||||||
|
opencv_cudaimgproc.cvtColor(this.gpuSrc, this.gpuDst, CvtColor.this.code, CvtColor.this.dstCn, null);
|
||||||
|
} else {
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
this.gpuSrc = MatPool.getUploadedGpuMat(CvtColor.this.src, CvtColor.this);
|
||||||
|
this.gpuDst = MatPool.getUploadedGpuMat(CvtColor.this.dst, CvtColor.this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
// nothing to clean up
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return this.descr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
this.originalSrc.copyTo(this.src);
|
||||||
|
this.originalDst.copyTo(this.dst);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
if (this.numParams == 3) {
|
||||||
|
this.descr = "Imgproc.cvtColor(" + Objects.toString(this.src) + ", " + Objects.toString(this.dst) + ", " + this.code + ")";
|
||||||
|
} else if (this.numParams == 4) {
|
||||||
|
this.descr = "Imgproc.cvtColor(" + Objects.toString(this.src) + ", " + Objects.toString(this.dst) + ", " + this.code + ", " + this.dstCn + ")";
|
||||||
|
} else {
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+103
@@ -0,0 +1,103 @@
|
|||||||
|
package de.unidue.nes.gpu.testframework.internal.tasks.imgproc;
|
||||||
|
|
||||||
|
import org.bytedeco.opencv.global.opencv_cudafilters;
|
||||||
|
import org.bytedeco.opencv.global.opencv_imgproc;
|
||||||
|
import org.bytedeco.opencv.opencv_core.GpuMat;
|
||||||
|
import org.bytedeco.opencv.opencv_cudafilters.Filter;
|
||||||
|
import org.opencv.core.Mat;
|
||||||
|
import org.opencv.imgproc.Imgproc;
|
||||||
|
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatConverter;
|
||||||
|
import de.unidue.nes.gpu.testframework.internal.mathandling.MatPool;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.CpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.GpuTask;
|
||||||
|
import de.unidue.nes.gpu.testframework.tasks.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Roch P., Shahbaz Nejad B.
|
||||||
|
*/
|
||||||
|
public class Dilate implements Task {
|
||||||
|
|
||||||
|
private static final boolean GPU_ENABLED = true;
|
||||||
|
|
||||||
|
private final Mat src;
|
||||||
|
private final Mat dst;
|
||||||
|
private final Mat kernel;
|
||||||
|
|
||||||
|
private final Mat originalSrc;
|
||||||
|
private final Mat originalDst;
|
||||||
|
private final Mat originalKernel;
|
||||||
|
|
||||||
|
private String descr;
|
||||||
|
|
||||||
|
public Dilate(Mat src, Mat dst, Mat kernel) {
|
||||||
|
this.src = src;
|
||||||
|
this.dst = dst;
|
||||||
|
this.kernel = kernel;
|
||||||
|
|
||||||
|
this.originalSrc = new Mat();
|
||||||
|
this.originalDst = new Mat();
|
||||||
|
this.originalKernel = new Mat();
|
||||||
|
this.src.copyTo(this.originalSrc);
|
||||||
|
this.dst.copyTo(this.originalDst);
|
||||||
|
this.kernel.copyTo(this.originalKernel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CpuTask toCpuTask() {
|
||||||
|
return () -> Imgproc.dilate(this.src, this.dst, this.kernel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GpuTask toGpuTask() {
|
||||||
|
if (!GPU_ENABLED) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new GpuTask() {
|
||||||
|
|
||||||
|
private Filter filter;
|
||||||
|
|
||||||
|
private GpuMat gpusrc;
|
||||||
|
|
||||||
|
private GpuMat gpudst;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
this.filter.apply(this.gpusrc, this.gpudst);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
this.gpusrc = MatPool.getUploadedGpuMat(Dilate.this.src, Dilate.this);
|
||||||
|
this.gpudst = MatPool.getUploadedGpuMat(Dilate.this.dst, Dilate.this);
|
||||||
|
|
||||||
|
org.bytedeco.opencv.opencv_core.Mat javacvKernel = new org.bytedeco.opencv.opencv_core.Mat();
|
||||||
|
MatConverter.copyMat(Dilate.this.kernel, javacvKernel);
|
||||||
|
this.filter = opencv_cudafilters.createMorphologyFilter(opencv_imgproc.MORPH_DILATE, this.gpusrc.type(), javacvKernel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
this.filter.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return this.descr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
this.originalSrc.copyTo(this.src);
|
||||||
|
this.originalDst.copyTo(this.dst);
|
||||||
|
this.originalKernel.copyTo(this.kernel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDescription() {
|
||||||
|
this.descr = "Imgproc.dilate(" + this.src + ", " + this.dst + ", " + this.kernel + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user