gitNavV / rgbTogrey

A C++ implementation of GPU accelerated Image Processing for conversion of any color image into its greyscale version.

Home Page:https://gitnavv.github.io/rgbTogrey/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rgbTogrey

A C++ implementation of GPU accelerated conversion of any color image into its greyscale version.

Building on OS X

These instructions are for OS X 10.9 "Mavericks".

  • Step 1. Build and install OpenCV. The best way to do this is with Homebrew. However, you must slightly alter the Homebrew OpenCV installation; you must build it with libstdc++ (instead of the default libc++) so that it will properly link against the nVidia CUDA dev kit.

  • Step 2. You can now create 10.9-compatible makefiles, which will allow you to build and run your homework on your own machine:

mkdir build
cd build
cmake ..
make

Instruction for make :

NVCC = nvcc

These are the default install

locations on most linux distros

OPENCV_LIBPATH = /usr/lib
OPENCV_INCLUDEPATH = /usr/include

On Macs the default install locations are below

OPENCV_LIBPATH = /usr/local/lib
OPENCV_INCLUDEPATH = /usr/local/include

or if using MacPorts

OPENCV_LIBPATH = /opt/local/lib
OPENCV_INCLUDEPATH = /opt/local/include

OPENCV_LIBS = -lopencv_core -lopencv_imgproc -lopencv_highgui

CUDA_INCLUDEPATH = /usr/local/cuda-5.0/include

On Macs the default install locations are below

CUDA_INCLUDEPATH = /usr/local/cuda/include
CUDA_LIBPATH = /usr/local/cuda/lib

NVCC_OPTS = -O3 -arch=sm_20 -Xcompiler -Wall -Xcompiler -Wextra -m64

GCC_OPTS = -O3 -Wall -Wextra -m64

student: main.o student_func.o compare.o reference_calc.o Makefile
$(NVCC) -o HW1 main.o student_func.o compare.o reference_calc.o -L $(OPENCV_LIBPATH) $(OPENCV_LIBS) $(NVCC_OPTS)

main.o: main.cpp timer.h utils.h reference_calc.cpp compare.cpp HW1.cpp
g++ -c main.cpp $(GCC_OPTS) -I $(CUDA_INCLUDEPATH) -I $(OPENCV_INCLUDEPATH)

student_func.o: student_func.cu utils.h
nvcc -c student_func.cu $(NVCC_OPTS)

compare.o: compare.cpp compare.h
g++ -c compare.cpp -I $(OPENCV_INCLUDEPATH) $(GCC_OPTS) -I $(CUDA_INCLUDEPATH)

reference_calc.o: reference_calc.cpp reference_calc.h
g++ -c reference_calc.cpp -I $(OPENCV_INCLUDEPATH) $(GCC_OPTS) -I $(CUDA_INCLUDEPATH)

clean:
rm -f *.o *.png hw

About

A C++ implementation of GPU accelerated Image Processing for conversion of any color image into its greyscale version.

https://gitnavv.github.io/rgbTogrey/

License:MIT License


Languages

Language:C++ 59.8%Language:Cuda 38.6%Language:C 1.6%