Implement i/o functions (read, write matrices).
More...
#include <rslf_types.hpp>
#include <opencv2/highgui/highgui.hpp>
Go to the source code of this file.
|
| Mat | rslf::read_img_from_file (std::string path_to_folder, std::string name_we, std::string extension, int cv_read_mode=CV_LOAD_IMAGE_UNCHANGED, bool transpose=false, bool rotate_180=false) |
| |
| std::vector< Mat > | rslf::read_imgs_from_folder (std::string path_to_folder, std::string extension, int cv_read_mode=CV_LOAD_IMAGE_UNCHANGED, bool transpose=false, bool rotate_180=false) |
| |
| void | rslf::write_mat_to_yml (Mat img, std::string path_to_folder, std::string name_we, std::string extension="yml") |
| |
| void | rslf::write_mat_to_imgfile (Mat img, std::string path_to_folder, std::string name_we, std::string extension="png", std::vector< int > compression_params=std::vector< int >()) |
| |
| Mat | rslf::read_mat_from_yml (std::string path_to_folder, std::string name_we, std::string extension="yml") |
| |
| Mat | rslf::build_row_epi_from_imgs (Vec< Mat > imgs, int row, bool transpose=false, bool rotate_180=false) |
| | Assume we have a set of rectified images such that the epipolar planes are on the lines. Build the EPI along the given row. More...
|
| |
| Vec< Mat > | rslf::build_epis_from_imgs (Vec< Mat > imgs, bool transpose=false, bool rotate_180=false) |
| | Assume we have a set of rectified images such that the epipolar planes are on the lines. Build the EPIs along the given row. More...
|
| |
| Mat | rslf::build_row_epi_from_path (std::string path_to_folder, std::string extension, int row, int cv_read_mode=CV_LOAD_IMAGE_UNCHANGED, bool transpose=false, bool rotate_180=false) |
| | Assume we have a set of rectified images such that the epipolar planes are on the lines in a folder. Build the EPI along the given row. Images are supposed to be ordered in alphanumerical order. More...
|
| |
Implement i/o functions (read, write matrices).
◆ build_epis_from_imgs()
Assume we have a set of rectified images such that the epipolar planes are on the lines. Build the EPIs along the given row.
- Parameters
-
| imgs | The set of images from which to build the EPIs. |
| transpose | Indicates whether the algorithm should transpose the images (epipolar lines should be horizontal) |
- Returns
- The requested EPIs.
◆ build_row_epi_from_imgs()
| rslf::Mat rslf::build_row_epi_from_imgs |
( |
Vec< Mat > |
imgs, |
|
|
int |
row, |
|
|
bool |
transpose = false, |
|
|
bool |
rotate_180 = false |
|
) |
| |
Assume we have a set of rectified images such that the epipolar planes are on the lines. Build the EPI along the given row.
- Parameters
-
| imgs | The set of images from which to build the EPI. |
| row | The row along which the EPI will be built. |
| transpose | Indicates whether the algorithm should transpose the images (epipolar lines should be horizontal) |
- Returns
- The requested EPI.
◆ build_row_epi_from_path()
| rslf::Mat rslf::build_row_epi_from_path |
( |
std::string |
path_to_folder, |
|
|
std::string |
extension, |
|
|
int |
row, |
|
|
int |
cv_read_mode = CV_LOAD_IMAGE_UNCHANGED, |
|
|
bool |
transpose = false, |
|
|
bool |
rotate_180 = false |
|
) |
| |
Assume we have a set of rectified images such that the epipolar planes are on the lines in a folder. Build the EPI along the given row. Images are supposed to be ordered in alphanumerical order.
- Parameters
-
| path_to_folder | The path containing the images. Should end with '/' (but the function will correct if not the case). |
| extension | The extension of the images to be read. Should not start with '.' (but the algorithm will correct if not the case). |
| row | The row along which the EPI will be built. |
| cv_read_mode | The mode with which OpenCV will read the files. |
| transpose | Indicates whether the algorithm should transpose the images (epipolar lines should be horizontal). |
- Returns
- The requested EPI.
◆ read_img_from_file()
| rslf::Mat rslf::read_img_from_file |
( |
std::string |
path_to_folder, |
|
|
std::string |
name_we, |
|
|
std::string |
extension, |
|
|
int |
cv_read_mode = CV_LOAD_IMAGE_UNCHANGED, |
|
|
bool |
transpose = false, |
|
|
bool |
rotate_180 = false |
|
) |
| |
Reads an image from the given path, name and extension.
- Parameters
-
| path_to_folder | Path to the folder containing the file. Should end with '/' (but the function will correct if not the case). |
| name_we | Name of the file without path or extension. |
| extension | The extension of the file. Should not start with '.' (but the algorithm will correct if not the case). |
| cv_read_mode | The mode with which OpenCV will read the file. |
- Returns
- The requested image in Mat format.
◆ read_imgs_from_folder()
| rslf::Vec< rslf::Mat > rslf::read_imgs_from_folder |
( |
std::string |
path_to_folder, |
|
|
std::string |
extension, |
|
|
int |
cv_read_mode = CV_LOAD_IMAGE_UNCHANGED, |
|
|
bool |
transpose = false, |
|
|
bool |
rotate_180 = false |
|
) |
| |
Reads all images with requested extension in requested folder.
- Parameters
-
| path_to_folder | Path to the folder containing the files. Should end with '/' (but the function will correct if not the case). |
| extension | The extension of the files. Should not start with '.' (but the algorithm will correct if not the case). |
| cv_read_mode | The mode with which OpenCV will read the files. |
- Returns
- The requested images in a vector of Mat.
◆ read_mat_from_yml()
| rslf::Mat rslf::read_mat_from_yml |
( |
std::string |
path_to_folder, |
|
|
std::string |
name_we, |
|
|
std::string |
extension = "yml" |
|
) |
| |
Reads the given .yml file in the given folder to a Mat.
- Parameters
-
| path_to_folder | Path to the folder where to read the file. |
| name_we | Name of the file without path or extension. |
| extension | The extension of the file. |
- Returns
- A Mat containing the image
◆ write_mat_to_imgfile()
| void rslf::write_mat_to_imgfile |
( |
Mat |
img, |
|
|
std::string |
path_to_folder, |
|
|
std::string |
name_we, |
|
|
std::string |
extension = "png", |
|
|
std::vector< int > |
compression_params = std::vector< int >() |
|
) |
| |
Writes the given Mat to an image in the given folder.
- Parameters
-
| img | The Mat to save. |
| path_to_folder | Path to the folder where to save the file. Should end with '/' (but the function will correct if not the case). |
| name_we | Name of the file without path or extension. |
| extension | The extension of the file. Should not start with '.' (but the algorithm will correct if not the case). |
| compression_params | Compression parameters. |
◆ write_mat_to_yml()
| void rslf::write_mat_to_yml |
( |
Mat |
img, |
|
|
std::string |
path_to_folder, |
|
|
std::string |
name_we, |
|
|
std::string |
extension = "yml" |
|
) |
| |
Writes the given Mat to a .yml file in the given folder.
- Parameters
-
| img | The Mat to save. |
| path_to_folder | Path to the folder where to save the file. Should end with '/' (but the function will correct if not the case). |
| name_we | Name of the file without path or extension. |
| extension | The extension of the file. Should not start with '.' (but the algorithm will correct if not the case). |