Open main menu

CDOT Wiki β

Changes

GPU610/Turing

1,196 bytes added, 21:06, 13 October 2015
Progress
=== James's Research ===I
An image processing code was found here: http://www.dreamincode.net/forums/topic/76816-image-processing-tutorial/
This program takes in an image and processes in various ways. I chose to look at the reflection function (flipping) by editing the code to omit the other sections. Below are the results from profiling where n is the size of the image in files.
n
writeImage(char*, Image&)
readImage(char*, Image&)
Image::reflectImage(bool, Image&)
Image::Image(int, int, int)
Image::operator=(Image const&)
Image::Image(Image const&)
Elapsed Time
 
10077713
0.01
0.01
0.02
0.01
0.01
0.07
0.11
 
25435697
0.02
0.02
0.03
0.05
0.05
0.09
0.26
 
117430458
0.13
0.1
0.15
0.18
0.2
0.6
1.36
What takes the longest running function is the function that copies the old image into the new output image. Below is the code for the function.
 
Image::Image(const Image& oldImage)
/*copies oldImage into new Image object*/
{
N = oldImage.N;
M = oldImage.M;
Q = oldImage.Q;
pixelVal = new int* [N];
for(int i = 0; i < N; i++)
{
pixelVal[i] = new int [M];
for(int j = 0; j < M; j++)
pixelVal[i][j] = oldImage.pixelVal[i][j];
}
}
=== Assignment 2 ===
=== Assignment 3 ===
1
edit