#include <type_traits>
#include <algorithm>
#include <vector>
#include <array>
#include <opencv2/core/types.hpp>
#include <networktables/NetworkTableInstance.h>
#include <networktables/NetworkTable.h>
#include <cameraserver/CameraServer.h>
#include <wpi/StringExtras.h>
#include "visioncamera.h"
Go to the source code of this file.
Functions | |
cv::Size | getResolution (cs::VideoMode vm) |
cs::VideoMode | getJsonVideoMode (const wpi::json &config) |
template<typename num_t , typename dnum_t > | |
static cv::Size_< num_t > | operator/ (cv::Size_< num_t > input, dnum_t scale) |
template<typename num_t > | |
bool | inRange (num_t a, num_t lower, num_t upper) |
template<typename t > | |
void | reinsert (std::vector< t > &vec, size_t idx) |
template<typename t > | |
void | swapIdx (std::vector< t > &vec, size_t idx1, size_t idx2) |
template<typename num_t > | |
int | sgn (num_t val) |
template<typename num_t > | |
cv::Size_< num_t > | distance (const cv::Point_< num_t > &a, const cv::Point_< num_t > &b) |
template<typename num_t > | |
cv::Point3_< num_t > | distance (const cv::Point3_< num_t > &a, const cv::Point3_< num_t > &b) |
template<typename num_t > | |
bool | operator< (const cv::Size_< num_t > &a, const cv::Size_< num_t > &b) |
template<typename num_t > | |
bool | operator<= (const cv::Size_< num_t > &a, const cv::Size_< num_t > &b) |
template<typename num_t > | |
bool | operator> (const cv::Size_< num_t > &a, const cv::Size_< num_t > &b) |
template<typename num_t > | |
bool | operator>= (const cv::Size_< num_t > &a, const cv::Size_< num_t > &b) |
template<typename num_t > | |
cv::Point_< num_t > | operator- (const cv::Point_< num_t > &a, const cv::Size_< num_t > &b) |
template<typename num_t > | |
cv::Point_< num_t > | operator+ (const cv::Point_< num_t > &a, const cv::Size_< num_t > &b) |
template<typename num_t > | |
cv::Size_< num_t > | operator- (const cv::Size_< num_t > &a, const cv::Point_< num_t > &b) |
template<typename num_t > | |
cv::Size_< num_t > | operator+ (const cv::Size_< num_t > &a, const cv::Point_< num_t > &b) |
template<typename inum1_t , typename inum2_t , typename onum_t > | |
cv::Size_< onum_t > | operator/ (const cv::Size_< inum1_t > &a, const cv::Size_< inum2_t > &b) |
template<typename num_t > | |
void | operator-= (const cv::Point_< num_t > &a, const cv::Size_< num_t > &b) |
template<typename num_t > | |
void | operator+= (const cv::Point_< num_t > &a, const cv::Size_< num_t > &b) |
template<typename num_t > | |
void | operator-= (const cv::Size_< num_t > &a, const cv::Point_< num_t > &b) |
template<typename num_t > | |
void | operator+= (const cv::Size_< num_t > &a, const cv::Point_< num_t > &b) |
template<typename num_t > | |
void | rescale (std::vector< cv::Point_< num_t > > &points, size_t scale) |
template<typename num_t > | |
void | _rescale (std::vector< cv::Point_< num_t > > &points, size_t scale) |
template<typename num_t > | |
void | rescale (std::vector< cv::Point_< num_t > > &points, double scale) |
template<typename num_t > | |
void | rescale (std::vector< std::vector< cv::Point_< num_t > > > &contours, double scale) |
template<typename num_t > | |
void | rescale (std::vector< cv::Rect_< num_t > > &rects, double scale) |
template<typename num_t > | |
cv::Point_< num_t > | findCenter (const std::vector< cv::Point_< num_t > > &contour) |
template<typename onum_t , typename inum_t > | |
cv::Point_< onum_t > | findCenter (const std::vector< cv::Point_< inum_t > > &contour) |
template<typename num_t > | |
cv::Point3_< num_t > | findCenter3D (const std::vector< cv::Point3_< num_t > > &contour) |
template<typename onum_t , typename inum_t > | |
cv::Point3_< onum_t > | findCenter3D (const std::vector< cv::Point3_< inum_t > > &contour) |
template<typename num_t > | |
cv::Point_< num_t > | findCenter (const cv::Rect_< num_t > &rect) |
template<typename onum_t , typename inum_t > | |
cv::Point_< onum_t > | findCenter (const cv::Rect_< inum_t > &rect) |
template<typename num_t > | |
void | reorderClockWise (std::vector< cv::Point_< num_t > > &points) |
template<typename num_t > | |
void | reorderCClockWise (std::vector< cv::Point_< num_t > > &points) |
template<typename num_t , size_t s> | |
std::array< cv::Point3_< num_t >, s > | operator+ (const std::array< cv::Point_< num_t >, s > &base, num_t depth) |
template<typename num_t , size_t s> | |
std::array< cv::Point3_< num_t >, s > | operator+ (const std::array< cv::Point3_< num_t >, s > &base, num_t depth) |
template<typename num_t , size_t s> | |
void | operator+= (std::array< cv::Point3_< num_t >, s > &base, num_t depth) |
template<typename num_t > | |
std::vector< cv::Point3_< num_t > > | operator+ (const std::vector< cv::Point_< num_t > > &base, num_t depth) |
template<typename num_t > | |
std::vector< cv::Point3_< num_t > > | operator+ (const std::vector< cv::Point3_< num_t > > &base, num_t depth) |
template<typename num_t > | |
void | operator+= (std::vector< cv::Point3_< num_t > > &base, num_t depth) |
Variables | |
template<typename num_t , size_t s> | |
const auto | extend_array = operator+=<num_t, s> |
template<typename num_t > | |
const auto | extend_vector = operator+=<num_t> |
|
inline |
This file contains vision-related helper functions used throughout the framework Starts a stream and creates a networktable value for changing which camera is streamed
cameras | A vector of VisionCameras to be used |
table | A networktable in which to put the camera index entries |
vm | The cs::VideoMode object to get resolution from |
cs::VideoMode getJsonVideoMode | ( | const wpi::json & | config | ) |
Extracts videomode properties from a config json - 0-values returned if config is invalid
Definition at line 32 of file vision.cpp.
|
inlinestatic |
Adds a networktable entry to the provided networktable with a listener that will update the variable to match the networktable entry
num_t | Any numeric type - does not need to be explicitly provided |
var | A reference to the numeric variable |
name | The name of the entry |
table | The root networktable Adds a networktable entry to the provided networktable with a listener that will update the variable to match the networktable entry |
var | A reference to the boolean variable |
name | The name of the entry |
table | The root networktable Divides a both parts of a cv::Size object by the specified scale |
num_t | The numberic type used in the cv::Size input (and function output) - does not need to be explicitly provided |
dnum_t | The numberic type used for the devisor |
input | The input size |
scale | The amount to be divided by |
|
inline |
void reinsert | ( | std::vector< t > & | vec, |
size_t | idx | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void operator-= | ( | const cv::Point_< num_t > & | a, |
const cv::Size_< num_t > & | b | ||
) |
void operator+= | ( | const cv::Point_< num_t > & | a, |
const cv::Size_< num_t > & | b | ||
) |
void operator-= | ( | const cv::Size_< num_t > & | a, |
const cv::Point_< num_t > & | b | ||
) |
void operator+= | ( | const cv::Size_< num_t > & | a, |
const cv::Point_< num_t > & | b | ||
) |
void rescale | ( | std::vector< cv::Point_< num_t > > & | points, |
size_t | scale | ||
) |
void _rescale | ( | std::vector< cv::Point_< num_t > > & | points, |
size_t | scale | ||
) |
void rescale | ( | std::vector< cv::Point_< num_t > > & | points, |
double | scale | ||
) |
void rescale | ( | std::vector< std::vector< cv::Point_< num_t > > > & | contours, |
double | scale | ||
) |
void rescale | ( | std::vector< cv::Rect_< num_t > > & | rects, |
double | scale | ||
) |
cv::Point_< num_t > findCenter | ( | const std::vector< cv::Point_< num_t > > & | contour | ) |
cv::Point_< onum_t > findCenter | ( | const std::vector< cv::Point_< inum_t > > & | contour | ) |
cv::Point3_< num_t > findCenter3D | ( | const std::vector< cv::Point3_< num_t > > & | contour | ) |
cv::Point3_< onum_t > findCenter3D | ( | const std::vector< cv::Point3_< inum_t > > & | contour | ) |
cv::Point_< num_t > findCenter | ( | const cv::Rect_< num_t > & | rect | ) |
cv::Point_< onum_t > findCenter | ( | const cv::Rect_< inum_t > & | rect | ) |
void reorderClockWise | ( | std::vector< cv::Point_< num_t > > & | points | ) |
void reorderCClockWise | ( | std::vector< cv::Point_< num_t > > & | points | ) |
std::array< cv::Point3_< num_t >, s > operator+ | ( | const std::array< cv::Point_< num_t >, s > & | base, |
num_t | depth | ||
) |
std::array< cv::Point3_< num_t >, s > operator+ | ( | const std::array< cv::Point3_< num_t >, s > & | base, |
num_t | depth | ||
) |
void operator+= | ( | std::array< cv::Point3_< num_t >, s > & | base, |
num_t | depth | ||
) |
std::vector< cv::Point3_< num_t > > operator+ | ( | const std::vector< cv::Point_< num_t > > & | base, |
num_t | depth | ||
) |
std::vector< cv::Point3_< num_t > > operator+ | ( | const std::vector< cv::Point3_< num_t > > & | base, |
num_t | depth | ||
) |
void operator+= | ( | std::vector< cv::Point3_< num_t > > & | base, |
num_t | depth | ||
) |
const auto extend_array = operator+=<num_t, s> |