LArOpenCV
1
|
A simple class to store image's meta data including
0) origin (left-bottom corner of the picture) absolute coordinate
1) horizontal and vertical size (width and height) in double precision
2) number of horizontal and vertical pixels
It is meant to be associated with a specific cv::Mat or larcv::Image2D object
(where the latter class contains ImageMeta as an attribute).
More...
#include <ImageMeta.h>
Public Member Functions | |
ImageMeta (const double width=0., const double height=0., const size_t width_npixel=0., const size_t height_npixel=0, const double origin_x=0., const double origin_y=0.) | |
Default constructor: width, height, and origin coordinate won't be modifiable. More... | |
~ImageMeta () | |
Default destructor. More... | |
const Point2D & | origin () const |
double | width () const |
double | height () const |
size_t | num_pixel_row () const |
size_t | num_pixel_column () const |
double | pixel_width () const |
double | pixel_height () const |
double | pixel_relative_x (size_t w) const |
Provide relative horizontal coordinate of the center of a specified pixel row. More... | |
double | pixel_relative_y (size_t h) const |
Provide relative vertical coordinate of the center of a specified pixel column. More... | |
double | pixel_x (size_t w) const |
Provide absolute horizontal coordinate of the center of a specified pixel row. More... | |
double | pixel_y (size_t h) const |
Provide absolute vertical coordinate of the center of a specified pixel row. More... | |
void | update (const size_t width_npixel, const size_t height_npixel) |
Change # of vertical/horizontal pixels in meta data. More... | |
void | update (const ::cv::Mat &mat) |
Change # of vertical/horizontal pixels in meta data with cv::Mat as an input. More... | |
Protected Attributes | |
larcaffe::Point2D | _origin |
Absolute coordinate of the left bottom corner of an image. More... | |
double | _width |
Horizontal size of an image in double floating precision (in original coordinate unit size) More... | |
double | _height |
Vertical size of an image in double floating precision (in original coordinate unit size) More... | |
size_t | _width_npixel |
of pixels in horizontal axisMore... | |
size_t | _height_npixel |
of pixels in vertical axisMore... | |
Friends | |
class | Image2D |
A simple class to store image's meta data including
0) origin (left-bottom corner of the picture) absolute coordinate
1) horizontal and vertical size (width and height) in double precision
2) number of horizontal and vertical pixels
It is meant to be associated with a specific cv::Mat or larcv::Image2D object
(where the latter class contains ImageMeta as an attribute).
For cv::Mat, there
is a function ImageMeta::update to constantly update vertical/horizontal # pixels
as it may change in the course of matrix operation.
Definition at line 37 of file ImageMeta.h.
|
inline |
Default constructor: width, height, and origin coordinate won't be modifiable.
Definition at line 44 of file ImageMeta.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 65 of file ImageMeta.h.
References _height, and _height_npixel.
Referenced by pixel_relative_y().
|
inline |
Provide relative horizontal coordinate of the center of a specified pixel row.
Definition at line 67 of file ImageMeta.h.
References pixel_width().
Referenced by pixel_x().
|
inline |
Provide relative vertical coordinate of the center of a specified pixel column.
Definition at line 69 of file ImageMeta.h.
References pixel_height().
Referenced by pixel_y().
|
inline |
Definition at line 64 of file ImageMeta.h.
References _width, and _width_npixel.
Referenced by pixel_relative_x().
|
inline |
Provide absolute horizontal coordinate of the center of a specified pixel row.
Definition at line 71 of file ImageMeta.h.
References _origin, pixel_relative_x(), and larcaffe::Point2D::x.
|
inline |
Provide absolute vertical coordinate of the center of a specified pixel row.
Definition at line 73 of file ImageMeta.h.
References _origin, pixel_relative_y(), and larcaffe::Point2D::y.
|
inline |
Change # of vertical/horizontal pixels in meta data.
Definition at line 75 of file ImageMeta.h.
References _height_npixel, and _width_npixel.
Referenced by larcaffe::Image2D::clear(), larcaffe::Image2D::copy_compress(), ImageMeta(), larcaffe::Image2D::resize(), and update().
|
inline |
Change # of vertical/horizontal pixels in meta data with cv::Mat as an input.
Definition at line 83 of file ImageMeta.h.
References update().
|
inline |
|
friend |
Definition at line 39 of file ImageMeta.h.
|
protected |
Vertical size of an image in double floating precision (in original coordinate unit size)
Definition at line 90 of file ImageMeta.h.
Referenced by height(), and pixel_height().
|
protected |
Definition at line 92 of file ImageMeta.h.
Referenced by larcaffe::Image2D::copy_compress(), larcaffe::Image2D::height(), larcaffe::Image2D::index(), larcaffe::Image2D::isInBounds(), num_pixel_column(), pixel_height(), larcaffe::Image2D::set_pixel(), and update().
|
protected |
Absolute coordinate of the left bottom corner of an image.
Definition at line 88 of file ImageMeta.h.
|
protected |
Horizontal size of an image in double floating precision (in original coordinate unit size)
Definition at line 89 of file ImageMeta.h.
Referenced by pixel_width(), and width().
|
protected |
Definition at line 91 of file ImageMeta.h.
Referenced by larcaffe::Image2D::copy_compress(), larcaffe::Image2D::isInBounds(), num_pixel_row(), pixel_width(), larcaffe::Image2D::set_pixel(), update(), and larcaffe::Image2D::width().