项目作者: qa276390

项目描述 :
A CUDA-acclerated Harris Corner Detector
高级语言: Cuda
项目地址: git://github.com/qa276390/Cuda-Harris-Corner-Detector.git
创建时间: 2020-06-16T09:21:45Z
项目社区:https://github.com/qa276390/Cuda-Harris-Corner-Detector

开源协议:

下载


CUDA-Harris-Corner-Detector

This project is a CUDA-acclerated Harris Corner Detector based on Corner-Detector.
We implemented the project using C/C++ with i7-7700 and RTX 2080Ti.

Usage

Folder and Data

Here is the directory tree structure for the project.

  1. ├── input
  2. └── image.ppm // input images(should be ppm format)
  3. ├── Makefile
  4. ├── output
  5. └── ... // output images
  6. ├── README.md
  7. └── source
  8. ├── CornerDetector.cu // main part of the project
  9. ├── GaussFilter.cuh // CUDA header file of gaussian filter
  10. ├── Gauss.h // header file of gaussian filter
  11. ├── Matrix.h // header file of class Matrix
  12. ├── PPM.h // header file to deal with portable pixmap format (PPM) image
  13. ├── SobelFilter.cuh // CUDA header file of sobel filter
  14. ├── Sobel.h // header file of sobel filter
  15. ├── utils.h // other utilities
  16. └── VectorOperation.cuh // CUDA header file of vector operation

Prepare Images

Put your images into the ./input folder. Please note that the image must be .ppm format. With linux you can convert the image format using

  1. convert image.jpg image.ppm

Start

here is an example to run the code.

Compilation

you can just use make command, or

  1. nvcc CornerDetector.cu -o CornerDetector

Execution

There are four parameter to assign.

  1. ./CornerDetector <imagePath> <gaussMask=size> <tpb=threadsPerBlock> <sigma=doubleValue>

example

  1. ./CornerDetector ./input/IMG_0125.ppm

Results

To compare the perfomance between CPU and GPU, we perform our Harris Corner Detector on a image of size 3648x5472, and the comparison results shown in Table 1. We could see that the GPU version is much faster the CPU version.

CPU GPU-Shared-Memory GPU-Dynamic-Shared-Memory
Running Time 17.378s 0.246s 0.247s
Difference - 0 0

The output image shown below. The red spot are Harris Corner Response.







Result from IMG_0125.ppm

Result from IMG_4486.ppm

Reference