Open main menu

CDOT Wiki β

Changes

The parallelizing Express

3,219 bytes added, 22:22, 17 February 2017
Assignment 1
0.00 7.43 0.00 347184 0.00 0.00 update_stack(Board*)
0.00 7.43 0.00 24 0.00 0.00 std::__deque_buf_size(unsigned long)
 
 
----
 
=== '''ColorTransfer''' ===
 
The Source code can be found [https://github.com/tatsy/ImageProcessing/tree/master/ColorTransfer here]
This program is an implementation of image color transfer detailed by Erik Reinhard and coded by [https://github.com/tatsy Tatsy]
This program takes 2 images the first image denoted by the args is the image taking in colours.
The second image is an image that the program will use to edit the first image using the colours found.
 
 
==== '''Creating and Running the Project with gprof profiling''' ====
 
 
Perform the following steps in a Linux/Unix System:
 
STEP 1 - Download the following zip and extracts its contents
-> Link:
STEP 2 - Install all the required entries(make,cmake,git,gprof,etc) with the following terminal command:
-> sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev binutils
STEP 3 - Download and Install OpenCV from their official page located [http://opencv.org/ here]. You can do this with the following steps and commands:
-> Download the latest source data of [http://opencv.org/ OpenCV] for Linux/Mac
-> Extract the zipped source data into its appropriately named folder opencv-(latest version)
-> Open terminal and enter us the cd command to enter the extracted folder opencv-(latest version)
-> Create a build directy with the command mkdir build
-> Use the cd command to enter the build folder
-> Use the following cmake command to generate the appropriate files for the make command: cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
-> Use make with the -j7 command to allow for up to 7 jobs when preparing the install: make -j7
-> Install with: sudo make install
-> OpenCV should be installed
STEP 4 - Use the Test Folder provided by the dropbox link above to see if OpenCV is working correctly. You can follow these steps to do so
-> In terminal cd into the test folder
-> cmake .
-> make
-> run display image with the follow command ./DisplayImage ahri.jpg
-> If the image provided is displayed OpenCV should be in working order.
STEP 5 - Build the ColorTransfer program with the folder provided by the dropbox link and create a flat profile using gprof
-> Create the files for make using the following command: cmake -DCMAKE_CXX_FLAGS=-pg -DCMAKE_EXE_LINKER_FLAGS=-pg -DCMAKE_SHARED_LINKER_FLAGS=-pg .
-> The additional options include -pg within the cmake so that the appropriate gmon.out can be created for gprof
-> After the files are generated use the make command
-> Run the created program with 2 arguments arg1 being the image beind editted and arg2 being the image to take colours from (two images are provided for your convenience).
-> If using the provided image the command should like: ./ColorTransfer ahri.jpg ahri2.jpg
-> This should generate the colour transferred output image as well as the appropriate gmon.out file
-> Use the either of the following commands for the flat profile: gprof -p -b ./ColorTransfer > ColorTransfer.flt OR gprof test_gprof gmon.out > analysis.txt
 
 
==== '''Example Output''' ====
 
If using the examples provided you should have the following image results:
 
 
==== '''Profile''' ====
49
edits