Skip to content

Commit 4c08581

Browse files
committed
opencv_version
1 parent 79f593a commit 4c08581

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

samples/cpp/opencv_version.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ int main(int argc, const char* argv[])
2525
}
2626
else
2727
{
28-
std::cout << "OpenCV " << CV_VERSION << std::endl;
28+
std::cout << "Welcome to OpenCV " << CV_VERSION << std::endl;
2929
}
3030

3131
return 0;

samples/java/opencv_version.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import org.opencv.core.Core;
2+
3+
class opencv_version {
4+
5+
static { System.loadLibrary(Core.NATIVE_LIBRARY_NAME); }
6+
7+
public static void main(String[] args) {
8+
9+
if ((1==args.length) && (0==args[0].compareTo("--build"))) {
10+
11+
System.out.println(Core.getBuildInformation());
12+
} else
13+
if ((1==args.length) && (0==args[0].compareTo("--help"))) {
14+
15+
System.out.println("\t--build\n\t\tprint complete build info");
16+
System.out.println("\t--help\n\t\tprint this help");
17+
} else {
18+
19+
System.out.println("Welcome to OpenCV " + Core.VERSION);
20+
}
21+
}
22+
23+
}

samples/python2/opencv_version.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python
2+
3+
import cv2
4+
5+
if __name__ == '__main__':
6+
import sys
7+
try:
8+
param = sys.argv[1]
9+
except:
10+
param = ""
11+
12+
if ("--build" == param):
13+
print cv2.getBuildInformation()
14+
elif ("--help" == param):
15+
print "\t--build\n\t\tprint complete build info"
16+
print "\t--help\n\t\tprint this help"
17+
else:
18+
print "Welcome to OpenCV"

0 commit comments

Comments
 (0)