52
edits
Changes
→Assignment 1
The profiled project can be found on Github using this link:
[https://github.com/tatsy/ImageProcessing/tree/master/SeamCarving here]
Opencv setup instructions (linux):
Required : opencv, cmake, g++, make, gprof
1) sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
2) Downoad opencv version 2.4.13 [http://opencv.org/downloads.html here] and extract it
3) cd opencv-2.4.13
4) mkdir build
5) cd build
6) cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
7) make -j7
8) sudo make install
At this point we recomend you test to see if opencv is working correctly by following [http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.html this]
Build SeamCarving:
1) create "CMakeLists.txt"
cmake_minimum_required(VERSION 2.8)
project( SeamCarving )
find_package( OpenCV REQUIRED )
add_executable( SeamCarving main.cpp )
target_link_libraries( SeamCarving ${OpenCV_LIBS} )
2) cmake -DCMAKE_CXX_FLAGS=-pg -DCMAKE_EXE_LINKER_FLAGS=-pg -DCMAKE_SHARED_LINKER_FLAGS=-pg .
3) make
Note possible errors (if compiling from original source):
1) Error : "opencv2\opencv.hpp: No such file or directory #include <opencv2\opencv.hpp>"
Solution : Change '<opencv2\opencv.hpp>' to '<opencv2/opencv.hpp>'
2) Error : " 'printf' was not declared in this scope"
Solution : add "#include <stdio.h>"
4) ./SeamCarving <source_img>
5) gprof -p -b ./SeamCarving > SeamCarving.flt
Here is an example of a test case: