PARP Research Group Universidad de Murcia


Image processing

Functions for Image Processing. More...

Classes

class  QVBRIEFDetector
 Simple implementation of BRIEF (Binary Robust Independent Elementary Features) descriptors. More...
class  QVComponentTree
 Image component tree data structure. More...
class  QVGenericImage
 Base class for QVImage objects. More...
class  QVImage< Type, Channels >
 Image representation class for the QVision. More...
class  QVKeypoint
 Class for image key point data-type. More...
class  QVPolyline
 Polyline representation. More...
class  QVPolylineF
 Floating point polyline representation. More...
class  QVSiftFeature
 Class for SIFT feature. More...

Modules

 GPU-KLT+FLOW wrapper functions and classes
 

Wrapper classes and functions for the GPU-KLT+FLOW software.


 MPlayer based image and video input/output
 

Classes and functions that use the MPlayer as a back-end application to perform video and image i/o

If available, the QVision can use the versatile and widely known MPlayer multimedia player as a back-end application. The programmer can cleanly use functionality to read from lots of video and image file formats and encodings, digital/analogical TV, video-cam and web-cams, remote streams, etc... You can read the documentation of classes QVMPlayerReader for further specifically info about reading video from a QVision application using MPlayer.


 IPP wrapper functions
 

Comprehensive set of wrapper functions for Intel(R) Integrated Performance Primitives (IPP).


 Linear time MSER implementation
 

Classes and functions that implement linear time MSER algorithm.


 SIFT GPU wrapper functions
 

Wrapper classes and functions for the GPU implementation of SIFT.


Defines

#define QVIMAGE_INIT_READ(TYPE, IMAGE)
 Initializes image to be read with macro QVIMAGE_PIXEL.
#define QVIMAGE_INIT_WRITE(TYPE, IMAGE)
 Initializes image to be written or read with macro QVIMAGE_PIXEL.
#define QVIMAGE_PTR_INIT_READ(TYPE, IMAGE)
 Initializes pointed image to be read with macro QVIMAGE_PIXEL.
#define QVIMAGE_PTR_INIT_WRITE(TYPE, IMAGE)
 Initializes pointed image to be written or read with macro QVIMAGE_PIXEL.
#define QVIMAGE_PIXEL(IMAGE, Col, Row, Channel)   (__qv_data_##IMAGE##__ [(Row)* __qv_step_##IMAGE##__ + __qv_planes_##IMAGE##__ *(Col)+(Channel)])
 Access an image pixel for inspection or modification.
#define QVIMAGE_PIXEL_PTR(IMAGE, Col, Row, Channel)   (& (__qv_data_##IMAGE##__ [(Row)* __qv_step_##IMAGE##__ + __qv_planes_##IMAGE##__ *(Col)+(Channel)]))
 Obtains a reference to the memory location of a pixel.
#define QVIMAGE_ROW_INCREMENT_PTR(IMAGE)   ( __qv_step_##IMAGE##__ )
 Obtains the increment for a row movement of a pixel.
#define QVIMAGE_COL_INCREMENT_PTR(IMAGE)   ( __qv_planes_##IMAGE##__ )
 Obtains the increment for a column movement of a pixel.
#define QVIMAGE_NEXT_LINE_INCREMENT_PTR(IMAGE)   ( __qv_next_line_inc_##IMAGE##__ )
 Obtains the location of the first pixel in a row, given the location of the last pixel in the upper row.

Enumerations

enum  FASTDetectionAlgorithm
 

FAST detection algorithms.

More...

Functions

bool saveBRIEFDescriptorsInLoweSIFTFileFormat (const QString fileName, const QVector< QPointF > features, const QVector< unsigned int > descriptors)
 Write a list of image features and BRIEF descriptors to a text file.
bool writeYUV4MPEG2Header (QFile &file, const int cols, const int rows, const int fps)
 Create a yuv4mpeg2 video file.
bool writeYUV4MPEG2Frame (QFile &file, const QVImage< uChar, 1 > imageY, const QVImage< uChar, 1 > imageU, const QVImage< uChar, 1 > imageV)
 Write YUV image frames to a yuv4mpeg2 video file.
bool writeYUV4MPEG2Frame (QFile &file, const QVImage< uChar, 1 > imageGray)
 Write YUV image frames to a yuv4mpeg2 video file.
bool writeYUV4MPEG2Frame (QFile &file, const QVImage< uChar, 3 > imageRGB)
 Write RGB image frames to a yuv4mpeg2 video file.
bool writeQVImageToFile (const QString fileName, const QVImage< uChar, 3 > &image)
 Write the content of a QVImage (RGB) object in an image file.
bool readQVImageFromFile (const QString fileName, QVImage< uChar, 3 > &image)
 Reads the content of a QVImage (RGB) object from an image file.
bool readYUV4MPEG2Frame (QFile &file, QVImage< uChar > &imageY, QVImage< uChar > &imageU, QVImage< uChar > &imageV)
 Read YUV image frames from a yuv4mpeg2 video file.
bool readYUV4MPEG2Header (QFile &file, int &cols, int &rows, int &fps)
 Read yuv4mpeg2 header from a video file.
QMap< sFloat, QPointF > maximalPoints (const QVImage< sFloat > &image, const double threshold=1.0, const int windowRadius=2)
 Finds luminance peaks in the input image.
void FilterLocalMax (const QVImage< sFloat > &src, QVImage< uChar > &dest, uInt colMaskSize, uInt rowMaskSize, sFloat threshold=0)
 Generates a binary image of local grey-scale maximal value pixels.This function receives a QVImage, and generates a binary image where each pixel is set to IPP_MAX_8U if the pixel in the original image is strict maximal in value regarding to pixels in a vicinity window of colMaskSize width, and rowMaskSize height.
QVector< QVector< QPoint > > CountingSort (const QVImage< uChar, 1 > &img)
 Sorts pixels in an image, given their gray-scale value.This function uses the Counting Sort algorithm to get an arrangement of the pixels of an input 8-bit image, regarding their gray-scale value. This arrangement is useful when you need to process the pixels of that image, which contain a certain gray-scale value.
double IterativePointElimination (const QVPolyline &polyline, QVPolyline &result, const double param, bool maxNumberOfPointsMethod=FALSE, bool intersectLines=TRUE, double *max_removed_cost=NULL)
 Eliminates points of a polyline of small shape contribution using the IPE algorithmThis function eliminates points of a QVPolylineF, simplifying it. Points are recursively eliminated while a) their distance to the line joining its two immediate neighbours is smaller than a given maximum value, or b) the number of points of the approximated polyline falls below a given number (depending on the chosen method).
double IterativePointElimination (const QVPolylineF &polyline, QVPolylineF &result, const double param, bool maxNumberOfPointsMethod=FALSE, bool intersectLines=TRUE, double *max_removed_cost=NULL)
 Eliminates points of a polyline of small shape contribution using the IPE algorithmThis is an overloaded version of the IterativePointElimination, provided for convenience. It simplifies floating point polylines.
QList< QVPolylinegetConnectedSetBorderContoursThreshold (const QVImage< uChar > &image, const uChar threshold=128)
 Obtains the borders of connected sets of pixels, containing gray-scale values equal or greater than a given threshold.This function thresholds an input image. Then it obtains the borders of the connected sets of the pixels remaining. An example of these connected sets, and the borders this function obtains can be seen in the following picture:
QList< QVPolylinegetLineContoursThreshold4Connectivity (const QVImage< uChar > &image, const uChar threshold=128)
 Obtains a list of the 4-connected pixel lines in the imageThis function can be used to obtain the 4-connected lines appearing in a border response image. It returns the lines as a QVPolyline objects.
QList< QVPolylinegetLineContoursThreshold8Connectivity (const QVImage< uChar > &image, const uChar threshold=128)
 Obtains a list of the 8-connected pixel lines in the imageThis function can be used to obtain the 8-connected lines appearing in a border response image. It returns the lines as a QVPolyline objects.
QList< QPointF > FASTFeatures (const QVImage< uChar, 1 > &image, const int threshold, const FASTDetectionAlgorithm &fastAlgorithm=Fast9)
 Obtains FAST features on an image-.
QVImage< uChar, 1 > FastLaplaceFilter (const QVImage< uChar, 1 > image)
 Applies a fast Laplace filter on the input image.
QVImage< uChar, 1 > FastSmoothFilter (const QVImage< uChar, 1 > image, const uChar threshold=0)
 Applies a fast smooth filter on the input image.
QVImage< uChar, 1 > SmoothFilter (const QVImage< uChar, 1 > image, const uChar threshold=0)
 Applies a smooth filter on the input image.
QList< QPointF > FastLaplacePoints (const QVImage< uChar, 1 > &image, const int threshold=40, const bool applyPreviousSmooth=true, const bool smoothResponseImage=true)
 Detects salient points in the Laplace response of an input image.
void getMSERContours (const QVImage< uChar, 1 > &image, const QList< QVMSER > &MSERList, QList< QVPolyline > &polylineMSERList)
 Obtains border contours for an MSER list, obtained with the function getMSER.
void getMSER (const QVImage< uChar, 1 > &image, QList< QVMSER > &MSERList, const int delta, const int minArea, const int maxArea, const double diffAreaThreshold)
 This algorithm obtains MSER's - from an image.This is an implementation of the MSER algorithm (see [Matas]. It does clustering of the MSER found in each node, keeping just the one with lowest q value. Also, small or large MSER are cleaned up using minimal and maximal areas permitted.
bool saveSIFTDescriptorsInLoweSIFTFileFormat (const QString &fileName, const QList< QVSiftFeature > &features)
 Write a list of SIFT image features to a text file in Lowe's SIFT file format.
bool QVImage::operator== (const QVImage< Type, Channels > &img) const
 Equality compare operator.

Detailed Description

Functions for Image Processing.

This package contains several useful image processing tools and computer vision algorithms and data types for the QVision. It basically includes image filtering functionality and several image feature detectors, most of which work on objects of The QVImage class.

QVision makes use of Intel's IPP library, and offers many of its functionality to QVision users by means of wrapper functions. These functions are contained in the package IPP wrapper functions, which you can check to learn more about it.

