#pragma once #include #include class SeamCarving { private: static cv::Mat GetEnergyImg(const cv::Mat &img); static cv::Mat computeGradientMagnitude(const cv::Mat &frame); static float intensity(float currIndex, int start, int end); static cv::Mat computePathIntensityMat(const cv::Mat &rawEnergyMap); static std::vector getLeastImportantPath(const cv::Mat &importanceMap); static cv::Mat removeLeastImportantPath(const cv::Mat &original, const std::vector &seam); static void removePixel(const cv::Mat &original, cv::Mat &outputMap, int row, int minCol); static cv::Mat addLeastImportantPath(const cv::Mat &original, const std::vector &seam); static void addPixel(const cv::Mat &original, cv::Mat &outputMat, int row, int minCol); static cv::Mat drawSeam(const cv::Mat &frame, const std::vector &seam); public: static bool strechImage(cv::Mat& image, int seams, bool grow, std::vector>* seamsVect = nullptr); static bool strechImageVert(cv::Mat& image, int seams, bool grow, std::vector>* seamsVect = nullptr); static bool strechImageWithSeamsImage(cv::Mat& image, cv::Mat& seamsImage, int seams, bool grow); };