Information/Paper

[Paper] Performance comparative of OpenCV Template Matching method on Jetson TX2 and Jetson Nano developer kits

페트론 2020. 11. 23. 20:05

OpenCV Template Matching은 이미지의 유사도를 검사할 수 있는 방법이다. OpenCV에서는 다양한 인자들을 Template Mating에 사용할 수 있도록 하는데, 어떤 방법이 내 상황에 적절할지를 판단하는 것이 중요하다. 그러한 의미에서 해당 논문을 가져왔다.


Performance comparative of OpenCV Template Matching method on Jetson TX2 and Jetson Nano developer kits

 

Abstract

  • 템플릿 매칭은 디지털 이미지에서 객체 인식에 광범위하게 사용된다. 템플릿 매칭은 객체를 구분하기 위해 pixel-to-pixel 단위로 이미지의 intensity를 철저히 비교하기 때문에 높은 프로세스 파워가 필요한 작업이다.
  • 최근들어 NVIDIA Jetson family와 같은 높은 프로세스 파워를 제공하는 임베디드 시스템이 등장하고 있다.
  • 해당 작업은 실험을 통해 Jetson Nano 와 Jetson TX2 development kits 간의 성능을 비교하여, 템플릿 매칭을 수행하는 이미지 프로세싱 프로젝트에 적합한 시스템을 평가하는 것이다.
  • 실험은 템플릿 이미지에 대해 6 종류 2가지 크기의 경우의 수로 진행되었다.
  • CPU와 GPU를 사용한 연속적인 작업에 대한 프로세싱 시간은 정량적으로 측정되었다.
  • GPU를 사용한 병렬 작업의 경우 평균적으로 작업시간이 두배가량 걸리며 Jetson TX2가 Jetson Nano보다 작업속도가 빨랐다.

1. Introduction

  • 보류

2. Trmplate Matching

  • 일반적으로 템플릿 매칭 기법은 하나의 이미지에서 하나의 템플릿 이미지와 매칭되는 위치를 찾는 것이다. 이를 위한 두 가지 중요한 요소가 있다[30].
  1. 원본 이미지 (I) : 템플릿 이미지를 이용하여 객체를 찾기 위한 원본 이미지
  2. 템플릿 이미지 (T) : 원본 이미지의 넓은 공간 상에서 일치하는 지점을 찾기 위한 이미지 조각
  • 일치하는 공간을 찾기위해서 템플릿 이미지는 Fig 1 처럼 원본 이미지에서 슬라이딩 윈도우 형태로 비교되게 된다. 템플릿 이미지를 pixel-to-pixel 단위로 왼쪽에서 오른쪽으로 그리고 위에서 아래로 움직이게 되는 것이다.

  • 이미지 행렬은 해당 위치에서 템플릿 이미지가 원본 이미지와 얼마나 비슷한지를 알아내기 위해 픽셀 단위로 계산되게 된다.
  • 계산 결과는 결과 배열에 저장되게 된다.
  • OpenCV에는 이미지 유사도를 계산하기 위한 6가지 방법이 존재하며, 그 종류는 아래와 같다[30].
  1. TM_SQDIFF (Squared difference).
  2. TM_SQDIFF_NORMED (Normalized squared difference).
  3. TM_CCORR (Cross correlation).
  4. TM_CCORR_NORMED (Normalized cross correlation).
  5. TM_CCOEFF (Cosine coefficient).
  6. TM_CCOEFF_NORMED (Normalized cosine coefficient).

