Open main menu

CDOT Wiki β

Changes

Unique Project Page

64 bytes removed, 01:57, 26 February 2017
Introduction : GPU Benchmarking/Gaussian Blur Filter : Colin Paul
speed versus quality.
===Running program=======Windows====To compile and run the program:# Set-up an empty Visual C++ - Visual Studio project.# Save [http://matrix.senecac.on.ca/~cpaul12/cinque_terre.bmp this] image and place it in your projects directory.# Copy the source code below and paste it into a [your chosen file name].cpp file.# Go into you Debug properties of your project.# Add four (4) values into the Debugging -> Command Arguments: [input image filename].bmp [output image filename].bmp [x - sigma value] [y - sigmea value] => cinque_terre.bmp cinque_terre_BLURRED.bmp 3.0 3.0====Linux====To compile and run the program:# Navigate to the directory you want to run the program in.# Save [http://matrix.senecac.on.ca/~cpaul12/cinque_terre.bmp this] image and place it directory you will be running the program from. # Copy the main source code below and paste it into a [your chosen file name].cpp file.# Copy the header source code below and paste it into a file name windows.h.Compile the binaries using the following command: g++ -O2 -std=c++0x -Wall -pedantic gaussian.cpp -o blurRun the compiled prigram ./blur cinque_terre.bmp cinque_terre_BLURRED.bmp 3.0 3.0The command line arguments are structured as follows: [input image filename].bmp [output image filename].bmp [x - sigma value] [y - sigmea value]====Code====
Original source code (Windows) can be found [http://blog.demofox.org/2015/08/19/gaussian-blur/ here].
{| class="wikitable mw-collapsible mw-collapsed"
#include <vector>
#include <functional>
#include <windows.h> // for bitmap headers. Sorry non windows people!
const float c_pi = 3.14159265359f;
#include <vector>
#include <functional>
#include "windows.h" // for bitmap headers. Sorry non windows people!
/* uncomment the line below if you want to run grpof */
|}
<h3===Running program=======Windows====To compile and run the program:# Set-up an empty Visual C++ - Visual Studio project.# Save [http://matrix.senecac.on.ca/~cpaul12/cinque_terre.bmp this] image and place it in your projects directory.# Copy the source code below and paste it into a [your chosen file name].cpp file.# Go into you Debug properties of your project.# Add four (4) values into the Debugging ->Command Arguments: [input image filename].bmp [output image filename].bmp [x - sigma value] [y - sigmea value] => cinque_terre.bmp cinque_terre_BLURRED.bmp 3.0 3.0====Linux====To compile and run the program:# Navigate to the directory you want to run the program in.# Save [http://matrix.senecac.on.ca/~cpaul12/cinque_terre.bmp this] image and place it directory you will be running the program from. # Copy the main source code below and paste it into a [your chosen file name].cpp file.# Copy the header source code below and paste it into a file name windows.h.Compile the binaries using the following command: g++ -O2 -std=c++0x -Wall -pedantic gaussian.cpp -o blurRun the compiled prigram ./blur cinque_terre.bmp cinque_terre_BLURRED.bmp 3.0 3.0The command line arguments are structured as follows: [input image filename].bmp [output image filename].bmp [x - sigma value] [y - sigmea value]===Analysis</h3>===
Flat profile:
The program does not take a long time to run, but run-time depends on the values of sigma (&sigma;) and the kernel block size. If you specify larger values for these parameters the runtime increases<br/>
significantly. The code is straight forward and parallelization should also be easy to implement.
=== Hotspot ===
147
edits