The basic image I/O functionality is based on Qt's ability to easily load/store images from and to PNG or JPG files, while video input is fundamentally covered by cooperation with the well known MPlayer media player. To create a new video file, and store image frames in it, or in the case the MPlayer is not available, the QVision also offers functions to create/read video files coded in the YUV4MPEG2 format. Refer to section Image and video input/output for details and examples on how to use this functionalities.

Todo:
Expand this documentation

Define Documentation

#define QVIMAGE_INIT_READ ( TYPE,
IMAGE   ) 
Value:
const TYPE * __qv_data_##IMAGE##__ = IMAGE.getReadData();               \
    const uInt __qv_step_##IMAGE##__ = IMAGE.getStep()/sizeof(TYPE);    \
    const uChar __qv_planes_##IMAGE##__  = IMAGE.getChannels();         \
    const uInt __qv_next_line_inc_##IMAGE##__ = __qv_step_##IMAGE##__ - IMAGE.getCols(); \
    Q_UNUSED (__qv_next_line_inc_##IMAGE##__) ;

Initializes image to be read with macro QVIMAGE_PIXEL.

This macro initializes an image to inspect or modify its contents using a set of pixel access macros. See section Image pixel access for detailed usage of this macro.

Parameters:
TYPE Type of the image. It should be the value of first template parameter specified for the image.
IMAGE Image name.
See also:
QVIMAGE_PIXEL
QVIMAGE_PIXEL_PTR

Definition at line 55 of file qvimage.h.

Referenced by CountingSort(), FilterLocalMax(), getConnectedSetBorderContoursThreshold(), getLineContoursThreshold4Connectivity(), getLineContoursThreshold8Connectivity(), maximalPoints(), QVImage< Type, Channels >::operator==(), and QVComponentTree::QVComponentTree().

#define QVIMAGE_INIT_WRITE ( TYPE,
IMAGE   ) 
Value:
TYPE * __qv_data_##IMAGE##__ = IMAGE.getWriteData();                    \
    const uInt __qv_step_##IMAGE##__ = IMAGE.getStep()/sizeof(TYPE);    \
    const uChar __qv_planes_##IMAGE##__  = IMAGE.getChannels();         \
    const uInt __qv_next_line_inc_##IMAGE##__ = __qv_step_##IMAGE##__ - IMAGE.getCols(); \
    Q_UNUSED (__qv_next_line_inc_##IMAGE##__) ;

Initializes image to be written or read with macro QVIMAGE_PIXEL.

This macro initializes an image to inspect or modify its contents using a set of pixel access macros. See section Image pixel access for detailed usage of this macro.

Parameters:
TYPE Type of the image. It should be the value of first template parameter specified for the image.
IMAGE Image name.
See also:
QVIMAGE_PIXEL
QVIMAGE_PIXEL_PTR

Definition at line 74 of file qvimage.h.

Referenced by FilterLocalMax(), getConnectedSetBorderContoursThreshold(), and QVComponentTree::QVComponentTree().

#define QVIMAGE_PTR_INIT_READ ( TYPE,
IMAGE   ) 
Value:
const TYPE * __qv_data_##IMAGE##__ = IMAGE->getReadData();              \
    const uInt __qv_step_##IMAGE##__ = IMAGE->getStep()/sizeof(TYPE);   \
    const uChar __qv_planes_##IMAGE##__  = IMAGE->getChannels();                \
    const uInt __qv_next_line_inc_##IMAGE##__ = __qv_step_##IMAGE##__ - IMAGE->getCols(); \
    Q_UNUSED (__qv_next_line_inc_##IMAGE##__) ;

Initializes pointed image to be read with macro QVIMAGE_PIXEL.

This macro initializes a pointed image to inspect its contents using a set of pixel access macros. See section Image pixel access for detailed usage of this macro.

Parameters:
TYPE Type of the image. It should be the value of first template parameter specified for the image.
IMAGE Name of the pointer variable that points to the image.
See also:
QVIMAGE_PIXEL
QVIMAGE_PIXEL_PTR

Definition at line 93 of file qvimage.h.

Referenced by QVImage< Type, Channels >::operator==().

#define QVIMAGE_PTR_INIT_WRITE ( TYPE,
IMAGE   ) 
Value:
TYPE * __qv_data_##IMAGE##__ = IMAGE->getWriteData();                                                           \
    const uInt __qv_step_##IMAGE##__ = IMAGE->getStep()/sizeof(TYPE);                                           \
    const uChar __qv_planes_##IMAGE##__  = IMAGE->getChannels();                                                        \
    const uInt __qv_next_line_inc_##IMAGE##__ = __qv_step_##IMAGE##__ - __qv_planes_##IMAGE##__ * IMAGE->getCols(); \
    Q_UNUSED (__qv_next_line_inc_##IMAGE##__) ;

Initializes pointed image to be written or read with macro QVIMAGE_PIXEL.

This macro initializes a pointed image to inspect or modify its contents using a set of pixel access macros. See section Image pixel access for detailed usage of this macro.

Parameters:
TYPE Type of the image. It should be the value of first template parameter specified for the image.
IMAGE Name of the pointer variable that points to the image.
See also:
QVIMAGE_PIXEL
QVIMAGE_PIXEL_PTR

Definition at line 112 of file qvimage.h.

#define QVIMAGE_PIXEL ( IMAGE,
Col,
Row,
Channel   )     (__qv_data_##IMAGE##__ [(Row)* __qv_step_##IMAGE##__ + __qv_planes_##IMAGE##__ *(Col)+(Channel)])

Access an image pixel for inspection or modification.

This macro can be used to access arbitrary pixels in an image, with a good time performance. See section Image pixel access for detailed usage of this macro.

See also:
QVIMAGE_INIT_READ
QVIMAGE_INIT_WRITE
QVIMAGE_PTR_INIT_READ
QVIMAGE_PTR_INIT_WRITE

Definition at line 131 of file qvimage.h.

Referenced by CountingSort(), FilterLocalMax(), getConnectedSetBorderContoursThreshold(), getLineContoursThreshold4Connectivity(), getLineContoursThreshold8Connectivity(), maximalPoints(), QVImage< Type, Channels >::operator==(), and QVComponentTree::QVComponentTree().

#define QVIMAGE_PIXEL_PTR ( IMAGE,
Col,
Row,
Channel   )     (& (__qv_data_##IMAGE##__ [(Row)* __qv_step_##IMAGE##__ + __qv_planes_##IMAGE##__ *(Col)+(Channel)]))

Obtains a reference to the memory location of a pixel.

This macro can be used to obtain the location of arbitrary pixels in an image, with a good time performance. See section Image pixel access for detailed usage of this macro.

See also:
QVIMAGE_INIT_READ
QVIMAGE_INIT_WRITE
QVIMAGE_PTR_INIT_READ
QVIMAGE_PTR_INIT_WRITE

Definition at line 146 of file qvimage.h.

#define QVIMAGE_ROW_INCREMENT_PTR ( IMAGE   )     ( __qv_step_##IMAGE##__ )

Obtains the increment for a row movement of a pixel.

This macro can be used to navigate through the contents of an image given an initial pointer to its contents. See section Image pixel access for detailed usage of this macro.

See also:
QVIMAGE_PIXEL_PTR

Definition at line 158 of file qvimage.h.

#define QVIMAGE_COL_INCREMENT_PTR ( IMAGE   )     ( __qv_planes_##IMAGE##__ )

Obtains the increment for a column movement of a pixel.

Todo:
Las macros de acceso a pixel secuenciales no funcionan. Revisar.

This macro can be used to navigate through the contents of an image given an initial pointer to its contents. See section Image pixel access for detailed usage of this macro.

See also:
QVIMAGE_PIXEL_PTR

Definition at line 170 of file qvimage.h.

#define QVIMAGE_NEXT_LINE_INCREMENT_PTR ( IMAGE   )     ( __qv_next_line_inc_##IMAGE##__ )

Obtains the location of the first pixel in a row, given the location of the last pixel in the upper row.

This macro can be used to navigate through the contents of an image given an initial pointer to its contents. See section Image pixel access for detailed usage of this macro.

See also:
QVIMAGE_PIXEL_PTR

Definition at line 181 of file qvimage.h.


Enumeration Type Documentation

FAST detection algorithms.

Definition at line 308 of file qvip.h.


Function Documentation

bool saveBRIEFDescriptorsInLoweSIFTFileFormat ( const QString  fileName,
const QVector< QPointF >  features,
const QVector< unsigned int >  descriptors 
)

Write a list of image features and BRIEF descriptors to a text file.

Write a list of image features and BRIEF descriptors to a text file in Lowe's SIFT file format.

This function writes a list of image features and their associated BRIEF descriptors in a .key file in the same output format used by David Lowe's SIFT detector to store the SIFT descriptors and the features detected on an input image.

The following is an extract of the documentation for Lowe's implementation, which describes this output format:

The file format starts with 2 integers giving the total number of
keypoints and the length of the descriptor vector for each keypoint
(128). Then the location of each keypoint in the image is specified by
4 floating point numbers giving subpixel row and column location,
scale, and orientation (in radians from -PI to PI).  Obviously, these
numbers are not invariant to viewpoint, but can be used in later
stages of processing to check for geometric consistency among matches.
Finally, the invariant descriptor vector for the keypoint is given as
a list of 128 integers in range [0,255].  Keypoints from a new image
can be matched to those from previous images by simply looking for the
descriptor vector with closest Euclidean distance among all vectors
from previous images.
Parameters:
fileName Name for the descriptor's file.
features List containing the location for the image features.
descriptors List containing the corresponding descriptors for these features.

This function writes a list of image features and their associated BRIEF descriptors in a .key file in the same output format used by the applicationDavid Lowe's SIFT detector to store the SIFT descriptors and the features detected on an input image.

The following is an extract of the documentation for Lowe's implementation, which describes this output format:

The file format starts with 2 integers giving the total number of
keypoints and the length of the descriptor vector for each keypoint
(128). Then the location of each keypoint in the image is specified by
4 floating point numbers giving subpixel row and column location,
scale, and orientation (in radians from -PI to PI).  Obviously, these
numbers are not invariant to viewpoint, but can be used in later
stages of processing to check for geometric consistency among matches.
Finally, the invariant descriptor vector for the keypoint is given as
a list of 128 integers in range [0,255].  Keypoints from a new image
can be matched to those from previous images by simply looking for the
descriptor vector with closest Euclidean distance among all vectors
from previous images.
Parameters:
fileName Name for the descriptor's file.
features List containing the location for the image features.
descriptors List containing the corresponding descriptors for these features.
See also:
QVBRIEFDetector

Write a list of image features and BRIEF descriptors to a text file.

This function writes a list of image features and their associated BRIEF descriptors in a .key file in the same output format used by the applicationDavid Lowe's SIFT detector to store the SIFT descriptors and the features detected on an input image.

The following is an extract of the documentation for Lowe's implementation, which describes this output format:

The file format starts with 2 integers giving the total number of
keypoints and the length of the descriptor vector for each keypoint
(128). Then the location of each keypoint in the image is specified by
4 floating point numbers giving subpixel row and column location,
scale, and orientation (in radians from -PI to PI).  Obviously, these
numbers are not invariant to viewpoint, but can be used in later
stages of processing to check for geometric consistency among matches.
Finally, the invariant descriptor vector for the keypoint is given as
a list of 128 integers in range [0,255].  Keypoints from a new image
can be matched to those from previous images by simply looking for the
descriptor vector with closest Euclidean distance among all vectors
from previous images.
Parameters:
fileName Name for the descriptor's file.
features List containing the location for the image features.
descriptors List containing the corresponding descriptors for these features.
See also:
QVBRIEFDetector

Definition at line 66 of file qvbriefdetector.cpp.

bool writeYUV4MPEG2Header ( QFile &  file,
const int  cols,
const int  rows,
const int  fps 
)

Create a yuv4mpeg2 video file.

This function stores the header for a video sequence in YUV4MPEG2 format in a newly created file. It can be used in conjunction with any of the versions of the writeYUV4MPEG2Frame functions to store a flow of images in a video file.

See section Writing to YUV4MPEG video files. for further info about the usage of this function.

Parameters:
file The input file object. It must be already opened when received as argument by this function.
cols The number of columns that the video in the file should have.
rows The number of rows that the video in the file should have.
fps The number of frames per second that the video sequence will have.
See also:
writeYUV4MPEG2Frame(QFile &, const QVImage<uChar,1>, const QVImage<uChar,1>, const QVImage<uChar,1>);
writeYUV4MPEG2Frame(QFile &, const QVImage<uChar,3>);

Definition at line 48 of file qvimageio.cpp.

bool writeYUV4MPEG2Frame ( QFile &  file,
const QVImage< uChar, 1 >  imageY,
const QVImage< uChar, 1 >  imageU,
const QVImage< uChar, 1 >  imageV 
)

Write YUV image frames to a yuv4mpeg2 video file.

This function stores a YUV frame in a YUV4MPEG2 video file. The parameters of this function must be three images containing the three channels for the YUV image. For further information about its usage, see documentation for function writeYUV4MPEG2Header.

See section Writing to YUV4MPEG video files. for further info about the usage of this function.

Parameters:
file The input file object. It must be already opened when received as argument by this function.
imageY Image object containing the Y channel for the YUV image, to store in the video file.
imageU Image object containing the Y channel for the YUV image, to store in the video file.
imageV Image object containing the Y channel for the YUV image, to store in the video file.
See also:
writeYUV4MPEG2Header

Definition at line 55 of file qvimageio.cpp.

Referenced by writeYUV4MPEG2Frame().

bool writeYUV4MPEG2Frame ( QFile &  file,
const QVImage< uChar, 1 >  imageGray 
)

Write YUV image frames to a yuv4mpeg2 video file.

This function stores a gray scale frame in a YUV4MPEG2 video file. The parameter of this function is a single 1-channel image, containing the gray scale image. For further information about its usage, see documentation for function writeYUV4MPEG2Header.

See section Writing to YUV4MPEG video files. for further info about the usage of this function.

Parameters:
file The input file object. It must be already opened when received as argument by this function.
imageGray Gray scale image to store in the video file.
See also:
writeYUV4MPEG2Header

Definition at line 70 of file qvimageio.cpp.

bool writeYUV4MPEG2Frame ( QFile &  file,
const QVImage< uChar, 3 >  imageRGB 
)

Write RGB image frames to a yuv4mpeg2 video file.

This is an overloaded version of the function writeYUV4MPEG2Frame(QFile &, const QVImage<uChar,3>) provided for convenience. This version stores a RGB frame in a YUV4MPEG2 video file. The parameter of this function is a single 3-channel image containing the RGB image. For further information about its usage, see documentation for function writeYUV4MPEG2Header.

See section Writing to YUV4MPEG video files. for further info about the usage of this function.

Note:
This function is based on functionality from the Intel IPP library. Thus compatibility with that library must be enabled to be available.
Parameters:
file The input file object. It must be already opened when received as argument by this function.
imageRGB RGB image object, to store in the video file.
See also:
writeYUV4MPEG2Header

Definition at line 82 of file qvimageio.cpp.

bool writeQVImageToFile ( const QString  fileName,
const QVImage< uChar, 3 > &  image 
)

Write the content of a QVImage (RGB) object in an image file.

Parameters:
fileName The name of the image file to create. It is overwritten if already exists. File format is inferred from fileName suffix. Supported formats: BMP,JPG,PNG,PPM,TIFF,XBM,XPM.
image The image to store in the file.
Returns:
TRUE if success, FALSE otherwise.

Definition at line 95 of file qvimageio.cpp.

bool readQVImageFromFile ( const QString  fileName,
QVImage< uChar, 3 > &  image 
)

Reads the content of a QVImage (RGB) object from an image file.

Parameters:
fileName The name of the image file to read from. File format is inferred from fileName suffix. Supported formats: BMP,JPG,PNG,PPM,TIFF,XBM,XPM,GIF,PBM,PGM.
image The image to store in the file.
Returns:
TRUE if success, FALSE otherwise.

Definition at line 98 of file qvimageio.cpp.

bool readYUV4MPEG2Frame ( QFile &  file,
QVImage< uChar > &  imageY,
QVImage< uChar > &  imageU,
QVImage< uChar > &  imageV 
)

Read YUV image frames from a yuv4mpeg2 video file.

This function retrieves a frame from a video file coded in YUV format. The parameters of this function must be three images to store the three channels for the YUV image.

See section Reading from YUV4MPEG video files. for further info about the usage of this function.

Parameters:
file The input file object. It must be already opened when received as argument by this function.
imageY Image object to contain the Y channel for the YUV image, to store in the video file.
imageU Image object to contain the U channel for the YUV image, to store in the video file.
imageV Image object to contain the V channel for the YUV image, to store in the video file.
See also:
readYUV4MPEG2Header

Definition at line 177 of file qvimageio.cpp.

bool readYUV4MPEG2Header ( QFile &  file,
int &  cols,
int &  rows,
int &  fps 
)

Read yuv4mpeg2 header from a video file.

This function reads the header of a video file encoded in yuv4mpeg2 format. This header contains information about the size of the frames in the video file, as well as the number of frames per second of the video sequence.

See section Reading from YUV4MPEG video files. for further info about the usage of this function.

Parameters:
file The input file object. It must be already opened when received as argument by this function.
cols (output parameter) Number of cols read in the header
rows (output parameter) Number of rows read in the header
fps (output parameter) Video fps read in the header
See also:
readYUV4MPEG2Frame

Definition at line 136 of file qvimageio.cpp.

QMap<sFloat, QPointF> maximalPoints ( const QVImage< sFloat > &  image,
const double  threshold = 1.0,
const int  windowRadius = 2 
)

Finds luminance peaks in the input image.

Todo:
document this

Definition at line 524 of file qvip.cpp.

void FilterLocalMax ( const QVImage< sFloat > &  src,
QVImage< uChar > &  dest,
uInt  colMaskSize,
uInt  rowMaskSize,
sFloat  threshold = 0 
)

Generates a binary image of local grey-scale maximal value pixels.This function receives a QVImage, and generates a binary image where each pixel is set to IPP_MAX_8U if the pixel in the original image is strict maximal in value regarding to pixels in a vicinity window of colMaskSize width, and rowMaskSize height.

Todo:
  • Fix resulting image ROI, obtain maximums restricted to the ROI.
  • Use IPP functions to obtain the result.
Parameters:
src source image.
dest binary image that will contain maximal values.
colMaskSize width of the vicinity.
rowMaskSize height of the vicinity.

Definition at line 390 of file qvip.cpp.

QVector< QVector< QPoint > > CountingSort ( const QVImage< uChar, 1 > &  img  ) 

Sorts pixels in an image, given their gray-scale value.This function uses the Counting Sort algorithm to get an arrangement of the pixels of an input 8-bit image, regarding their gray-scale value. This arrangement is useful when you need to process the pixels of that image, which contain a certain gray-scale value.

Parameters:
img Image to obtain the pixel arrangement.
Returns:
A vector of 256 lists of points. The element n of the vector is the list of the image pixels (points) that contain the gray-scale value n.

Definition at line 58 of file qvip.cpp.

double IterativePointElimination ( const QVPolyline polyline,
QVPolyline result,
const double  param,
bool  maxNumberOfPointsMethod = FALSE,
bool  intersectLines = TRUE,
double *  max_removed_cost = NULL 
)

Eliminates points of a polyline of small shape contribution using the IPE algorithmThis function eliminates points of a QVPolylineF, simplifying it. Points are recursively eliminated while a) their distance to the line joining its two immediate neighbours is smaller than a given maximum value, or b) the number of points of the approximated polyline falls below a given number (depending on the chosen method).

The return value (which indicates the cost of the first not deleted point) and the optional parameter max_removed_cost are useful to estimate a measure of how well the polyline approximation did. A good approximation will have (relative) low max_removed_cost/return_cost ratio, and (absolute) low max_removed_cost value.

Parameters:
polyline polyline to simplify.
result will store resulting simplified polyline.
param maximal distance for a point to eliminate it, if maxNumberOfPointsMethod is FALSE, or maximal number of points in the result polyline, if maxNumberOfPointsMethod is TRUE.
maxNumberOfPointsMethod if TRUE, the procedure ends when the number of points of the resulting polyline is lesser or equal to param. If FALSE, the procedure ends when there are no more points with distance to line given by its neighbours smaller than param.
intersectLines If TRUE, a post-processing stage adjusts final points using all the deleted points among vertexes to fit straight lines, whose intersection by pairs gives the final points (recommended for greater precision, at a minimal additional cost).
max_removed_cost If not NULL, pointer to a float value that the procedure will fill with the maximum cost (distance to corresponding line) of all the removed points.
Returns:
The function returns the cost value of the first NOT deleted point of the polyline.
See also:
IterativePointElimination(const QVPolylineF &, QVPolyline &, const double, bool, bool, double *);

Definition at line 671 of file qvip.cpp.

double IterativePointElimination ( const QVPolylineF polyline,
QVPolylineF result,
const double  param,
bool  maxNumberOfPointsMethod = FALSE,
bool  intersectLines = TRUE,
double *  max_removed_cost = NULL 
)

Eliminates points of a polyline of small shape contribution using the IPE algorithmThis is an overloaded version of the IterativePointElimination, provided for convenience. It simplifies floating point polylines.

See also:
IterativePointElimination(const QVPolyline &, QVPolyline &, const double, bool, bool, double *);
Note:
If GSL compatibility is not enabled, the re-estimation of the segments intersection will not be done. Thus the parameter intersectLines will always be considered false.

Definition at line 893 of file qvip.cpp.

QList<QVPolyline> getConnectedSetBorderContoursThreshold ( const QVImage< uChar > &  image,
const uChar  threshold = 128 
)

Obtains the borders of connected sets of pixels, containing gray-scale values equal or greater than a given threshold.This function thresholds an input image. Then it obtains the borders of the connected sets of the pixels remaining. An example of these connected sets, and the borders this function obtains can be seen in the following picture:

bordercontours.png

Circles indicate the first of the pixels in each border set. The last of the pixels in each detected border is indicated with an asterisk. The function detects inner and outer borders for each connected set. The image displays inner borders in blue color, and outer borders in red color.