3. Materials and Methods

  • 템플릿 매칭을 위해 크기가 다른 6개의 이미지가 사용된다.
  • 메인 이미지는 Go Pro 7 카메라를 통해 얻은 4K resolution의 이미지이며, 나머지 이미지 들은 메인 이미지를 변형하여 만들었다. 
  • 템플릿 이미지는 각각 이미지에서 추출하여 만들었다.
  • 사용되는 템플릿 이미지의 사이즈는 두가지 경우에 대해 분석했다.
  1. 모든 경우에 대해 같은 크기의 템플릿 이미지.
  2. resolution의 증가에 비례해 증가하는 템플릿 이미지 크기.
  • 첫번째 경우에 대해서는, 50x50 픽셀의 고정된 템플릿 이미지를 사용하였다.
  • 두번째 경우에 대해서는, 다른 크기의 템플릿 이미지가 사용되었다.
  • 4K 이미지와 300x300 픽셀의 템플릿 이미지가 기본으로 사용되었고, 다른 템플릿 이미지들의 면적을 구하기 위한 계산 방법은 (1), (2)와 같으며, wtx, hwx, wix, hix가 계산에 사용되는 템플릿 이미지와 원본 이미지의 너비와 높이가 되고, wt4k, ht4k, wi4k, hi4k가 템플릿 이미지와 4k 원본 이미지의 면적이 된다.  

  • 테이블 1은 원본 이미지와 템플릿 이미지간의 관계와 면적을 나타낸다.

  • 6개의 템플릿 기법이 이미지 유사도 계산을 위해 모든 이미지에 대해 적용되었다.
  • Jetson Nano와 Jetson TX2 모두 최상의 상태로 작동하도록 설정하였고, 둘 다 jetson_clocks.sh script를 이용하여 CPU와 GPU의 클럭을 최고 주파수로 설정하였다. 테이블 2는 두 키트의 특성을 보여준다.

  • 두 키트 모두 C++ 언어를 사용하여 프로그래밍 되었다.

4. Results

  • 그림 2-7은 두 키트에서 각각 이미지에 대해 다른 템플릿 기법들을 적용하여 얻어낸 프로세스 시간을 나타낸다.
  • 각각 그림은 CPU와 GPU를 사용하여 얻어낸 프로세싱 시간을 포함한다.

5. Discussion

A. Equal template images

 

B. Variable dimension template images

 

6. Conclusions

 

 

 

 

 

 

 


0. www.semanticscholar.org/paper/Performance-comparative-of-OpenCV-Template-Matching-Basulto-Lantsova-Medina/d733924ac23eaaf1a7bcacb382c552de11e049e8

 

Performance comparative of OpenCV Template Matching method on Jetson TX2 and Jetson Nano developer kits | Semantic Scholar

Template Matching is a widely used method for object detection in digital images, it requires great processing power since it is an exhaustive method that compares the intensity levels of a source image pixel-to-pixel with a template image that contains th

www.semanticscholar.org

 

1.L. Barba-Guaman, C. Calderon-Cordova and P. A. Quezada-Sarmiento, "Detection of moving objects through color thresholding", Iberian Conference on Information Systems and Technologies CISTI, 2017.

 

2.S. Buoncompagni, D. Maio, D. Maltoni and S. Papi, "Saliency-based keypoint selection for fast object detection and matching", Pattern Recognition Letters, vol. 62, pp. 32-40, 2015.

 

3.S. Guennouni, A. Ahaitouf and A. Mansouri, "A comparative study of multiple object detection using haar-like feature selection and local binary patterns in several platforms", Modelling and Simulation in Engineering, vol. 2015, 2015.

 

4.R. Brunelli, Template matching techniques in computer vision: theory and practice, John Wiley & Sons, 2009.

 

5.G. Kertész, S. Szénási and Z. Vámossy, "Performance Measurement of a General Multi-Scale Template Matching Method", IEEE 19th International Conference on Intelligent Engineering Systems, pp. 153-157, 2015.

 

6.B. Yan, L. Xiao, H. Zhang, D. Xu, L. Ruan, Z. Wang, et al., "An adaptive template matching-based single object tracking algorithm with parallel acceleration", Journal of Visual Communication and Image Representation, vol. 64, pp. 102603, 2019.

 

7.S.-H. Kim, S.-H. Song, J.-H. Kim, Z. Yuan and J.-D. Cho, Fast Rotation-Invariant Template Matching with Candidate Reduction Using CUDA, no. 1, pp. 1-2, 2015.

 

8.F. Mendez, M. Ferguson and S. Tancock, Real-Time User Selected Dynamic Template Tracking For UAV, no. section VI, 2017.

 

9.NVIDIA Jetson, 2019, [online] Available: https://developer.nvidia.com/embedded/develop/hardware.

 

10.Autonomous machines, 2019, [online] Available: https://www.nvidia.com/es-la/autonomous-machines/embedded-systems/.

 

11.N. Cooper, E. Lindsey, R. Chapman and S. Biaz, "GPU Based Monocular Vision for Obstacle Detection", CSSE17–08, pp. 1-14, 2017.

 

