@Name(value="cv::cuda::CascadeClassifier") public static class opencv_cudaobjdetect.CudaCascadeClassifier extends opencv_core.Algorithm
\note - A cascade classifier example can be found at opencv_source_code/samples/gpu/cascadeclassifier.cpp - A Nvidea API specific cascade classifier example can be found at opencv_source_code/samples/gpu/cascadeclassifier_nvidia_api.cpp
| Constructor and Description |
|---|
CudaCascadeClassifier(org.bytedeco.javacpp.Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
convert(opencv_core.GpuMat gpu_objects,
opencv_core.RectVector objects) |
void |
convert(opencv_core.Mat gpu_objects,
opencv_core.RectVector objects)
\brief Converts objects array from internal representation to standard vector.
|
void |
convert(opencv_core.UMat gpu_objects,
opencv_core.RectVector objects) |
static opencv_cudaobjdetect.CudaCascadeClassifier |
create(org.bytedeco.javacpp.BytePointer filename)
\brief Loads the classifier from a file.
|
static opencv_cudaobjdetect.CudaCascadeClassifier |
create(opencv_core.FileStorage file)
\overload
|
static opencv_cudaobjdetect.CudaCascadeClassifier |
create(String filename) |
void |
detectMultiScale(opencv_core.GpuMat image,
opencv_core.GpuMat objects) |
void |
detectMultiScale(opencv_core.GpuMat image,
opencv_core.GpuMat objects,
opencv_core.Stream stream) |
void |
detectMultiScale(opencv_core.Mat image,
opencv_core.Mat objects) |
void |
detectMultiScale(opencv_core.Mat image,
opencv_core.Mat objects,
opencv_core.Stream stream)
\brief Detects objects of different sizes in the input image.
|
void |
detectMultiScale(opencv_core.UMat image,
opencv_core.UMat objects) |
void |
detectMultiScale(opencv_core.UMat image,
opencv_core.UMat objects,
opencv_core.Stream stream) |
opencv_core.Size |
getClassifierSize() |
boolean |
getFindLargestObject() |
int |
getMaxNumObjects() |
opencv_core.Size |
getMaxObjectSize() |
int |
getMinNeighbors() |
opencv_core.Size |
getMinObjectSize() |
double |
getScaleFactor() |
void |
setFindLargestObject(boolean findLargestObject) |
void |
setMaxNumObjects(int maxNumObjects) |
void |
setMaxObjectSize(opencv_core.Size maxObjectSize)
Maximum possible object size.
|
void |
setMinNeighbors(int minNeighbors)
Parameter specifying how many neighbors each candidate rectangle should have
to retain it.
|
void |
setMinObjectSize(opencv_core.Size minSize)
Minimum possible object size.
|
void |
setScaleFactor(double scaleFactor)
Parameter specifying how much the image size is reduced at each image scale.
|
clear, empty, getDefaultName, position, read, save, save, write, write, writeaddress, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zeropublic CudaCascadeClassifier(org.bytedeco.javacpp.Pointer p)
Pointer.Pointer(Pointer).@opencv_core.Ptr public static opencv_cudaobjdetect.CudaCascadeClassifier create(@opencv_core.Str org.bytedeco.javacpp.BytePointer filename)
filename - 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/@opencv_core.Ptr public static opencv_cudaobjdetect.CudaCascadeClassifier create(@opencv_core.Str String filename)
@opencv_core.Ptr public static opencv_cudaobjdetect.CudaCascadeClassifier create(@Const @ByRef opencv_core.FileStorage file)
public void setMaxObjectSize(@ByVal
opencv_core.Size maxObjectSize)
@ByVal public opencv_core.Size getMaxObjectSize()
public void setMinObjectSize(@ByVal
opencv_core.Size minSize)
@ByVal public opencv_core.Size getMinObjectSize()
public void setScaleFactor(double scaleFactor)
public double getScaleFactor()
public void setMinNeighbors(int minNeighbors)
public int getMinNeighbors()
public void setFindLargestObject(@Cast(value="bool")
boolean findLargestObject)
@Cast(value="bool") public boolean getFindLargestObject()
public void setMaxNumObjects(int maxNumObjects)
public int getMaxNumObjects()
@ByVal public opencv_core.Size getClassifierSize()
public void detectMultiScale(@ByVal
opencv_core.Mat image,
@ByVal
opencv_core.Mat objects,
@ByRef(nullValue="cv::cuda::Stream::Null()")
opencv_core.Stream stream)
image - Matrix of type CV_8U containing an image where objects should be detected.objects - Buffer to store detected objects (rectangles).stream - CUDA stream.
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
public void detectMultiScale(@ByVal
opencv_core.Mat image,
@ByVal
opencv_core.Mat objects)
public void detectMultiScale(@ByVal
opencv_core.UMat image,
@ByVal
opencv_core.UMat objects,
@ByRef(nullValue="cv::cuda::Stream::Null()")
opencv_core.Stream stream)
public void detectMultiScale(@ByVal
opencv_core.UMat image,
@ByVal
opencv_core.UMat objects)
public void detectMultiScale(@ByVal
opencv_core.GpuMat image,
@ByVal
opencv_core.GpuMat objects,
@ByRef(nullValue="cv::cuda::Stream::Null()")
opencv_core.Stream stream)
public void detectMultiScale(@ByVal
opencv_core.GpuMat image,
@ByVal
opencv_core.GpuMat objects)
public void convert(@ByVal
opencv_core.Mat gpu_objects,
@ByRef
opencv_core.RectVector objects)
gpu_objects - Objects array in internal representation.objects - Resulting array.public void convert(@ByVal
opencv_core.UMat gpu_objects,
@ByRef
opencv_core.RectVector objects)
public void convert(@ByVal
opencv_core.GpuMat gpu_objects,
@ByRef
opencv_core.RectVector objects)
Copyright © 2018. All rights reserved.