The function returns a list of polylines, each one representing a different border.

Parameters:
image Image to obtain from the borders.
threshold Threshold separating the pixels inside and outside the connected sets.
Returns:
A list, containing the polylines corresponding to the borders of the connected sets.

Definition at line 1349 of file qvip.cpp.

QList<QVPolyline> getLineContoursThreshold4Connectivity ( const QVImage< uChar > &  image,
const uChar  threshold = 128 
)

Obtains a list of the 4-connected pixel lines in the imageThis function can be used to obtain the 4-connected lines appearing in a border response image. It returns the lines as a QVPolyline objects.

A pixel will be considered as a line pixel if it contains a gray-scale value equal or larger than the given threshold.

contours4connected.png

Circles indicate the first of the pixels in each line. The last of the pixels in each detected line is indicated with an asterisk. Ambiguous situations (such as pixels with more than two 4-connected neighbor pixels) return unpredictable joining results.

Parameters:
image image from were to obtain the polylines.
threshold threshold to test if a pixel is considered a line pixels or not.
Returns:
the list of contours (as QVPolyline) in the image.
See also:
Canny

Definition at line 1528 of file qvip.cpp.

QList<QVPolyline> getLineContoursThreshold8Connectivity ( const QVImage< uChar > &  image,
const uChar  threshold = 128 
)

Obtains a list of the 8-connected pixel lines in the imageThis function can be used to obtain the 8-connected lines appearing in a border response image. It returns the lines as a QVPolyline objects.

A pixel will be considered as a line pixel if it contains a gray-scale value equal or larger than the given threshold.

contours8connected.png

Circles indicate the first of the pixels in each line. The last of the pixels in each detected line is indicated with an asterisk. Ambiguous situations (such as pixels with more than two 4-connected neighbor pixels) return unpredictable joining results.

Parameters:
image image from were to obtain the polylines.
threshold threshold to test if a pixel is considered a border or not.
Returns:
the list of contours (as QVPolyline) in the image.
See also:
Canny

Definition at line 1651 of file qvip.cpp.

QList<QPointF> FASTFeatures ( const QVImage< uChar, 1 > &  image,
const int  threshold,
const FASTDetectionAlgorithm fastAlgorithm = Fast9 
)

Obtains FAST features on an image-.

Note:
This function is a wrapper function for Edward Rosten's FAST detector implementation.
Parameters:
image Input image.
threshold Threshold value for the FAST algorithm.
fastAlgorithm One of the four versions of the FAST detector.
Returns:
List of locations for the FAST features in the image.

Definition at line 555 of file qvip.cpp.

QVImage<uChar, 1> FastLaplaceFilter ( const QVImage< uChar, 1 >  image  ) 

Applies a fast Laplace filter on the input image.

This function returns the following $ 3 \times 3 $ matrix, corresponding to the intrinsic calibration matrix of a camera:

Obtains an image containing the absolute values corresponding to the image filtered with the following convolution kernel:

$K = \frac{1}{8}\left(\begin{array}{ccc} 0 & -1 & 0 \\ -1 & 4 & -1 \\ 0 & -1 & 0 \end{array}\right)$

Parameters:
image Input image.

Definition at line 1723 of file qvip.cpp.

Referenced by FastLaplacePoints().

QVImage<uChar, 1> FastSmoothFilter ( const QVImage< uChar, 1 >  image,
const uChar  threshold = 0 
)

Applies a fast smooth filter on the input image.

This function convolutes the image with the following filter:

