Skip to content
Snippets Groups Projects
Commit 6e605fc1 authored by Prakalp Srivastava's avatar Prakalp Srivastava
Browse files

demo ready

parent 08bab65a
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <visc.h> #include <visc.h>
#define NUM_RUNS 5 #define NUM_RUNS 100
#define DEPTH 3 #define DEPTH 3
#define HEIGHT 640 #define HEIGHT 640
#define WIDTH 480 #define WIDTH 480
...@@ -875,6 +875,12 @@ int main (int argc, char *argv[]) { ...@@ -875,6 +875,12 @@ int main (int argc, char *argv[]) {
int NUM_FRAMES = cap.get(CV_CAP_PROP_FRAME_COUNT); int NUM_FRAMES = cap.get(CV_CAP_PROP_FRAME_COUNT);
//NUM_FRAMES = 5; //NUM_FRAMES = 5;
std::cout << "Number of frames = " << NUM_FRAMES << "\n"; std::cout << "Number of frames = " << NUM_FRAMES << "\n";
// Used to store time after each frame computation is completed
//timeval *timeStamps = (timeval *)malloc(NUM_RUNS*NUM_FRAMES*sizeof(timeval));
//struct timeval tv_start;
//unsigned long cnt = 0; // Counter, for the video frames
namedWindow(input_window, CV_WINDOW_AUTOSIZE); namedWindow(input_window, CV_WINDOW_AUTOSIZE);
namedWindow(output_window, CV_WINDOW_AUTOSIZE); namedWindow(output_window, CV_WINDOW_AUTOSIZE);
moveWindow(input_window, POSX_IN, POSY_IN); moveWindow(input_window, POSX_IN, POSY_IN);
...@@ -942,12 +948,12 @@ int main (int argc, char *argv[]) { ...@@ -942,12 +948,12 @@ int main (int argc, char *argv[]) {
//pb_SwitchToTimer( &timers, pb_TimerID_COMPUTE ); //pb_SwitchToTimer( &timers, pb_TimerID_COMPUTE );
//showInOut(src, E); //showInOut(src, E);
//Mat in, out; Mat in, out;
//resize(src, in, Size(HEIGHT, WIDTH)); resize(src, in, Size(HEIGHT, WIDTH));
//resize(E, out, Size(HEIGHT, WIDTH)); resize(E, out, Size(HEIGHT, WIDTH));
//imshow(input_window, in); imshow(input_window, in);
//imshow(output_window, out); imshow(output_window, out);
//waitKey(0); waitKey(0);
//NUM_FRAMES = 20; //NUM_FRAMES = 20;
pb_SwitchToTimer( &timers, visc_TimerID_COMPUTATION ); pb_SwitchToTimer( &timers, visc_TimerID_COMPUTATION );
...@@ -972,6 +978,10 @@ int main (int argc, char *argv[]) { ...@@ -972,6 +978,10 @@ int main (int argc, char *argv[]) {
//imshow(input_window, src); //imshow(input_window, src);
//imshow(output_window, E); //imshow(output_window, E);
//waitKey(0); //waitKey(0);
// Get the time just before computation starts
//gettimeofday(&tv_start,NULL);
for(unsigned j=0; j<NUM_RUNS; j++) { for(unsigned j=0; j<NUM_RUNS; j++) {
std::cout << "Run: " << j << "\n"; std::cout << "Run: " << j << "\n";
void* DFG = __visc__launch(1, edgeDetection, (void*)args); void* DFG = __visc__launch(1, edgeDetection, (void*)args);
...@@ -1023,14 +1033,16 @@ int main (int argc, char *argv[]) { ...@@ -1023,14 +1033,16 @@ int main (int argc, char *argv[]) {
//std::cout << "G.data = " << (float*)G.data << "\n"; //std::cout << "G.data = " << (float*)G.data << "\n";
//std::cout << "E.data = " << (float*)E.data << "\n"; //std::cout << "E.data = " << (float*)E.data << "\n";
//std::cout << "Max G = " << *maxG << "\n"; //std::cout << "Max G = " << *maxG << "\n";
//Mat in, out; //gettimeofday(&timeStamps[cnt], NULL);
//resize(src, in, Size(HEIGHT, WIDTH)); //cnt++;
Mat in, out;
resize(src, in, Size(HEIGHT, WIDTH));
//std::cout << "Show E\n"; //std::cout << "Show E\n";
//resize(E, out, Size(HEIGHT, WIDTH)); resize(E, out, Size(HEIGHT, WIDTH));
//imshow(output_window, out); imshow(output_window, out);
//imshow(input_window, in); imshow(input_window, in);
//waitKey(1); waitKey(1);
//waitKey(0); //waitKey(0);
//std::cout << "Show Is\n"; //std::cout << "Show Is\n";
//resize(Is, out, Size(HEIGHT, WIDTH)); //resize(Is, out, Size(HEIGHT, WIDTH));
...@@ -1080,6 +1092,20 @@ int main (int argc, char *argv[]) { ...@@ -1080,6 +1092,20 @@ int main (int argc, char *argv[]) {
pb_PrintTimerSet(&timers); pb_PrintTimerSet(&timers);
//const char *fn = "timestamps.txt";
//std::ofstream outfile;
//outfile.open(fn);
//if (!outfile.is_open()) {
//std::cout << "Failed to open " << fn << " for writing\n";
//}
//for (unsigned long i = 0; i < cnt; i++) {
//double elapsed = (timeStamps[i].tv_sec - tv_start.tv_sec) +
//((timeStamps[i].tv_usec - tv_start.tv_usec)/1000000.0);
//outfile << elapsed << "\n";
//}
//free(timeStamps);
//outfile.close();
__visc__cleanup(); __visc__cleanup();
//if (params->outFile) { //if (params->outFile) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment