#include <image.h>
Definition at line 62 of file image.h.
| bsfm::Image::Image |
( |
const Image & |
other | ) |
|
Definition at line 43 of file image.cpp.
std::shared_ptr< cv::Mat > image_
| bsfm::Image::Image |
( |
size_t |
width, |
|
|
size_t |
height, |
|
|
size_t |
channels |
|
) |
| |
Definition at line 49 of file image.cpp.
52 image_ = std::shared_ptr<cv::Mat>(
new cv::Mat(width, height, CV_32F, 0.f));
55 image_ = std::shared_ptr<cv::Mat>(
56 new cv::Mat(width, height, CV_32FC3, CV_RGB(0.f, 0.f, 0.f)));
std::shared_ptr< cv::Mat > image_
| bsfm::Image::Image |
( |
const std::string & |
filename, |
|
|
bool |
grayscale = false |
|
) |
| |
|
explicit |
Definition at line 61 of file image.cpp.
62 image_ = std::shared_ptr<cv::Mat>(
new cv::Mat());
63 Read(filename, grayscale);
std::shared_ptr< cv::Mat > image_
void Read(const std::string &filename, bool grayscale=false)
| bsfm::Image::Image |
( |
const cv::Mat & |
other | ) |
|
|
explicit |
Definition at line 67 of file image.cpp.
68 image_ = std::shared_ptr<cv::Mat>(
new cv::Mat(other));
std::shared_ptr< cv::Mat > image_
template<typename T >
| T & bsfm::Image::at |
( |
size_t |
u, |
|
|
size_t |
v |
|
) |
| |
|
inline |
Definition at line 147 of file image.h.
148 CHECK_NOTNULL(
image_.get());
149 return image_->template at<T>(u, v);
std::shared_ptr< cv::Mat > image_
template<typename T >
| const T & bsfm::Image::at |
( |
size_t |
u, |
|
|
size_t |
v |
|
) |
| const |
|
inline |
Definition at line 153 of file image.h.
154 CHECK_NOTNULL(
image_.get());
155 return image_->template at<T>(u, v);
std::shared_ptr< cv::Mat > image_
| size_t bsfm::Image::Channels |
( |
| ) |
const |
Definition at line 123 of file image.cpp.
124 CHECK(
image_.get()) <<
"Image data is not allocated.";
125 return image_->channels();
std::shared_ptr< cv::Mat > image_
| size_t bsfm::Image::Cols |
( |
| ) |
const |
|
inline |
| void bsfm::Image::ConvertToGrayscale |
( |
| ) |
|
Definition at line 166 of file image.cpp.
167 CHECK(
image_.get()) <<
"Image data is not allocated.";
170 VLOG(1) <<
"Cannot convert image to grayscale, image is already grayscale.";
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::ConvertToRGB |
( |
| ) |
|
Definition at line 178 of file image.cpp.
179 CHECK(
image_.get()) <<
"Image data is not allocated.";
182 VLOG(1) <<
"Cannot convert image to RGB, image is already RGB.";
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::FlipLR |
( |
| ) |
|
Definition at line 156 of file image.cpp.
157 CHECK(
image_.get()) <<
"Image data is not allocated.";
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::FlipUD |
( |
| ) |
|
Definition at line 161 of file image.cpp.
162 CHECK(
image_.get()) <<
"Image data is not allocated.";
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::FromCV |
( |
const cv::Mat & |
in | ) |
|
Definition at line 79 of file image.cpp.
80 CHECK(
image_.get()) <<
"Image data is not allocated.";
83 cv::cvtColor(in, *
image_, CV_BGR2RGB);
std::shared_ptr< cv::Mat > image_
| size_t bsfm::Image::Height |
( |
| ) |
const |
Definition at line 118 of file image.cpp.
119 CHECK(
image_.get()) <<
"Image data is not allocated.";
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::ImShow |
( |
const std::string & |
window_name = std::string(), |
|
|
unsigned int |
wait_time = 0 |
|
) |
| |
Definition at line 190 of file image.cpp.
191 CHECK(
image_.get()) <<
"Image data is not allocated.";
193 cv::namedWindow(window_name.c_str(), CV_WINDOW_AUTOSIZE);
199 cv::imshow(window_name.c_str(), bgr_image);
201 cv::imshow(window_name.c_str(), *
image_);
204 cv::waitKey(wait_time);
std::shared_ptr< cv::Mat > image_
void ToCV(cv::Mat &out) const
| bool bsfm::Image::IsColor |
( |
| ) |
const |
|
inline |
| void bsfm::Image::Read |
( |
const std::string & |
filename, |
|
|
bool |
grayscale = false |
|
) |
| |
Definition at line 91 of file image.cpp.
93 *
image_ = cv::imread(filename.c_str(), CV_LOAD_IMAGE_GRAYSCALE);
98 *
image_ = cv::imread(filename.c_str(), CV_LOAD_IMAGE_COLOR);
103 CHECK(
image_->data) <<
"Unable to read image file.";
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::Resize |
( |
double |
scale | ) |
|
Definition at line 128 of file image.cpp.
129 CHECK(
image_.get()) <<
"Image data is not allocated.";
130 cv::resize(*
image_, *
image_, cv::Size(), scale, scale, CV_INTER_LANCZOS4);
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::Resize |
( |
size_t |
new_width, |
|
|
size_t |
new_height |
|
) |
| |
Definition at line 133 of file image.cpp.
134 CHECK(
image_.get()) <<
"Image data is not allocated.";
135 cv::resize(*
image_, *
image_, cv::Size(new_width, new_height),
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::RotateClockwise |
( |
| ) |
|
Definition at line 144 of file image.cpp.
145 CHECK(
image_.get()) <<
"Image data is not allocated.";
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::RotateCounterClockwise |
( |
| ) |
|
Definition at line 150 of file image.cpp.
151 CHECK(
image_.get()) <<
"Image data is not allocated.";
std::shared_ptr< cv::Mat > image_
| size_t bsfm::Image::Rows |
( |
| ) |
const |
|
inline |
| void bsfm::Image::ToCV |
( |
cv::Mat & |
out | ) |
const |
Definition at line 72 of file image.cpp.
73 CHECK(
image_.get()) <<
"Image data is not allocated.";
76 cv::cvtColor(*
image_, out, CV_RGB2BGR);
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::ToEigen |
( |
MatrixXf & |
eigen_out | ) |
|
Definition at line 86 of file image.cpp.
87 CHECK(
image_.get()) <<
"Image data is not allocated.";
std::shared_ptr< cv::Mat > image_
void OpenCVToEigenMat(const cv::Mat &cv_mat, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &eigen_mat)
| void bsfm::Image::Transpose |
( |
| ) |
|
Definition at line 139 of file image.cpp.
140 CHECK(
image_.get()) <<
"Image data is not allocated.";
std::shared_ptr< cv::Mat > image_
| size_t bsfm::Image::Width |
( |
| ) |
const |
Definition at line 113 of file image.cpp.
114 CHECK(
image_.get()) <<
"Image data is not allocated.";
std::shared_ptr< cv::Mat > image_
| void bsfm::Image::Write |
( |
const std::string & |
filename | ) |
const |
Definition at line 109 of file image.cpp.
110 cv::imwrite(filename.c_str(), *
image_);
std::shared_ptr< cv::Mat > image_
| bool bsfm::Image::grayscale_ |
|
private |
| std::shared_ptr<cv::Mat> bsfm::Image::image_ |
|
private |
The documentation for this class was generated from the following files:
- /Users/eanelson/Git/berkeley_sfm/src/cpp/image/image.h
- /Users/eanelson/Git/berkeley_sfm/src/cpp/image/image.cpp