View Source Evision.CUDA.CascadeClassifier (Evision v0.2.9)
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
@spec clear(Keyword.t()) :: any() | {:error, String.t()}
@spec clear(t()) :: t() | {:error, String.t()}
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
@spec create(Keyword.t()) :: any() | {:error, String.t()}
@spec create(binary()) :: t() | {:error, String.t()}
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
.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
.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 empty(Keyword.t()) :: any() | {:error, String.t()}
@spec empty(t()) :: boolean() | {:error, String.t()}
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
@spec getClassifierSize(Keyword.t()) :: any() | {:error, String.t()}
@spec getClassifierSize(t()) :: {number(), number()} | {:error, String.t()}
getClassifierSize
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
Size
Python prototype (for reference only):
getClassifierSize() -> retval
@spec getDefaultName(Keyword.t()) :: any() | {:error, String.t()}
@spec getDefaultName(t()) :: binary() | {:error, String.t()}
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
@spec getFindLargestObject(Keyword.t()) :: any() | {:error, String.t()}
@spec getFindLargestObject(t()) :: boolean() | {:error, String.t()}
getFindLargestObject
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
bool
Python prototype (for reference only):
getFindLargestObject() -> retval
@spec getMaxNumObjects(Keyword.t()) :: any() | {:error, String.t()}
@spec getMaxNumObjects(t()) :: integer() | {:error, String.t()}
getMaxNumObjects
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
integer()
Python prototype (for reference only):
getMaxNumObjects() -> retval
@spec getMaxObjectSize(Keyword.t()) :: any() | {:error, String.t()}
@spec getMaxObjectSize(t()) :: {number(), number()} | {:error, String.t()}
getMaxObjectSize
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
Size
Python prototype (for reference only):
getMaxObjectSize() -> retval
@spec getMinNeighbors(Keyword.t()) :: any() | {:error, String.t()}
@spec getMinNeighbors(t()) :: integer() | {:error, String.t()}
getMinNeighbors
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
integer()
Python prototype (for reference only):
getMinNeighbors() -> retval
@spec getMinObjectSize(Keyword.t()) :: any() | {:error, String.t()}
@spec getMinObjectSize(t()) :: {number(), number()} | {:error, String.t()}
getMinObjectSize
Positional Arguments
- self:
Evision.CUDA.CascadeClassifier.t()
Return
- retval:
Size
Python prototype (for reference only):
getMinObjectSize() -> retval
@spec getScaleFactor(Keyword.t()) :: any() | {:error, String.t()}
@spec getScaleFactor(t()) :: number() | {:error, String.t()}
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()
- func:
Evision.FileNode
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:
integer()
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:
integer()
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
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
- name:
String
Has overloading in C++
Python prototype (for reference only):
write(fs, name) -> None