imutils-cpp
Loading...
Searching...
No Matches
convenience.h
Go to the documentation of this file.
1//
2// Created by jonsnow on 16/02/22.
3//
4
5#pragma once
6
7#include "opencv2/imgproc.hpp"
8#include "opencv2/imgcodecs.hpp"
9#include "opencv2/core.hpp"
10
12/***************************************************************************/
26private:
27
28 static size_t write_data(char *ptr, size_t size, size_t nmemb, void *userdata);
29
34 static double medianMat(cv::Mat Input);
35
36public:
44 static cv::Mat translate(const cv::Mat &img, float x, float y);
45
54 static cv::Mat rotate(cv::Mat &img, double angle, cv::Point2f center = {-1, -1}, float scale = 1.0);
55
62 static cv::Mat rotateBounds(cv::Mat &img, double angle);
63
73 static cv::Mat resize(cv::Mat &img, int height = 0, int width = 0, int inter = cv::INTER_AREA);
74
82 static cv::Mat skeletonize(cv::Mat &img, cv::Size size, int structuring = cv::MORPH_RECT);
83
90 static cv::Mat urlToImager(std::string url, int readFlag = cv::IMREAD_COLOR);
91
98 static cv::Mat autoCanny(cv::Mat img, double sigma = 0.33);
99
107 static cv::Mat adjustBrightnessContrast(cv::Mat img, int brightness = 0, double contrast = 0.0);
108};
109
This class will help you with various problems while dealing with opencv.
Definition: convenience.h:25
static cv::Mat autoCanny(cv::Mat img, double sigma=0.33)
Returns image with canny applied.
Definition: convenience.cpp:114
static cv::Mat rotate(cv::Mat &img, double angle, cv::Point2f center={-1, -1}, float scale=1.0)
Returns rotated image.
Definition: convenience.cpp:20
static cv::Mat rotateBounds(cv::Mat &img, double angle)
Returns rotated bounded image.
Definition: convenience.cpp:31
static cv::Mat skeletonize(cv::Mat &img, cv::Size size, int structuring=cv::MORPH_RECT)
Returns skeleton image.
Definition: convenience.cpp:69
static cv::Mat translate(const cv::Mat &img, float x, float y)
Returns translated image.
Definition: convenience.cpp:12
static cv::Mat urlToImager(std::string url, int readFlag=cv::IMREAD_COLOR)
Returns image from the specified url with the appropriate read flag applied.
Definition: convenience.cpp:90
static cv::Mat resize(cv::Mat &img, int height=0, int width=0, int inter=cv::INTER_AREA)
Returns resized bounded image.
Definition: convenience.cpp:52
static cv::Mat adjustBrightnessContrast(cv::Mat img, int brightness=0, double contrast=0.0)
Returns image with brightness and contrast applied.
Definition: convenience.cpp:132