20 #include <ros_uri/ros_uri.hpp> 24 #include <opencv2/highgui/highgui.hpp> 46 if (
id >= 0 &&
id <= 1023) {
47 std::ofstream marker_file;
48 std::string marker_path = output_path +
"marker_" + std::to_string(
id) +
".png";
49 marker_file.open (marker_path);
50 if (marker_file.is_open()) {
53 cv::imwrite(marker_path, marker);
59 ROS_ERROR_STREAM(
"Can't create a marker with id " <<
id <<
" (only ids from 0-1023 are allowed");
69 int main(
int argc,
char** argv) {
static cv::Mat createMarkerImage(int id, int size, bool writeIdWaterMark=true, bool locked=false)
Creates an ar marker with the id specified using a modified version of the hamming code...
std::string output_rel_path_
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
static const std::string NODE_NAME("asr_aruco_marker_recognition")
void createMarkers()
Creates the markers with the parameters set in this class' members.
This class is used to create marker images which can be recognized with this package.
#define ROS_DEBUG_STREAM(args)
ROSLIB_DECL std::string getPath(const std::string &package_name)
MarkerCreator()
The constructor of this class.
static const std::string PACKAGE_NAME("asr_aruco_marker_recognition")
bool getParam(const std::string &key, std::string &s) const
std::vector< int > marker_ids_
#define ROS_ERROR_STREAM(args)