19 using namespace Eigen;
45 const char *
type()
const {
return "drwnPixelNeighbourContrasts"; }
51 virtual void initialize(
const cv::Mat& img);
53 bool save(drwnXMLNode& xml)
const;
54 bool load(drwnXMLNode& xml);
57 int width()
const {
return _horzContrast.rows(); }
59 int height()
const {
return _horzContrast.cols(); }
63 double contrastN(
int x,
int y)
const {
return _vertContrast(x, y); }
65 double contrastS(
int x,
int y)
const {
return _vertContrast(x, y + 1); }
67 double contrastE(
int x,
int y)
const {
return _horzContrast(x + 1, y); }
69 double contrastW(
int x,
int y)
const {
return _horzContrast(x, y); }
71 double contrastNW(
int x,
int y)
const {
return _nwContrast(x, y); }
73 double contrastSW(
int x,
int y)
const {
return _swContrast(x, y); }
75 double contrastNE(
int x,
int y)
const {
return _swContrast(x + 1, y - 1); }
77 double contrastSE(
int x,
int y)
const {
return _nwContrast(x + 1, y + 1); }
82 cv::Mat visualize(
bool bComposite =
true)
const;
85 static double pixelContrast(
const cv::Mat& img,
const cv::Point &p,
const cv::Point& q);
int width() const
width of the image (in pixels)
Definition: drwnPixelNeighbourContrasts.h:57
double contrastNE(int x, int y) const
return the contrast weight between pixels (x,y) and (x+1,y-1)
Definition: drwnPixelNeighbourContrasts.h:75
int height() const
height of the image (in pixels)
Definition: drwnPixelNeighbourContrasts.h:59
MatrixXd _horzContrast
contrast between (x, y) and (x - 1, y)
Definition: drwnPixelNeighbourContrasts.h:32
Convenience class for holding pixel contrast weights.
Definition: drwnPixelNeighbourContrasts.h:30
drwnPixelNeighbourContrasts * clone() const
returns a copy of the class usually implemented as virtual Foo* clone() { return new Foo(*this); } ...
Definition: drwnPixelNeighbourContrasts.h:46
double contrastS(int x, int y) const
return the contrast weight between pixels (x,y) and (x,y+1)
Definition: drwnPixelNeighbourContrasts.h:65
MatrixXd _vertContrast
contrast between (x, y) and (x, y - 1)
Definition: drwnPixelNeighbourContrasts.h:33
const char * type() const
returns object type as a string (e.g., Foo::type() { return "Foo"; })
Definition: drwnPixelNeighbourContrasts.h:45
double contrastNW(int x, int y) const
return the contrast weight between pixels (x,y) and (x-1,y-1)
Definition: drwnPixelNeighbourContrasts.h:71
MatrixXd _swContrast
(south-west) contrast between (x, y) and (x - 1, y + 1)
Definition: drwnPixelNeighbourContrasts.h:35
double contrastW(int x, int y) const
return the contrast weight between pixels (x,y) and (x-1,y)
Definition: drwnPixelNeighbourContrasts.h:69
double contrastN(int x, int y) const
return the contrast weight between pixels (x,y) and (x,y-1)
Definition: drwnPixelNeighbourContrasts.h:63
double contrastSE(int x, int y) const
return the contrast weight between pixels (x,y) and (x+1,y+1)
Definition: drwnPixelNeighbourContrasts.h:77
double contrastSW(int x, int y) const
return the contrast weight between pixels (x,y) and (x-1,y+1)
Definition: drwnPixelNeighbourContrasts.h:73
MatrixXd _nwContrast
(north-west) contrast between (x, y) and (x - 1, y - 1)
Definition: drwnPixelNeighbourContrasts.h:34
standard Darwin object interface (cloneable and writeable)
Definition: drwnInterfaces.h:72
double contrastE(int x, int y) const
return the contrast weight between pixels (x,y) and (x+1,y)
Definition: drwnPixelNeighbourContrasts.h:67