Read@CVL
rdf::Image Namespace Reference

Basic image class More...

Functions

DllCoreExport cv::Mat qImage2Mat (const QImage &img)
 Converts a QImage to a cv::Mat. More...
 
DllCoreExport QImage mat2QImage (const cv::Mat &img, bool toRGB=false)
 Converts a cv::Mat to QImage. More...
 
DllCoreExport cv::Mat qVector2Mat (const QVector< float > &data)
 
DllCoreExport QImage load (const QString &path, bool *ok=0)
 
DllCoreExport bool save (const QImage &img, const QString &savePath, int compression=-1)
 Saves the specified QImage img. More...
 
DllCoreExport bool save (const cv::Mat &img, const QString &savePath, int compression=-1)
 Saves the specified cv::Mat img. More...
 
DllCoreExport bool alphaChannelUsed (const QImage &img)
 Checks if the alpha channel is used. More...
 
DllCoreExport void imageInfo (const cv::Mat &img, const QString name)
 Prints the basic image information. More...
 
DllCoreExport QString printImage (const cv::Mat &img, const QString name)
 Prints the image as a string formatted according Matlab. More...
 
DllCoreExport QJsonObject matToJson (const cv::Mat &img, bool compress=true)
 
DllCoreExport cv::Mat jsonToMat (const QJsonObject &jo, const QString &filePath="")
 
DllCoreExport QJsonObject matToJsonExtern (const cv::Mat &img, const QString &fileName, bool compress=true)
 
DllCoreExport bool writeMat (const cv::Mat &img, const QString &filePath, bool compress=true)
 
template<typename numFmt >
QString printMat (const cv::Mat &src, const QString varName)
 Prints the values of a cv::Mat to copy it to Matlab. More...
 

Detailed Description

Basic image class

Function Documentation

bool rdf::Image::alphaChannelUsed ( const QImage &  img)

Checks if the alpha channel is used.

Parameters
imgThe QImage img.
Returns
True if the alpha channel is used.
void rdf::Image::imageInfo ( const cv::Mat &  img,
const QString  name 
)

Prints the basic image information.

Parameters
imgThe source img.
nameThe name that should be displayed in the command line.
cv::Mat rdf::Image::jsonToMat ( const QJsonObject &  jo,
const QString &  filePath = "" 
)
QImage rdf::Image::load ( const QString &  path,
bool *  ok = 0 
)
QImage rdf::Image::mat2QImage ( const cv::Mat &  img,
bool  toRGB = false 
)

Converts a cv::Mat to QImage.

Parameters
imgThe cv::Mat img.
Returns
The converted QImage.
QJsonObject rdf::Image::matToJson ( const cv::Mat &  img,
bool  compress = true 
)
QJsonObject rdf::Image::matToJsonExtern ( const cv::Mat &  img,
const QString &  fileName,
bool  compress = true 
)
QString rdf::Image::printImage ( const cv::Mat &  img,
const QString  name 
)

Prints the image as a string formatted according Matlab.

Parameters
imgThe src img.
nameThe variable name in Matlab.
Returns
A string containing the values of the image
template<typename numFmt >
QString rdf::Image::printMat ( const cv::Mat &  src,
const QString  varName 
)

Prints the values of a cv::Mat to copy it to Matlab.

Parameters
srcThe Mat to be printed.
varNameName of the variable for matlab.
Returns
The String with all values formatted for matlab.
cv::Mat rdf::Image::qImage2Mat ( const QImage &  img)

Converts a QImage to a cv::Mat.

Parameters
imgThe Qimage.
Returns
The cv__Mat image.
cv::Mat rdf::Image::qVector2Mat ( const QVector< float > &  data)
bool rdf::Image::save ( const QImage &  img,
const QString &  savePath,
int  compression = -1 
)

Saves the specified QImage img.

Parameters
imgThe img to be saved.
savePathThe save path.
compressionThe compression.
Returns
True if the image was saved.
bool rdf::Image::save ( const cv::Mat &  img,
const QString &  savePath,
int  compression = -1 
)

Saves the specified cv::Mat img.

Parameters
imgThe imgto be saved.
savePathThe save path.
compressionThe compression.
Returns
True if the image was saved.
bool rdf::Image::writeMat ( const cv::Mat &  img,
const QString &  filePath,
bool  compress = true 
)