image_processing.rst 14.8 KB

Image Processing

ocl::cornerHarris

Returns void

Calculate Harris corner.

ocl::cornerMinEigenVal

Returns void

Calculate MinEigenVal.

ocl::calcHist

Returns void

Calculates histogram of one or more arrays. Supports only 8UC1 data type.

ocl::remap

Returns void

The function remap transforms the source image using the specified map: dst (x ,y) = src (map1(x , y) , map2(x , y)) where values of pixels with non-integer coordinates are computed using one of available interpolation methods. map1 and map2 can be encoded as separate floating-point maps in map1 and map2 respectively, or interleaved floating-point maps of (x,y) in map1. Supports CV_8UC1, CV_8UC3, CV_8UC4, CV_32FC1 , CV_32FC3 and CV_32FC4 data types.

ocl::resize

Returns void

Resizes an image. Supports CV_8UC1, CV_8UC3, CV_8UC4, CV_32FC1 , CV_32FC3 and CV_32FC4 data types.

ocl::warpAffine

Returns void

The function warpAffine transforms the source image using the specified matrix. Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC types.

ocl::warpPerspective

Returns void

Applies a perspective transformation to an image. Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC types.

ocl::cvtColor

Returns void

Converts image from one color space to another.For now, only RGB2GRAY is supportted. Supports.CV_8UC1,CV_8UC4,CV_32SC1,CV_32SC4,CV_32FC1,CV_32FC4

ocl::threshold

Returns Threshold value

The function applies fixed-level thresholding to a single-channel array. The function is typically used to get a bi-level (binary) image out of a grayscale image or for removing a noise, i.e. filtering out pixels with too small or too large values. There are several types of thresholding that the function supports that are determined by thresholdType. Supports only CV_32FC1 and CV_8UC1 data type.

ocl::buildWarpPlaneMaps

Builds plane warping maps.

ocl::buildWarpCylindricalMaps

Builds cylindrical warping maps.

ocl::buildWarpSphericalMaps

Builds spherical warping maps.

ocl::buildWarpPerspectiveMaps

Builds transformation maps for perspective transformation.

ocl::buildWarpAffineMaps

Builds transformation maps for affine transformation.

ocl::PyrLKOpticalFlow

Class used for calculating an optical flow.

class PyrLKOpticalFlow
{
public:
    PyrLKOpticalFlow();

    void sparse(const oclMat& prevImg, const oclMat& nextImg, const oclMat& prevPts, oclMat& nextPts,
        oclMat& status, oclMat* err = 0);

    void dense(const oclMat& prevImg, const oclMat& nextImg, oclMat& u, oclMat& v, oclMat* err = 0);

    Size winSize;
    int maxLevel;
    int iters;
    double derivLambda;
    bool useInitialFlow;
    float minEigThreshold;
    bool getMinEigenVals;

    void releaseMemory();
};

The class can calculate an optical flow for a sparse feature set or dense optical flow using the iterative Lucas-Kanade method with pyramids.

ocl::PyrLKOpticalFlow::sparse

Calculate an optical flow for a sparse feature set.

ocl::PyrLKOpticalFlow::dense

Calculate dense optical flow.

ocl::PyrLKOpticalFlow::releaseMemory

Releases inner buffers memory.

ocl::interpolateFrames

Interpolate frames (images) using provided optical flow (displacement field).

ocl::HoughCircles

Finds circles in a grayscale image using the Hough transform.

Note

Currently only non-ROI oclMat is supported for src.