* @brief Namespace containing a set of utility functions used in the project.
* The functions are mainly used to perform operations on images.
*
*
*/
namespaceutility{
/**
* @class Frame
* @brief Class that extends the OpenCV Mat class, adding some useful methods frequently used in the project.
*
*/
classFrame:publicMat{
public:
Frame();
Frame(constMat&m);
Frame(constFrame&f);
Frame&operator=(constMat&m);
Frame&operator=(constFrame&f);
Frameclone()const;
/**
* @brief Downsample the image by a given factor.
*
* @param factor The factor by which the image will be downsampled.
* @return Frame& The downsampled image.
*/
Frame&downsample(intfactor);
/**
* @brief Convert the image to a given color space.
*
* @param code The code of the color space to which the image will be converted.
* @return Frame& The converted image.
*/
Frame&convertColor(intcode);
Framedifference(Frame&f);
/**
* @brief Crop the image to a given size, centered in a given point.
*
* @param rect_size The size of the cropped image.
* @param center The center of the cropped image.
* @return Frame& The cropped image.
*/
Frame&crop(Sizerect_size,Point2fcenter);
/**
* @brief Warp the image using a given rotation matrix.
*
* @param rotationMatrix The rotation matrix used to warp the image.
* @return Frame& The warped image.
*/
Frame&warp(cv::MatrotationMatrix);
/**
* @brief Deinterlace the image, returning two images, one containing the odd lines and the other containing the even lines.
*
* @return std::pair<Frame, Frame> The two images containing the odd and even lines.
*/
std::pair<Frame,Frame>deinterlace()const;
};
/**
* @fn void detectShape(Ptr<GeneralizedHoughGuil> alg, Mat templateShape, int posThresh, vector<Vec4f> &positivePositions, Mat &positiveVotes, vector<Vec4f> &negativePositions, Mat &negativeVotes, Mat processingArea)
* @brief Detects a given shape in an image, using a the OpenCV algorithm GeneralizedHoughGuil.
*
* @param[in] alg the algorithm instance;
* @param[in] templateShape the shape to detect;
* @param[in] posThresh the position votes threshold;
* @param[out] positivePositions vector representing the position assigned to each found rectangle for positive angles;
* @param[out] positiveVotes vector representing the vote assigned to each found rectangle for positive angles;
* @param[out] negativePositions vector representing the position assigned to each found rectangle for negative angles;
* @param[out] negativeVotes vector representing the vote assigned to each found rectangle for negative angles;
* @param[in] processingArea the image to be processed.