Difference between revisions of "CUVI Features"

From CUVI Wiki
(48 intermediate revisions by 2 users not shown)
Line 5: Line 5:
* Color Operations <!--[[Module:cuvico|Color Operations]]-->
* Color Operations <!--[[Module:cuvico|Color Operations]]-->
* Computer Vision<!--[[Module:cuvicv|Computer Vision]]-->
* Computer Vision<!--[[Module:cuvicv|Computer Vision]]-->
* Data Exchange & Initialization<!--[[Module:cuvide|Data Exchange & Initialization]]-->
* Data Exchange<!--[[Module:cuvide|Data Exchange]]-->
* Geometry Transforms<!--[[Module:cuvigt|Geometry Transforms]]-->
* Geometry Transforms<!--[[Module:cuvigt|Geometry Transforms]]-->
* Image Filtering<!--[[Module:cuviif|Image Filtering]]-->
* Image Filtering<!--[[Module:cuviif|Image Filtering]]-->
* Image Statistics<!--[[Module:cuviis|Image Statistics]]-->
* Image Statistics<!--[[Module:cuviis|Image Statistics]]-->
* Image Transforms<!--[[Module:cuviit|Image Transforms]]-->
* Image Transforms<!--[[Module:cuviit|Image Transforms]]-->
* Video Stabilization<!--[[Module:videostab|Video Stabilization]]-->
<br/>
<br/>


Line 16: Line 17:
|- valign="top"
|- valign="top"
|
|
* [[Function:Add|Add]] - Adds two images
===Arithmetic & Logical===
* [[Function:Adjust|Adjust]] - Equivalent to MATLAB's imadjust
* [[Function:Abs|abs]] - Computes absolute value of each image pixel
* [[Function:AND|AND]] - Logical Bitwise AND
* [[Function:AbsDiff|absDiff]] - Computes absolute difference between 2 images.
* [[Function:BitConversion|BitConversion]] - Converts image pixel values from one data type to another
* [[Function:Add|add]] - Adds two images
* [[Function:BorderMask|BorderMask]] - Masks image borders with custom intensity
* [[Function:AND|AND]] - Bitwise AND operation between two images.
* [[Function:ChannelMerge|ChannelMerge]] - Merges R, G and B Channel to form a color image
* [[Function:Cbrt|cbrt]] - Computes cube root of each image pixel
* [[Function:ChannelSplit|ChannelSplit]] - Splits a three channel image into R, G and B channels
* [[Function:Ceil|ceil]] - Applies ceil function to each image pixel
* [[Function:Color2Gray|Color2Gray]] - Converts an RGB image to gray scale using custom transform coefficients.
* [[Function:Divide|divide]] - Divides pixel values of two images
* [[Function:ColorTwist|ColorTwist]] - Applies a color twist matrix to an image
* [[Function:Exp|exp]] - Computes exponential of each image pixel
* [[Function:CountInRange|CountInRange]] - Counts the number of pixels within the given intensity range
* [[Function:Floor|floor]] - Applies floor function to each image pixel
* [[Function:Crop|Crop]] - Crops the desired portion of an image
* [[Function:Invert|invert]] - Computes matrix inverse using LU factorization
* [[Function:Demosaic|Demosaic]] - Restores an RGB image from a gray-scale Bayer image  
* [[Function:MatMul|matMul]] - Performs matrix multiplication
* [[Function:Divide|Divide]] - Divides pixel values of two image buffers
* [[Function:MatMulTrans|matMulTrans]] - Performs matrix multiplication with its transpose
* [[Function:EigenValsVecs|EigenValsVecs]] - Calculates eigen values and eigen vectors at each pixel in an image
* [[Function:Multiply|multiply]] - Multiplies pixel values of two images
* [[Function:Flip|FlipImage]] - Mirrors an image about a horizontal or vertical axis, or both
* [[Function:NOT|NOT]] - Inverts the bits of each pixel.
* [[Function:GoodFeaturesToTrack|GoodFeaturesToTrack]] - selects N best points on a image using KLT or Harris
* [[Function:OR|OR]] - Bitwise OR operation between two images.
* [[Function:Pow|pow]] - Raise each pixel to a specified power.
* [[Function:Round|round]] - Rounds each pixel to nearest integer value.
* [[Function:SHL|SHL]] - Left shift each pixel of an image
* [[Function:SHR|SHR]] - Right shift each pixel of an image
* [[Function:Sqrt|sqrt]] - Takes square root of each pixel of an image.
* [[Function:Subtract|subtract]] - Subtracts pixel values of two images.
* [[Function:XOR|XOR]] - Logical bitwise XOR operation between two images.
 
