View Source Evision.CUDA.CascadeClassifier (Evision v0.2.2-rc2)
Summary
Functions
Clears the algorithm state
Converts objects array from internal representation to standard vector.
Converts objects array from internal representation to standard vector.
Loads the classifier from a file. Cascade type is detected automatically by constructor parameter.
Variant 1:
Detects objects of different sizes in the input image.
Variant 1:
Detects objects of different sizes in the input image.
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
getClassifierSize
getDefaultName
getFindLargestObject
getMaxNumObjects
getMaxObjectSize
getMinNeighbors
getMinObjectSize
getScaleFactor
Reads algorithm parameters from a file storage
save
setFindLargestObject
setMaxNumObjects
setMaxObjectSize
setMinNeighbors
setMinObjectSize
setScaleFactor
Stores algorithm parameters in a file storage
write
Types
@type t() :: %Evision.CUDA.CascadeClassifier{ref: reference()}
Type that represents an CUDA.CascadeClassifier
struct.
ref.
reference()
The underlying erlang resource variable.
Functions
Clears the algorithm state
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Python prototype (for reference only):
clear() -> None
@spec convert(t(), [{number(), number(), number(), number()}]) :: Evision.Mat.t() | {:error, String.t()}
Converts objects array from internal representation to standard vector.
Positional Arguments
self:
Evision.CUDA.CascadeClassifier.t()
objects:
[Rect]
.Resulting array.
Return
gpu_objects:
Evision.Mat.t()
.Objects array in internal representation.
Python prototype (for reference only):
convert(objects[, gpu_objects]) -> gpu_objects
@spec convert( t(), [{number(), number(), number(), number()}], [{atom(), term()}, ...] | nil ) :: Evision.Mat.t() | {:error, String.t()}
Converts objects array from internal representation to standard vector.
Positional Arguments
self:
Evision.CUDA.CascadeClassifier.t()
objects:
[Rect]
.Resulting array.
Return
gpu_objects:
Evision.Mat.t()
.Objects array in internal representation.
Python prototype (for reference only):
convert(objects[, gpu_objects]) -> gpu_objects
Loads the classifier from a file. Cascade type is detected automatically by constructor parameter.
Positional Arguments
filename:
String
.Name of the file from which the classifier is loaded. Only the old haar classifier (trained by the haar training application) and NVIDIA's nvbin are supported for HAAR and only new type of OpenCV XML cascade supported for LBP. The working haar models can be found at opencv_folder/data/haarcascades_cuda/
Return
- retval:
Evision.CUDA.CascadeClassifier.t()
Python prototype (for reference only):
create(filename) -> retval
@spec detectMultiScale(t(), Evision.Mat.maybe_mat_in()) :: Evision.Mat.t() | {:error, String.t()}
@spec detectMultiScale(t(), Evision.CUDA.GpuMat.t()) :: Evision.CUDA.GpuMat.t() | {:error, String.t()}
Variant 1:
Detects objects of different sizes in the input image.
Positional Arguments
self:
Evision.CUDA.CascadeClassifier.t()
image:
Evision.Mat.t()
.Matrix of type CV_8U containing an image where objects should be detected.
Keyword Arguments
stream:
Evision.CUDA.Stream.t()
.CUDA stream.
Return
objects:
Evision.Mat.t()
.Buffer to store detected objects (rectangles).
To get final array of detected objects use CascadeClassifier::convert method.
Ptr<cuda::CascadeClassifier> cascade_gpu = cuda::CascadeClassifier::create(...);
Mat image_cpu = imread(...)
GpuMat image_gpu(image_cpu);
GpuMat objbuf;
cascade_gpu->detectMultiScale(image_gpu, objbuf);
std::vector<Rect> faces;
cascade_gpu->convert(objbuf, faces);
for(int i = 0; i < detections_num; ++i)
cv::rectangle(image_cpu, faces[i], Scalar(255));
imshow("Faces", image_cpu);
@sa CascadeClassifier::detectMultiScale
Python prototype (for reference only):
detectMultiScale(image[, objects[, stream]]) -> objects
Variant 2:
Detects objects of different sizes in the input image.
Positional Arguments
self:
Evision.CUDA.CascadeClassifier.t()
image:
Evision.CUDA.GpuMat.t()
.Matrix of type CV_8U containing an image where objects should be detected.
Keyword Arguments
stream:
Evision.CUDA.Stream.t()
.CUDA stream.
Return
objects:
Evision.CUDA.GpuMat.t()
.Buffer to store detected objects (rectangles).
To get final array of detected objects use CascadeClassifier::convert method.
Ptr<cuda::CascadeClassifier> cascade_gpu = cuda::CascadeClassifier::create(...);
Mat image_cpu = imread(...)
GpuMat image_gpu(image_cpu);
GpuMat objbuf;
cascade_gpu->detectMultiScale(image_gpu, objbuf);
std::vector<Rect> faces;
cascade_gpu->convert(objbuf, faces);
for(int i = 0; i < detections_num; ++i)
cv::rectangle(image_cpu, faces[i], Scalar(255));
imshow("Faces", image_cpu);
@sa CascadeClassifier::detectMultiScale
Python prototype (for reference only):
detectMultiScale(image[, objects[, stream]]) -> objects
@spec detectMultiScale(t(), Evision.Mat.maybe_mat_in(), [{:stream, term()}] | nil) :: Evision.Mat.t() | {:error, String.t()}
@spec detectMultiScale(t(), Evision.CUDA.GpuMat.t(), [{:stream, term()}] | nil) :: Evision.CUDA.GpuMat.t() | {:error, String.t()}
Variant 1:
Detects objects of different sizes in the input image.
Positional Arguments
self:
Evision.CUDA.CascadeClassifier.t()
image:
Evision.Mat.t()
.Matrix of type CV_8U containing an image where objects should be detected.
Keyword Arguments
stream:
Evision.CUDA.Stream.t()
.CUDA stream.
Return
objects:
Evision.Mat.t()
.Buffer to store detected objects (rectangles).
To get final array of detected objects use CascadeClassifier::convert method.
Ptr<cuda::CascadeClassifier> cascade_gpu = cuda::CascadeClassifier::create(...);
Mat image_cpu = imread(...)
GpuMat image_gpu(image_cpu);
GpuMat objbuf;
cascade_gpu->detectMultiScale(image_gpu, objbuf);
std::vector<Rect> faces;
cascade_gpu->convert(objbuf, faces);
for(int i = 0; i < detections_num; ++i)
cv::rectangle(image_cpu, faces[i], Scalar(255));
imshow("Faces", image_cpu);
@sa CascadeClassifier::detectMultiScale
Python prototype (for reference only):
detectMultiScale(image[, objects[, stream]]) -> objects
Variant 2:
Detects objects of different sizes in the input image.
Positional Arguments
self:
Evision.CUDA.CascadeClassifier.t()
image:
Evision.CUDA.GpuMat.t()
.Matrix of type CV_8U containing an image where objects should be detected.
Keyword Arguments
stream:
Evision.CUDA.Stream.t()
.CUDA stream.
Return
objects:
Evision.CUDA.GpuMat.t()
.Buffer to store detected objects (rectangles).
To get final array of detected objects use CascadeClassifier::convert method.
Ptr<cuda::CascadeClassifier> cascade_gpu = cuda::CascadeClassifier::create(...);
Mat image_cpu = imread(...)
GpuMat image_gpu(image_cpu);
GpuMat objbuf;
cascade_gpu->detectMultiScale(image_gpu, objbuf);
std::vector<Rect> faces;
cascade_gpu->convert(objbuf, faces);
for(int i = 0; i < detections_num; ++i)
cv::rectangle(image_cpu, faces[i], Scalar(255));
imshow("Faces", image_cpu);
@sa CascadeClassifier::detectMultiScale
Python prototype (for reference only):
detectMultiScale(image[, objects[, stream]]) -> objects
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
bool
Python prototype (for reference only):
empty() -> retval
getClassifierSize
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
Size
Python prototype (for reference only):
getClassifierSize() -> retval
getDefaultName
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
String
Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.
Python prototype (for reference only):
getDefaultName() -> retval
getFindLargestObject
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
bool
Python prototype (for reference only):
getFindLargestObject() -> retval
getMaxNumObjects
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
int
Python prototype (for reference only):
getMaxNumObjects() -> retval
getMaxObjectSize
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
Size
Python prototype (for reference only):
getMaxObjectSize() -> retval
getMinNeighbors
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
int
Python prototype (for reference only):
getMinNeighbors() -> retval
getMinObjectSize
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
Size
Python prototype (for reference only):
getMinObjectSize() -> retval
getScaleFactor
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
double
Python prototype (for reference only):
getScaleFactor() -> retval
@spec read(t(), Evision.FileNode.t()) :: t() | {:error, String.t()}
Reads algorithm parameters from a file storage
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
- fn_:
Evision.FileNode.t()
Python prototype (for reference only):
read(fn_) -> None
save
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
- filename:
String
Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).
Python prototype (for reference only):
save(filename) -> None
setFindLargestObject
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
- findLargestObject:
bool
Python prototype (for reference only):
setFindLargestObject(findLargestObject) -> None
setMaxNumObjects
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
- maxNumObjects:
int
Python prototype (for reference only):
setMaxNumObjects(maxNumObjects) -> None
setMaxObjectSize
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
- maxObjectSize:
Size
Has overloading in C++
Python prototype (for reference only):
setMaxObjectSize(maxObjectSize) -> None
setMinNeighbors
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
- minNeighbors:
int
Python prototype (for reference only):
setMinNeighbors(minNeighbors) -> None
setMinObjectSize
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
- minSize:
Size
Python prototype (for reference only):
setMinObjectSize(minSize) -> None
setScaleFactor
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
- scaleFactor:
double
Python prototype (for reference only):
setScaleFactor(scaleFactor) -> None
@spec write(t(), Evision.FileStorage.t()) :: t() | {:error, String.t()}
Stores algorithm parameters in a file storage
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
- fs:
Evision.FileStorage.t()
Python prototype (for reference only):
write(fs) -> None
@spec write(t(), Evision.FileStorage.t(), binary()) :: t() | {:error, String.t()}
write
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
- fs:
Evision.FileStorage.t()
- name:
String
Has overloading in C++
Python prototype (for reference only):
write(fs, name) -> None