12.A. Shustanov and P. Yakimov, "A method for traffic sign recognition with CNN using GPU", ICETE 2017 - Proceedings of the 14th International Joint Conference on e-Business and Telecommunications, vol. 5, no. Icete, pp. 42-47, 2017.

 

13.N. Otterness, M. Yang, S. Rust, E. Park, J. H. Anderson, F. D. Smith, et al., "An Evaluation of the NVIDIA TX1 for Supporting Real-time Computer-Vision Workloads", 2017 IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS), pp. 355-365, 2017.

 

14.A. Elkaseer, M. Salama, S. Scholz, A. Elkaseer, H. Ali, M. Salama, et al., "Approaches to a Practical Implementation of Industry 4.0", The Eleventh International Conference on Advances in Computer-Human Interactions, no. March, pp. 141-146, 2018.

 

15.W. J. Chang, L. B. Chen, C. H. Hsu, C. P. Lin and T. C. Yang, "A Deep Learning-Based Intelligent Medicine Recognition System for Chronic Patients", IEEE Access, vol. 7, no. c, pp. 44441-44458, 2019.

 

16.J. Sancho Aragón, "Energy and Performance Modeling of NVIDIA Jetson TX1 Embedded GPU in Hyperspectral Image Classification Tasks for Cancer detection Using Machine Learning", Escuela Técnica Superior de Ingeniería y Sistemas de Telecomunicación, 2018.

 

17.J. Tang, Y. Ren and S. Liu, Real-Time Robot Localization Vision and Speech Recognition on Nvidia Jetson TX1, 2017, [online] Available: http://arxiv.org/abs/1705.10945.

 

18.Y. Wu, L. Gao, B. Zhang, B. Yang and Z. Chen, "Embedded GPU implementation of anomaly detection for hyperspectral images", High-Performance Computing in Remote Sensing V, vol. 9646, pp. 964608, 2015.

 

19.H. Xing, S. Guo, L. Shi, X. Hou, Y. Liu, Y. Hu, et al., "Quadrotor Vision-based Localization for Amphibious Robots in Amphibious Area", 2019 IEEE International Conference on Mechatronics and Automation (ICMA), pp. 2469-2474, 2019.

 

20.OpenCV, 2019, [online] Available: https://opencv.org/about/.

 

21.N. Boyko, O. Basystiuk and N. Shakhovska, "Performance Evaluation and Comparison of Software for Face Recognition Based on Dlib and Opencv Library", Proceedings of the 2018 IEEE 2nd International Conference on Data Stream Mining and Processing DSMP 2018, pp. 478-482, 2018.

 

22.T. Epanchintsev and A. Sozykin, "Processing large amounts of images on hadoop with OpenCV", CEUR Workshop Proceedings, vol. 1513, pp. 137-143, 2015.

 

23.Y.-J. Ha and H.-D. Kang, Evaluation of feature based image stitching algorithm using OpenCV, pp. 224-229, 2017.

 

24.S. Saxena, S. Sharma and N. Sharma, "Parallel Image Processing Techniques Benefits and Limitations", Research Journal of Applied Sciences Engineering and Technology, vol. 12, no. 2, pp. 223-238, 2016.

 

25.B. Hang and Ö. Eyecioğlu, "Performance Comparison Between OpenCV Built in CPU and GPU Functions on Image Processing Operations", International Journal of Engineering Science and Application, vol. 1, no. 2, pp. 34-41, 2017.

 

26.C. Zhu, Indoor positioning and tracking based on OpenCV, 2017.

 

27.G. Kertesz, S. Szenasi and Z. Vamossy, "Parallelization methods of the template matching method on graphics accelerators", CINTI 2015 — 16th IEEE International Symposium on Computational Intelligence and Informatics Proceedings, pp. 161-164, 2015.

 

28.Harness AI at the Edge with the Jetson TX2 Developer Kit, 2019, [online] Available: https://developer.nvidia.com/embedded/jetson-tx2-developer-kit.

 

29.Jetson Nano Developer Kit, 2019, [online] Available: https://developer.nvidia.com/embedded/jetson-nano-developer-kit.

 

30.OpenCV: Template Matching, 2019, [online] Available: https://docs.opencv.org/3.4.6/de/da9/tutorial_template_matching.html.

 

반응형