source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/SURF-V1.0.8/os_mapping.cpp @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 1.6 KB
Line 
1/*
2 * Speeded-Up Robust Features (SURF)
3 * http://people.ee.ethz.ch/~surf
4 *
5 * Authors: Herbert Bay, Andreas Ess, Geert Willems
6 * Windows port by Stefan Saur
7 *
8 * Copyright (2006): ETH Zurich, Switzerland
9 * Katholieke Universiteit Leuven, Belgium
10 * All rights reserved.
11 *
12 * For details, see the paper:
13 * Herbert Bay,  Tinne Tuytelaars,  Luc Van Gool,
14 *  "SURF: Speeded Up Robust Features"
15 * Proceedings of the ninth European Conference on Computer Vision, May 2006
16 *
17 * Permission to use, copy, modify, and distribute this software and
18 * its documentation for educational, research, and non-commercial
19 * purposes, without fee and without a signed licensing agreement, is
20 * hereby granted, provided that the above copyright notice and this
21 * paragraph appear in all copies modifications, and distributions.
22 *
23 * Any commercial use or any redistribution of this software
24 * requires a license from one of the above mentioned establishments.
25 *
26 * For further details, contact Andreas Ess (aess@vision.ee.ethz.ch).
27 */
28
29#ifdef WIN32
30#include <windows.h>
31#include <process.h>
32#else
33#include <pthread.h>
34#endif
35
36#include "os_mapping.h"
37
38namespace osmapping {
39
40        void os_GetTime(os_TIME *time) { 
41        #ifdef WIN32   
42                *time = GetTickCount();
43        #else
44                struct timezone tz;
45                gettimeofday(time, &tz);
46        #endif
47        }
48
49        int os_TimeDiff(os_TIME *time1, os_TIME *time2) { 
50        #ifdef WIN32   
51                return *time1 - *time2;
52        #else
53                return (int)((double)time1->tv_sec*1000 + ((double)time1->tv_usec)*1e-3 -
54                        (double)time2->tv_sec*1000 - ((double)time2->tv_usec)*1e-3);
55        #endif
56        }
57}
58
Note: See TracBrowser for help on using the repository browser.