===Color Operations===
* [[Function:Adjust|adjust]] - Equivalent to MATLAB's imadjust
* [[Function:BorderMask|borderMask]] - Masks image borders with custom intensity
* [[Function:ChannelMerge|channelMerge]] - Merges R, G and B Channel to form a color image
* [[Function:ChannelSplit|channelSplit]] - Splits a three channel image into R, G and B channels
* [[Function:ColorPick|colorPick]] - Performs color segmentation of image by selecting a single color.
* [[Function:ColorTwist|colorTwist]] - Applies a color twist matrix to an image
* [[Function:Demosaic|demosaic]] - Restores an RGB image from a CFA Bayer image
* [[Function:DemosaicDFPD|'''demosaicDFPD''']] - Restores an RGB image from a CFA Bayer image using DFPD algorithm
* [[Function:GammaCorrect|gammaCorrect]] - Performs gamma correction of an image
* [[Function:Gray2rgb|gray2rgb]] - Copy a grayscale image to each channel of an RGB image.
* [[Function:HistEq|histEq]] - Performs histogram equalization
* [[Function:Hsv2rgb|hsv2rgb]] - Converts image from HSV color space to RGB.
* [[Function:ImageBinary|imageBinary]] - Converts input image into a binary image based on threshold
* [[Function:Lab2rgb|Lab2rgb]] - Converts image from CIE Lab color space to RGB.
* [[Function:LogTransform|logTransform]] - Applies log transformation for contrast enhancement of an image.
* [[Function:LUT|LUT]] - Remaps image values according to look up table
* [[Function:RGB2Gray|rgb2gray]] - Converts an RGB image to gray scale.
* [[Function:Rgb2hsv|rgb2hsv]] - Converts an RGB image to HSV color space.
* [[Function:Rgb2Lab|rgb2Lab]] - Converts an RGB image to CIE Lab color space.
* [[Function:Rgb2ycbcr|rgb2ycbcr]] - Converts an RGB image to YCbCr color space.
* [[Function:RGB2YUV|rgb2yuv]] - Converts RGB image to YUV color space.
* [[Function:Ycbcr2rgb|ycbcr2rgb]] - Converts YCbCr image to an RGB image.
* [[Function:YUV2RGB|yuv2rgb]] - Converts YUV image to an RGB image.
 
===Computer Vision===
* [[Function:EigenValsVecs|eigenValsVecs]] - Calculates eigen values and eigen vectors at each pixel in an image
* [[Function:GoodFeaturesToTrack|goodFeaturesToTrack]] - selects N best points on a image using KLT or Harris
* [[Function:MinEigenVal|minEigenVal]] - Calculates the minimum eigen value at each pixel in an image
* [[Function:OpticalFlowHS|opticalFlowHS]] - Calculates flow of each image pixel in two frames using Horn–Schunck method
* [[Function:opticalFlowPyrLKDense|opticalFlowPyrLKDense]] - Calculates flow of each image pixel in two frames using pyramidal Lucas–Kanade method
* [[Function:TrackFeatures|trackFeatures]] - Tracks input features from frame 1 onto frame 2 using KLT method
|
 
===Data Exchange===
* [[Function:BitConversion|bitConversion]] - Converts image pixel values from one data type to another.
* [[Function:ConvertScale|convertScale]] - Converts image data type with optional scaling.
* [[Function:GenerateRandomImage|generateRandomImage]] - Creates a new random image.
* [[Function:GetChannel|getChannel]] - Extracts a channel of an image.
* [[Function:PadImage|padImage]] - Pads any side of the image with the value specified.
* [[Function:Rectangle|rectangle]] - Draws a rectangle on the specified region of an image.
* [[Function:Threshold|threshold]] - Clamps image pixel values between specified thresholds.
 
