@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
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Constructor and Description |
|---|
CudaCascadeClassifier(Pointer p)
Pointer cast constructor.
|
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(Pointer p)
Pointer.Pointer(Pointer).@opencv_core.Ptr public static opencv_cudaobjdetect.CudaCascadeClassifier create(@opencv_core.Str 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)
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 © 2019. All rights reserved.