$K = \frac{1}{8}\left(\begin{array}{ccc} 0 & 1 & 0 \\ 1 & 4 & 1 \\ 0 & 1 & 0 \end{array}\right)$

Parameters:
image Input image.
threshold pixels with a value velow this threshold will be set to zero directly.

Definition at line 1769 of file qvip.cpp.

Referenced by FastLaplacePoints().

QVImage<uChar, 1> SmoothFilter ( const QVImage< uChar, 1 >  image,
const uChar  threshold = 0 
)

Applies a smooth filter on the input image.

This function convolutes the image with the following filter:

$K = \frac{1}{16}\left(\begin{array}{ccc} 1 & 2 & 1 \\ 2 & 4 & 2 \\ 1 & 2 & 1 \end{array}\right)$

Parameters:
image Input image.
threshold pixels with a value velow this threshold will be set to zero directly.

Definition at line 1820 of file qvip.cpp.

QList<QPointF> FastLaplacePoints ( const QVImage< uChar, 1 > &  image,
const int  threshold = 40,
const bool  applyPreviousSmooth = true,
const bool  smoothResponseImage = true 
)

Detects salient points in the Laplace response of an input image.

This function uses FastLaplaceFilter and getLocalExtremaPixels to detect maximal pixels in the Laplace response image.

Parameters:
image Input image.
threshold Ignore pixels in the Laplace response image with a value velow this threshold. Set it to a non-zero value to speed up the maximal detection.
applyPreviousSmooth Apply a fast smooth on the input image using the function FastSmoothFilter before obtaining the Laplace response image.
smoothResponseImage Apply a fast smooth on the Laplace response image before the maximal pixel detection.

Definition at line 1876 of file qvip.cpp.

void getMSERContours ( const QVImage< uChar, 1 > &  image,
const QList< QVMSER > &  MSERList,
QList< QVPolyline > &  polylineMSERList 
)

Obtains border contours for an MSER list, obtained with the function getMSER.

Parameters:
image image to obtain border contours of MSER. Should be the same used with the function getMSER, if that was the one used to obtain MSER list.
MSERList list of MSER. It generally will be obtain using the function getMSER.
polylineMSERList list of border contours, represented as QVPolyline objects.
See also:
getMSER

Definition at line 28 of file qvmser.cpp.

void getMSER ( const QVImage< uChar, 1 > &  image,
QList< QVMSER > &  MSERList,
const int  delta,
const int  minArea,
const int  maxArea,
const double  diffAreaThreshold 
)

This algorithm obtains MSER's - from an image.This is an implementation of the MSER algorithm (see [Matas]. It does clustering of the MSER found in each node, keeping just the one with lowest q value. Also, small or large MSER are cleaned up using minimal and maximal areas permitted.

REFERENCES:

  • Robust Wide Baseline Stereo from Maximally Stable Extremal Regions. J. Matas et al.
  • An implementation of Multi-Dimensional Maximally Stable Extremal Regions. Andrea Vedaldi.
    Parameters:
    image image to obtain MSER's from.
    MSERList list that will contain obtained MSER's.
    delta Delta parameter from the [Matas] paper.
    minArea MSER of area lesser than this value are discarted.
    maxArea MSER of area greater than this value are discarted.
    diffAreaThreshold MSER found to have a relative difference of areas lesser to that value are clustered together, and
    See also:
    getMSERContours the algorithm just keeps the one with lesser q value, discarding the others.

Definition at line 48 of file qvmser.cpp.

bool saveSIFTDescriptorsInLoweSIFTFileFormat ( const QString &  fileName,
const QList< QVSiftFeature > &  features 
)

Write a list of SIFT image features to a text file in Lowe's SIFT file format.

This function writes a list of SIFT features and their associated descriptors in a .key file in the same output format used by the application David Lowe's SIFT detector to store the SIFT descriptors and the features detected on an input image.

The following is an extract of the documentation for Lowe's implementation, which describes this output format:

The file format starts with 2 integers giving the total number of
keypoints and the length of the descriptor vector for each keypoint
(128). Then the location of each keypoint in the image is specified by
4 floating point numbers giving subpixel row and column location,
scale, and orientation (in radians from -PI to PI).  Obviously, these
numbers are not invariant to viewpoint, but can be used in later
stages of processing to check for geometric consistency among matches.
Finally, the invariant descriptor vector for the keypoint is given as
a list of 128 integers in range [0,255].  Keypoints from a new image
can be matched to those from previous images by simply looking for the
descriptor vector with closest Euclidean distance among all vectors
from previous images.
Parameters:
fileName Name for the descriptor's file.
features List of SIFT features.

Definition at line 31 of file qvsiftfeature.cpp.

template<typename Type, int C>
bool QVImage< Type, C >::operator== ( const QVImage< Type, C > &  img  )  const [inline, inherited]

Equality compare operator.

Comparison operator for QVImage objects.

This operator will compare two images of same bit depth and channel number, and will return true if images are equal in all of these:

  • dimensions (cols and rows).
  • region of interest.
  • content of region of interest. returning false otherwise.
Parameters:
img image to compare with this image.

Definition at line 985 of file qvimage.h.




QVision framework. PARP research group. Copyright © 2007, 2008, 2009, 2010, 2011.