===Geometry Transforms===
* [[Function:Crop|crop]] - Crops the desired portion of an image
* [[Function:Flip|flipImage]] - Mirrors an image about a horizontal or vertical axis, or both
* [[Function:Resize|resize]] - Resizes input image using specified interpolation
* [[Function:Rotate|rotate]] - Rotates an image about origin (0,0) or center
* [[Function:Transpose|transpose]] - Takes Transpose of the image
* [[Function:WarpAffine|warpAffine]] - Applies an affine transformation to an image.
* [[Function:WarpAffineBack|warpAffineBack]] - Applies an inverse affine transformation to an image.
 
===Image Filtering===
* [[Function:Enhance|'''enhance''']] - description
* [[Function:ImageFilter|imageFilter]] - Performs linear 1D and 2D image filtering
* [[Function:ImageGradients|imageGradients]] - Calculates X and Y gradients of image
* [[Function:MinFilter|minFilter]] - Filters an image using a min filter
* [[Function:MaxFilter|maxFilter]] - Filters an image using a max filter
* [[Function:MedianFilter|medianFilter]] - Applies 2D median filter on an image
 
===Image Statistics===
* [[Function:CalcHist|calcHist]] - Computes the histogram of an 8 bit image.
* [[Function:CountInRange|countInRange]] - Counts the number of pixels within the given intensity range
* [[Function:Max|max]] - Computes the maximum of image pixel values
* [[Function:Mean|mean]] - Computes the mean of image pixel values
* [[Function:MeanStdDev|meanStdDev]] - Computes the mean and standard deviation of image pixel values
* [[Function:Min|min]] - Computes the minimum of image pixel values
* [[Function:MinMax|minMax]] - Computes the minimum and maximum of image pixel values
* [[Function:Sum|sum]] - Computes the sum of image pixel values
 
===Image Transforms===
* [[Function:Fft2|fft2]] - Computes the 2D Fast Fourier Transform of an image.
* [[Function:FftGetProperty|fftGetProperty]] - Gets magnitude, phase, real and imaginary part of an FFT image with optional scaling.
* [[Function:FftShift|fftShift]] - Moves low frequency components to the center of an FFT image.
* [[Function:haarFwd|haarFwd]] - Performs one-level wavelet decomposition of an image using haar basis
* [[Function:haarFwd|haarFwd]] - Performs one-level wavelet decomposition of an image using haar basis
* [[Function:haarInv|haarInv]] - Performs one-level haar wavelet reconstruction of an image
* [[Function:haarInv|haarInv]] - Performs one-level haar wavelet reconstruction of an image
* [[Function:HistEq|HistEq]] - Performs histogram equalization
 
* [[Function:ImageBinary|ImageBinary]] - Converts input image into a binary image based on threshold
===Video Stabilization===
* [[Function:ImageGradients|ImageGradients]] - Calculates X and Y gradients of image
* [[Function:CuviMotionEstimator|CuviMotionEstimator]] - Class to estimate global motion vectors between an image pair.
* [[Function:ImageFilter|ImageFilter]] - Performs linear 1D and 2D image filtering
* [[Function:CuviVideoStabilizer|CuviVideoStabilizer]] - Class for transparent video stabilization of a video file.
* [[Function:Max|Max]] - Computes the maximum of image pixel values
* [[Function:MaxFilter|MaxFilter]] - Filters an image using a max filter
intensity values
* [[Function:Mean|Mean]] - Computes the mean of image pixel values
* [[Function:MeanStdDev|MeanStdDev]] - Computes the mean and standard deviation of image pixel values
* [[Function:Min|Min]] - Computes the minimum of image pixel values
* [[Function:MinEigenVal|MinEigenVal]] - Calculates the minimum eigen value at each pixel in an image
|
* [[Function:MinFilter|MinFilter]] - Filters an image using a min filter
* [[Function:MinMax|MinMax]] - Computes the minimum and maximum of image pixel values
* [[Function:Multiply|Multiply]] - Multiplies pixel values of two image buffers
* [[Function:NOT|NOT]] - Performs a bitwise NOT operation on each pixel
* [[Function:OpticalFlowHS|OpticalFlowHS]] - Calculates flow of each image pixel in two frames using Horn–Schunck method
* [[Function:opticalFlowPyrLKDense|opticalFlowPyrLKDense]] - Calculates flow of each image pixel in two frames using pyramidal Lucas–Kanade method
* [[Function:OR|OR]] - Combines corresponding pixels of two image buffers by a bitwise OR operation
* [[Function:Resize|Resize]] - Resizes input image using linear-interpolation
* [[Function:RGB2Gray|RGB2Gray]] - Converts an RGB image to gray scale using fixed transform coefficients.
* [[Function:RGB2YUV|RGB2YUV]] - Convert RGB image to YUV color model
* [[Function:RGBA2Gray|RGBA2Gray]] - Converts an RGBA image to gray scale using fixed transform
* [[Function:Rotate|Rotate]] - Rotates an image about origin (0,0) or center
* [[Function:Subtract|Subtract]] - Subtracts pixel values of two image buffers
* [[Function:Sum|Sum]] - Computes the sum of image pixel values
* [[Function:TrackFeatures|TrackFeatures]] - Tracks input features from frame 1 onto frame 2 using KLT method
* [[Function:Transpose|Transpose]] - Takes Transpose of the image
* [[Function:XOR|XOR]] - Combines corresponding pixels of two image buffers by a bitwise XOR operation
* [[Function:YUV2RGB|YUV2RGB]] - Convert YUV color model to an RGB image
|}
|}
<br/>
<br/>
Line 76: Line 133:
A C++ class to hold image data on the device. It has the following methods
A C++ class to hold image data on the device. It has the following methods
* CuviImage(); - default constructor
* CuviImage(); - default constructor
* CuviImage(CuviSize size, Cuvi32u depth, Cuvi32u channels) - Main Constructor. throws exception in case of failure
* CuviImage(CuviSize size, Cuvi32s depth, Cuvi32s channels) - Main Constructor. throws exception in case of failure
* CuviImage(const CuviImage&) - copy constructor
* CuviImage(const CuviImage&) - copy constructor
* CuviImage(const CuviMat&) - copy constructor to initialize from CuviMat
* upload(const void* pSrcHost, const Cuvi32s srcPitch) - Copy image data from host to device.
* Upload(void* pSrcHost, size_t srcPitch, CuviStream* stream = NULL) - Copy image data from host to device. Async operation supported
* upload(const void* pSrcHost, const Cuvi32s srcPitch, const CuviStream& stream) - Asynchronously copy image data from host to device.
* Download(void* pDstHost, size_t dstPitch, CuviStream* stream = NULL) - Copy image data from device to host
* download(void* pDstHost, const Cuvi32s dstPitch) - Copy image data from device to host
* Show(char* title = "CUVI Image",int milliseconds = 0) - Render device image directly on the screen
* download(void* pDstHost, const Cuvi32s dstPitch, const CuviStream& stream) - Asynchronously copy image data from device to host
* show(const std::string& title = "CUVI Image", Cuvi32s milliseconds = 0) - Render device image directly on the screen
* ~CuviImage() - Destructor. Frees Device Memory. throws exception in case of failure
* ~CuviImage() - Destructor. Frees Device Memory. throws exception in case of failure
|-
|style="width:100%; text-align: left;"|
===CuviMat===
A C structure to hold image data on the device. It has the following functions
* cuviCreateMat(CuviMat** mat, CuviSize size, Cuvi32u depth, Cuvi32u channels) - Allocates device memory to CuviMat
* cuviCloneMat(CuviMat** dstMat, CuviMat* srcMat, int copyData) - Creates an exact copy of a CuviMat, with optionally copying data
* cuviUploadData(CuviMat* dstMat, void* pSrcHost, size_t srcPitch, CuviStream* stream) - Copy data from host to CuviMat and supports async operation
* cuviDownloadData(CuviMat* srcMat, void* pDstHost, size_t dstPitch, CuviStream* stream) - Copy data from device back to host
* cuviDestroyMat(CuviImage** mat) - Frees device memory from CuviMat object
* cuviShowMat(char* title, CuviMat* mat, int milliseconds) - Renders a CuviMat directly on the screen for specified time


{|
{|
|-valign="top"
|-valign="top"
|style="width:50%;"|
|style="width:50%;"|
===Timer===
===Timer===
CUVI provides a C++ Timer class that accurately profiles your application timing
CUVI provides a C++ Timer class that accurately profiles your application timing
Line 105: Line 151:
* Stop() - Stops the timer
* Stop() - Stops the timer
* Reset() - Resets the timer
* Reset() - Resets the timer
* GetElapsedTime() - Returns the elapsed time between Start and Stop calls in microseconds
* GetElapsedTime() - Returns the elapsed time between Start and Stop calls in seconds
|style="width:50%; "|
|style="width:50%; "|
===DeviceProperties===
===DeviceProperties===
CuviDeviceProperties holds all the important properties of underlying CUDA device
CuviDeviceProperties holds all the important properties of underlying CUDA device. Device management functions are present inside the namespace cuvi::device.
*cuviGetDeviceCount() - Gives the count of devices installed in the machine
*Cuvi32s getDeviceCount() - Gives the count of devices installed in the machine
*cuviGetCurrentDeviceID() - Returns the ID of selected graphics card
*Cuvi32s getCurentDevice() - Returns the ID of selected graphics card
*cuviSetCurrentDevice() - Makes any device an active device
*CuviStatus setCurrentDevice(const Cuvi32s ID) - Makes any device an active device
*cuviGetDeviceProperties() - Returns all the important properties of desired GPU
*CuviStatus getDeviceProperties(const Cuvi32s deviceID, CuviDeviceProperties& props) - Returns all the important properties of desired GPU
|}
|}
|}
|}
<!-- CUVI Core Ends-->
<!-- CUVI Core Ends-->

Revision as of 18:27, 13 June 2014

This page provides a list of all the functionality available in the latest release of CUVI Library.

Modules

CUVI comes in following image processing modules.

  • Arithmetic & Logical
  • Color Operations
  • Computer Vision
  • Data Exchange
  • Geometry Transforms
  • Image Filtering
  • Image Statistics
  • Image Transforms
  • Video Stabilization


Function List

Arithmetic & Logical

  • abs - Computes absolute value of each image pixel
  • absDiff - Computes absolute difference between 2 images.
  • add - Adds two images
  • AND - Bitwise AND operation between two images.
  • cbrt - Computes cube root of each image pixel
  • ceil - Applies ceil function to each image pixel
  • divide - Divides pixel values of two images
  • exp - Computes exponential of each image pixel
  • floor - Applies floor function to each image pixel
  • invert - Computes matrix inverse using LU factorization
  • matMul - Performs matrix multiplication
  • matMulTrans - Performs matrix multiplication with its transpose
  • multiply - Multiplies pixel values of two images
  • NOT - Inverts the bits of each pixel.
  • OR - Bitwise OR operation between two images.
  • pow - Raise each pixel to a specified power.
  • round - Rounds each pixel to nearest integer value.
  • SHL - Left shift each pixel of an image
  • SHR - Right shift each pixel of an image
  • sqrt - Takes square root of each pixel of an image.
  • subtract - Subtracts pixel values of two images.
  • XOR - Logical bitwise XOR operation between two images.

Color Operations

  • adjust - Equivalent to MATLAB's imadjust
  • borderMask - Masks image borders with custom intensity
  • channelMerge - Merges R, G and B Channel to form a color image
  • channelSplit - Splits a three channel image into R, G and B channels
  • colorPick - Performs color segmentation of image by selecting a single color.
  • colorTwist - Applies a color twist matrix to an image
  • demosaic - Restores an RGB image from a CFA Bayer image
  • demosaicDFPD - Restores an RGB image from a CFA Bayer image using DFPD algorithm
  • gammaCorrect - Performs gamma correction of an image
  • gray2rgb - Copy a grayscale image to each channel of an RGB image.
  • histEq - Performs histogram equalization
  • hsv2rgb - Converts image from HSV color space to RGB.
  • imageBinary - Converts input image into a binary image based on threshold
  • Lab2rgb - Converts image from CIE Lab color space to RGB.
  • logTransform - Applies log transformation for contrast enhancement of an image.
  • LUT - Remaps image values according to look up table
  • rgb2gray - Converts an RGB image to gray scale.
  • rgb2hsv - Converts an RGB image to HSV color space.
  • rgb2Lab - Converts an RGB image to CIE Lab color space.
  • rgb2ycbcr - Converts an RGB image to YCbCr color space.
  • rgb2yuv - Converts RGB image to YUV color space.
  • ycbcr2rgb - Converts YCbCr image to an RGB image.
  • yuv2rgb - Converts YUV image to an RGB image.

Computer Vision

  • eigenValsVecs - Calculates eigen values and eigen vectors at each pixel in an image
  • goodFeaturesToTrack - selects N best points on a image using KLT or Harris
  • minEigenVal - Calculates the minimum eigen value at each pixel in an image
  • opticalFlowHS - Calculates flow of each image pixel in two frames using Horn–Schunck method
  • opticalFlowPyrLKDense - Calculates flow of each image pixel in two frames using pyramidal Lucas–Kanade method
  • trackFeatures - Tracks input features from frame 1 onto frame 2 using KLT method

Data Exchange

  • bitConversion - Converts image pixel values from one data type to another.
  • convertScale - Converts image data type with optional scaling.
  • generateRandomImage - Creates a new random image.
  • getChannel - Extracts a channel of an image.
  • padImage - Pads any side of the image with the value specified.
  • rectangle - Draws a rectangle on the specified region of an image.
  • threshold - Clamps image pixel values between specified thresholds.

Geometry Transforms

  • crop - Crops the desired portion of an image
  • flipImage - Mirrors an image about a horizontal or vertical axis, or both
  • resize - Resizes input image using specified interpolation
  • rotate - Rotates an image about origin (0,0) or center
  • transpose - Takes Transpose of the image
  • warpAffine - Applies an affine transformation to an image.
  • warpAffineBack - Applies an inverse affine transformation to an image.

Image Filtering

Image Statistics

  • calcHist - Computes the histogram of an 8 bit image.
  • countInRange - Counts the number of pixels within the given intensity range
  • max - Computes the maximum of image pixel values
  • mean - Computes the mean of image pixel values
  • meanStdDev - Computes the mean and standard deviation of image pixel values
  • min - Computes the minimum of image pixel values
  • minMax - Computes the minimum and maximum of image pixel values
  • sum - Computes the sum of image pixel values

Image Transforms

  • fft2 - Computes the 2D Fast Fourier Transform of an image.
  • fftGetProperty - Gets magnitude, phase, real and imaginary part of an FFT image with optional scaling.
  • fftShift - Moves low frequency components to the center of an FFT image.
  • haarFwd - Performs one-level wavelet decomposition of an image using haar basis
  • haarInv - Performs one-level haar wavelet reconstruction of an image

Video Stabilization


CUVI Core

CUVI Core includes the following helper functionality:

CuviImage

A C++ class to hold image data on the device. It has the following methods

  • CuviImage(); - default constructor
  • CuviImage(CuviSize size, Cuvi32s depth, Cuvi32s channels) - Main Constructor. throws exception in case of failure
  • CuviImage(const CuviImage&) - copy constructor
  • upload(const void* pSrcHost, const Cuvi32s srcPitch) - Copy image data from host to device.
  • upload(const void* pSrcHost, const Cuvi32s srcPitch, const CuviStream& stream) - Asynchronously copy image data from host to device.
  • download(void* pDstHost, const Cuvi32s dstPitch) - Copy image data from device to host
  • download(void* pDstHost, const Cuvi32s dstPitch, const CuviStream& stream) - Asynchronously copy image data from device to host
  • show(const std::string& title = "CUVI Image", Cuvi32s milliseconds = 0) - Render device image directly on the screen
  • ~CuviImage() - Destructor. Frees Device Memory. throws exception in case of failure

Timer

CUVI provides a C++ Timer class that accurately profiles your application timing

  • Start() - Starts the timer.
  • Stop() - Stops the timer
  • Reset() - Resets the timer
  • GetElapsedTime() - Returns the elapsed time between Start and Stop calls in seconds

DeviceProperties

CuviDeviceProperties holds all the important properties of underlying CUDA device. Device management functions are present inside the namespace cuvi::device.

  • Cuvi32s getDeviceCount() - Gives the count of devices installed in the machine
  • Cuvi32s getCurentDevice() - Returns the ID of selected graphics card
  • CuviStatus setCurrentDevice(const Cuvi32s ID) - Makes any device an active device
  • CuviStatus getDeviceProperties(const Cuvi32s deviceID, CuviDeviceProperties& props) - Returns all the important properties of desired GPU