Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of ACCESS_FAST in OpenCV 3.0?

To get cv::UMat from a cv::Mat in OpenCV 3.0, you use this function :

UMat cv::Mat::getUMat(int accessFlags, UMatUsageFlags usageFlags=USAGE_DEFAULT )

the variable accessFlags is an enumeration type that takes one of the values below:

enum { ACCESS_READ=1<<24, ACCESS_WRITE=1<<25,
    ACCESS_RW=3<<24, ACCESS_MASK=ACCESS_RW, ACCESS_FAST=1<<26 };

What is the purpose of using the value ACCESS_FAST?

like image 802
ProEns08 Avatar asked Dec 27 '15 16:12

ProEns08


People also ask

What is UMat OpenCV?

Although some developers never heard about UMat class and its advantages. The UMat class tells OpenCV functions to process images with an OpenCL-specific code which uses an OpenCL-enabled GPU if exists in the system (automatically switching to CPU otherwise).

What is CV_8UC3?

so CV_8UC3 is an 8-bit unsigned integer matrix/image with 3 channels. Although it is most common that this means an RGB (or actually BGR) image, it does not mandate it. It simply means that there are three channels, and how you use them is up to you and your application.

What is Vec3b OpenCV?

Vec3b is the abbreviation for "vector with 3 byte entries" Here those byte entries are unsigned char values to represent values between 0 .. 255.

What is Vec4i?

Vec4i is a structure for representing a vector with 4 dimensions, with each value an int. If you look at the HoughLinesP() documentation you'll see what each dimension in is in this particular case: lines – Output vector of lines.


1 Answers

ACCESS_FAST is only used in the allocate function to use memcpy or create a temporary mat if ACCESS_FAST is not specified. It was added to OpenCV as part of its OpenCL Shared Virtual Memory support.

cv::Mat::getUMat() will allocate a new UMat and return it, forwarding accessFlags when allocating the new matrix. If you aren't building OpenCV with OpenCL support, then ACCESS_FAST seems mostly useless.

I'm afraid that's the limit of my knowledge. Someone more experienced with OpenCV will have to provide more a detailed answer/documentation on exactly what ACCESS_FAST is intended for.

like image 91
Cornstalks Avatar answered Sep 30 '22 07:09

Cornstalks