Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
09a7a404
Commit
09a7a404
authored
Jun 03, 2011
by
Kirill Kornyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The samples were updated corresponding a single standart for <help>
parent
262fc330
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
80 additions
and
58 deletions
+80
-58
convert_cascade.c
samples/c/convert_cascade.c
+10
-2
delaunay.c
samples/c/delaunay.c
+2
-2
fback_c.c
samples/c/fback_c.c
+3
-3
find_obj.cpp
samples/c/find_obj.cpp
+5
-3
find_obj_ferns.cpp
samples/c/find_obj_ferns.cpp
+4
-2
latentsvmdetect.cpp
samples/c/latentsvmdetect.cpp
+4
-2
morphology.c
samples/c/morphology.c
+16
-8
motempl.c
samples/c/motempl.c
+3
-1
mser_sample.cpp
samples/c/mser_sample.cpp
+3
-1
mushroom.cpp
samples/c/mushroom.cpp
+16
-14
polar_transforms.c
samples/c/polar_transforms.c
+4
-2
pyramid_segmentation.c
samples/c/pyramid_segmentation.c
+10
-18
No files found.
samples/c/convert_cascade.c
View file @
09a7a404
...
@@ -6,8 +6,14 @@
...
@@ -6,8 +6,14 @@
void
help
()
void
help
()
{
{
printf
(
"Usage:
\n
"
""
printf
(
"
\n
This sample demonstrates cascade's convertation
\n
"
"./convert_cascade --size=
\"
<width>x<height>
\"
input_cascade_path output_cascade_filename
\n
"
);
"Usage:
\n
"
"./convert_cascade --size=
\"
<width>x<height>
\"
<convertation size>
\n
"
" input_cascade_path
\n
"
" output_cascade_filename
\n
"
"Example:
\n
"
"./convert_cascade --size=640x480 ../../opencv/data/haarcascades/haarcascade_eye.xml ../../opencv/data/haarcascades/test_cascade.xml
\n
"
);
}
}
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
...
@@ -17,6 +23,8 @@ int main( int argc, char** argv )
...
@@ -17,6 +23,8 @@ int main( int argc, char** argv )
CvHaarClassifierCascade
*
cascade
=
0
;
CvHaarClassifierCascade
*
cascade
=
0
;
CvSize
size
;
CvSize
size
;
help
();
if
(
argc
!=
4
||
strncmp
(
argv
[
1
],
size_opt
,
strlen
(
size_opt
)
)
!=
0
)
if
(
argc
!=
4
||
strncmp
(
argv
[
1
],
size_opt
,
strlen
(
size_opt
)
)
!=
0
)
{
{
help
();
help
();
...
...
samples/c/delaunay.c
View file @
09a7a404
...
@@ -7,8 +7,8 @@ void help()
...
@@ -7,8 +7,8 @@ void help()
printf
(
"
\n
This program demostrates iterative construction of
\n
"
printf
(
"
\n
This program demostrates iterative construction of
\n
"
"delaunay triangulation and voronoi tesselation.
\n
"
"delaunay triangulation and voronoi tesselation.
\n
"
"It draws a random set of points in an image and then delaunay triangulates them.
\n
"
"It draws a random set of points in an image and then delaunay triangulates them.
\n
"
"Call:
\n
"
"Usage:
\n
"
"./delaunay
\n
"
"./delaunay
\n
"
"
\n
This program builds the traingulation interactively, you may stop this process by
\n
"
"
\n
This program builds the traingulation interactively, you may stop this process by
\n
"
"hitting any key.
\n
"
);
"hitting any key.
\n
"
);
}
}
...
...
samples/c/fback_c.c
View file @
09a7a404
...
@@ -4,10 +4,10 @@
...
@@ -4,10 +4,10 @@
void
help
()
void
help
()
{
{
printf
(
printf
(
"
This program demonstrate dense
\"
Farneback
\n
optical flow
\n
"
"
\n
This program demonstrate dense
\"
Farneback
\n
optical flow
\n
"
"It read from camera 0, and shows how to use and display dense Franeback optical flow
\n
"
"It read from camera 0, and shows how to use and display dense Franeback optical flow
\n
"
"Call:
\n
"
"Usage:
\n
"
"./fback_c
\n
\n
"
);
"./fback_c
\n
"
);
}
}
void
drawOptFlowMap
(
const
CvMat
*
flow
,
CvMat
*
cflowmap
,
int
step
,
void
drawOptFlowMap
(
const
CvMat
*
flow
,
CvMat
*
cflowmap
,
int
step
,
...
...
samples/c/find_obj.cpp
View file @
09a7a404
...
@@ -19,12 +19,14 @@ using namespace cv;
...
@@ -19,12 +19,14 @@ using namespace cv;
void
help
()
void
help
()
{
{
printf
(
"This program demonstrated the use of the SURF Detector and Descriptor using
\n
"
printf
(
"
\n
This program demonstrated the use of the SURF Detector and Descriptor using
\n
"
"either FLANN (fast approx nearst neighbor classification) or brute force matching
\n
"
"either FLANN (fast approx nearst neighbor classification) or brute force matching
\n
"
"on planar objects.
\n
"
"on planar objects.
\n
"
"Usage
:
\n
"
"Usage
:
\n
"
"./find_obj [--object_filename]=<object_filename, box.png as default>
\n
"
"./find_obj [--object_filename]=<object_filename, box.png as default>
\n
"
" [--scene_filename]=<scene_filename box_in_scene.png as default>]
\n\n
"
" [--scene_filename]=<scene_filename box_in_scene.png as default>]
\n
"
"Example:
\n
"
"./find_obj --object_filename =box.png --scene_filename = box_in_scene.png
\n\n
"
);
);
}
}
...
...
samples/c/find_obj_ferns.cpp
View file @
09a7a404
...
@@ -14,9 +14,11 @@ void help()
...
@@ -14,9 +14,11 @@ void help()
{
{
printf
(
"This program shows the use of the
\"
fern
\"
plannar PlanarObjectDetector point
\n
"
printf
(
"This program shows the use of the
\"
fern
\"
plannar PlanarObjectDetector point
\n
"
"descriptor classifier"
"descriptor classifier"
"Usage:
\n
"
"Usage:
\n
"
"./find_obj_ferns [--object_filename]=<object_filename, box.png as default>
\n
"
"./find_obj_ferns [--object_filename]=<object_filename, box.png as default>
\n
"
" [--scene_filename]=<scene_filename box_in_scene.png as default>]
\n
"
);
" [--scene_filename]=<scene_filename box_in_scene.png as default>]
\n
"
"Example:
\n
"
"./find_obj_ferns --object_filename=box.png --scene_filename=box_in_scene.png
\n
"
);
}
}
int
main
(
int
argc
,
const
char
**
argv
)
int
main
(
int
argc
,
const
char
**
argv
)
...
...
samples/c/latentsvmdetect.cpp
View file @
09a7a404
...
@@ -19,8 +19,10 @@ void help()
...
@@ -19,8 +19,10 @@ void help()
"It reads in a trained object model and then uses that to detect the object in an image
\n
"
"It reads in a trained object model and then uses that to detect the object in an image
\n
"
"Usage:
\n
"
"Usage:
\n
"
"./latentsvmdetect [--image_filename]=<image_filename, cat.jpg as default>
\n
"
"./latentsvmdetect [--image_filename]=<image_filename, cat.jpg as default>
\n
"
" [--model_filename] = <model_filename, cat.xml as default>
\n
"
" [--model_filename]=<model_filename, cat.xml as default>
\n
"
" [--threads_number] = <number of threads, -1 as default>
\n
"
" [--threads_number]=<number of threads, -1 as default>
\n
"
"Example:
\n
"
"./latentsvmdetect --image_filename=cat.jpg --model_filename=cat.xml --threads_number=7
\n
"
" Press any key to quit.
\n
"
);
" Press any key to quit.
\n
"
);
}
}
...
...
samples/c/morphology.c
View file @
09a7a404
...
@@ -58,23 +58,31 @@ void help()
...
@@ -58,23 +58,31 @@ void help()
"Morphology operators are built on max (close) and min (open) operators as measured by pixels covered by small structuring elements.
\n
"
"Morphology operators are built on max (close) and min (open) operators as measured by pixels covered by small structuring elements.
\n
"
"These operators are very efficient.
\n
"
"These operators are very efficient.
\n
"
"This program also allows you to play with elliptical, rectangluar and cross structure elements
\n
"
"This program also allows you to play with elliptical, rectangluar and cross structure elements
\n
"
"Call:
\n
"
"Usage:
\n
"
"./morphologyc [image_name -- Default baboon.jpg]
\n
"
"./morphologyc [image_name -- Default baboon.jpg]
\n
"
"
\n
Hot keys:
\n
"
"
\n
Hot keys:
\n
"
"
\t
ESC - quit the program
\n
"
"
\t
ESC - quit the program
\n
"
"
\t
r - use rectangle structuring element
\n
"
"
\t
r - use rectangle structuring element
\n
"
"
\t
e - use elliptic structuring element
\n
"
"
\t
e - use elliptic structuring element
\n
"
"
\t
c - use cross-shaped structuring element
\n
"
"
\t
c - use cross-shaped structuring element
\n
"
"
\t
SPACE - loop through all the options
\n
"
);
"
\t
SPACE - loop through all the options
\n
"
);
}
}
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
char
*
filename
=
argc
==
2
?
argv
[
1
]
:
(
char
*
)
"baboon.jpg"
;
char
*
filename
=
0
;
help
();
filename
=
argc
==
2
?
argv
[
1
]
:
(
char
*
)
"baboon.jpg"
;
if
(
(
src
=
cvLoadImage
(
filename
,
1
))
==
0
)
if
(
(
src
=
cvLoadImage
(
filename
,
1
))
==
0
)
{
printf
(
"Cannot load file image %s
\n
"
,
filename
);
help
();
return
-
1
;
return
-
1
;
}
help
();
dst
=
cvCloneImage
(
src
);
dst
=
cvCloneImage
(
src
);
...
...
samples/c/motempl.c
View file @
09a7a404
...
@@ -12,7 +12,7 @@ void help()
...
@@ -12,7 +12,7 @@ void help()
"of thresholded layers of decaying frame differencing. New movements are stamped on top with floating system
\n
"
"of thresholded layers of decaying frame differencing. New movements are stamped on top with floating system
\n
"
"time code and motions too old are thresholded away. This is the 'motion history file'. The program reads from the camera of your choice or from
\n
"
"time code and motions too old are thresholded away. This is the 'motion history file'. The program reads from the camera of your choice or from
\n
"
"a file. Gradients of motion history are used to detect direction of motoin etc
\n
"
"a file. Gradients of motion history are used to detect direction of motoin etc
\n
"
"Call
:
\n
"
"Usage
:
\n
"
"./motempl [camera number 0-n or file name, default is camera 0]
\n
"
"./motempl [camera number 0-n or file name, default is camera 0]
\n
"
);
);
}
}
...
@@ -160,7 +160,9 @@ int main(int argc, char** argv)
...
@@ -160,7 +160,9 @@ int main(int argc, char** argv)
{
{
IplImage
*
motion
=
0
;
IplImage
*
motion
=
0
;
CvCapture
*
capture
=
0
;
CvCapture
*
capture
=
0
;
help
();
help
();
if
(
argc
==
1
||
(
argc
==
2
&&
strlen
(
argv
[
1
])
==
1
&&
isdigit
(
argv
[
1
][
0
])))
if
(
argc
==
1
||
(
argc
==
2
&&
strlen
(
argv
[
1
])
==
1
&&
isdigit
(
argv
[
1
][
0
])))
capture
=
cvCaptureFromCAM
(
argc
==
2
?
argv
[
1
][
0
]
-
'0'
:
0
);
capture
=
cvCaptureFromCAM
(
argc
==
2
?
argv
[
1
][
0
]
-
'0'
:
0
);
else
if
(
argc
==
2
)
else
if
(
argc
==
2
)
...
...
samples/c/mser_sample.cpp
View file @
09a7a404
...
@@ -17,7 +17,9 @@ void help()
...
@@ -17,7 +17,9 @@ void help()
printf
(
"
\n
This program demonstrates the Maximal Extremal Region interest point detector.
\n
"
printf
(
"
\n
This program demonstrates the Maximal Extremal Region interest point detector.
\n
"
"It finds the most stable (in size) dark and white regions as a threshold is increased.
\n
"
"It finds the most stable (in size) dark and white regions as a threshold is increased.
\n
"
"
\n
Usage:
\n
"
"
\n
Usage:
\n
"
"./mser_sample [--image_filename] <path_and_image_filename, default is 'puzzle.png'>
\n
"
);
"./mser_sample [--image_filename] <path_and_image_filename, default is 'puzzle.png'>
\n
"
"Example:
\n
"
"./mser_sample --image_filename=puzzle.png
\n
"
);
}
}
static
CvScalar
colors
[]
=
static
CvScalar
colors
[]
=
...
...
samples/c/mushroom.cpp
View file @
09a7a404
...
@@ -5,20 +5,20 @@
...
@@ -5,20 +5,20 @@
void
help
()
void
help
()
{
{
printf
(
"
\n
This program demonstrated the use of OpenCV's decision tree function for learning and predicting data
\n
"
printf
(
"
\n
This program demonstrated the use of OpenCV's decision tree function for learning and predicting data
\n
"
"Call
:
\n
"
"Usage
:
\n
"
"./mushroom <path to agaricus-lepiota.data>
\n
"
);
"./mushroom <path to agaricus-lepiota.data>
\n
"
printf
(
"
\n
"
"
\n
"
"The sample demonstrates how to build a decision tree for classifying mushrooms.
\n
"
"The sample demonstrates how to build a decision tree for classifying mushrooms.
\n
"
"It uses the sample base agaricus-lepiota.data from UCI Repository, here is the link:
\n
"
"It uses the sample base agaricus-lepiota.data from UCI Repository, here is the link:
\n
"
"
\n
"
"
\n
"
"Newman, D.J. & Hettich, S. & Blake, C.L. & Merz, C.J. (1998).
\n
"
"Newman, D.J. & Hettich, S. & Blake, C.L. & Merz, C.J. (1998).
\n
"
"UCI Repository of machine learning databases
\n
"
"UCI Repository of machine learning databases
\n
"
"[http://www.ics.uci.edu/~mlearn/MLRepository.html].
\n
"
"[http://www.ics.uci.edu/~mlearn/MLRepository.html].
\n
"
"Irvine, CA: University of California, Department of Information and Computer Science.
\n
"
"Irvine, CA: University of California, Department of Information and Computer Science.
\n
"
"
\n
"
"
\n
"
"// loads the mushroom database, which is a text file, containing
\n
"
"// loads the mushroom database, which is a text file, containing
\n
"
"// one training sample per row, all the input variables and the output variable are categorical,
\n
"
"// one training sample per row, all the input variables and the output variable are categorical,
\n
"
"// the values are encoded by characters.
\n\n
"
);
"// the values are encoded by characters.
\n\n
"
);
}
}
int
mushroom_read_database
(
const
char
*
filename
,
CvMat
**
data
,
CvMat
**
missing
,
CvMat
**
responses
)
int
mushroom_read_database
(
const
char
*
filename
,
CvMat
**
data
,
CvMat
**
missing
,
CvMat
**
responses
)
...
@@ -298,6 +298,8 @@ int main( int argc, char** argv )
...
@@ -298,6 +298,8 @@ int main( int argc, char** argv )
CvDTree
*
dtree
;
CvDTree
*
dtree
;
const
char
*
base_path
=
argc
>=
2
?
argv
[
1
]
:
"agaricus-lepiota.data"
;
const
char
*
base_path
=
argc
>=
2
?
argv
[
1
]
:
"agaricus-lepiota.data"
;
help
();
if
(
!
mushroom_read_database
(
base_path
,
&
data
,
&
missing
,
&
responses
)
)
if
(
!
mushroom_read_database
(
base_path
,
&
data
,
&
missing
,
&
responses
)
)
{
{
printf
(
"
\n
Unable to load the training database
\n\n
"
);
printf
(
"
\n
Unable to load the training database
\n\n
"
);
...
...
samples/c/polar_transforms.c
View file @
09a7a404
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
void
help
()
void
help
()
{
{
printf
(
"
\n
This program illustrates Linear-Polar and Log-Polar image transforms
\n
"
printf
(
"
\n
This program illustrates Linear-Polar and Log-Polar image transforms
\n
"
"Call
:
\n
"
"Usage
:
\n
"
"./polar_transforms [[camera number -- Default 0],[AVI path_filename]]
\n\n
"
"./polar_transforms [[camera number -- Default 0],[AVI path_filename]]
\n\n
"
);
);
}
}
...
@@ -20,15 +20,17 @@ int main( int argc, char** argv )
...
@@ -20,15 +20,17 @@ int main( int argc, char** argv )
IplImage
*
lin_polar_img
=
0
;
IplImage
*
lin_polar_img
=
0
;
IplImage
*
recovered_img
=
0
;
IplImage
*
recovered_img
=
0
;
help
();
if
(
argc
==
1
||
(
argc
==
2
&&
strlen
(
argv
[
1
])
==
1
&&
isdigit
(
argv
[
1
][
0
])))
if
(
argc
==
1
||
(
argc
==
2
&&
strlen
(
argv
[
1
])
==
1
&&
isdigit
(
argv
[
1
][
0
])))
capture
=
cvCaptureFromCAM
(
argc
==
2
?
argv
[
1
][
0
]
-
'0'
:
0
);
capture
=
cvCaptureFromCAM
(
argc
==
2
?
argv
[
1
][
0
]
-
'0'
:
0
);
else
if
(
argc
==
2
)
else
if
(
argc
==
2
)
capture
=
cvCaptureFromAVI
(
argv
[
1
]
);
capture
=
cvCaptureFromAVI
(
argv
[
1
]
);
help
();
if
(
!
capture
)
if
(
!
capture
)
{
{
fprintf
(
stderr
,
"Could not initialize capturing...
\n
"
);
fprintf
(
stderr
,
"Could not initialize capturing...
\n
"
);
fprintf
(
stderr
,
"Usage: %s <CAMERA_NUMBER> , or
\n
%s <VIDEO_FILE>
\n
"
,
argv
[
0
],
argv
[
0
]);
fprintf
(
stderr
,
"Usage: %s <CAMERA_NUMBER> , or
\n
%s <VIDEO_FILE>
\n
"
,
argv
[
0
],
argv
[
0
]);
help
();
return
-
1
;
return
-
1
;
}
}
...
...
samples/c/pyramid_segmentation.c
View file @
09a7a404
...
@@ -7,7 +7,7 @@ void help()
...
@@ -7,7 +7,7 @@ void help()
{
{
printf
(
"
\n
This program demonstrated color pyramid segmentation cvcvPyrSegmentation() which is controlled
\n
"
printf
(
"
\n
This program demonstrated color pyramid segmentation cvcvPyrSegmentation() which is controlled
\n
"
"by two trhesholds which can be manipulated by a trackbar. It can take an image file name or defaults to 'fruits.jpg'
\n
"
"by two trhesholds which can be manipulated by a trackbar. It can take an image file name or defaults to 'fruits.jpg'
\n
"
"Call
:
\n
"
"Usage
:
\n
"
"./pyaramid_segmentation [image_path_filename -- Defaults to fruits.jpg]
\n\n
"
"./pyaramid_segmentation [image_path_filename -- Defaults to fruits.jpg]
\n\n
"
);
);
}
}
...
@@ -36,32 +36,24 @@ void ON_SEGMENT(int a)
...
@@ -36,32 +36,24 @@ void ON_SEGMENT(int a)
cvPyrSegmentation
(
image0
,
image1
,
storage
,
&
comp
,
cvPyrSegmentation
(
image0
,
image1
,
storage
,
&
comp
,
level
,
threshold1
+
1
,
threshold2
+
1
);
level
,
threshold1
+
1
,
threshold2
+
1
);
/*l_comp = comp->total;
i = 0;
min_comp.value = cvScalarAll(0);
while(i<l_comp)
{
cur_comp = (CvConnectedComp*)cvGetSeqElem ( comp, i );
if(fabs(255- min_comp.value.val[0])>
fabs(255- cur_comp->value.val[0]) &&
fabs(min_comp.value.val[1])>
fabs(cur_comp->value.val[1]) &&
fabs(min_comp.value.val[2])>
fabs(cur_comp->value.val[2]) )
min_comp = *cur_comp;
i++;
}*/
cvShowImage
(
"Segmentation"
,
image1
);
cvShowImage
(
"Segmentation"
,
image1
);
}
}
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
char
*
filename
=
argc
==
2
?
argv
[
1
]
:
(
char
*
)
"fruits.jpg"
;
char
*
filename
;
help
();
filename
=
argc
==
2
?
argv
[
1
]
:
(
char
*
)
"fruits.jpg"
;
if
(
(
image
[
0
]
=
cvLoadImage
(
filename
,
1
))
==
0
)
if
(
(
image
[
0
]
=
cvLoadImage
(
filename
,
1
))
==
0
)
{
help
();
printf
(
"Cannot load fileimage - %s
\n
"
,
filename
);
return
-
1
;
return
-
1
;
}
cvNamedWindow
(
"Source"
,
0
);
cvNamedWindow
(
"Source"
,
0
);
cvShowImage
(
"Source"
,
image
[
0
]);
cvShowImage
(
"Source"
,
image
[
0
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment