51 lines
838 B
C++
51 lines
838 B
C++
#include "pch.h"
|
|
|
|
void to_json(jsonobj& j, const cv::Point& p)
|
|
{
|
|
j["x"] = p.x;
|
|
j["y"] = p.y;
|
|
}
|
|
void from_json(const jsonobj& j, cv::Point& p)
|
|
{
|
|
tryRead(j, "x", p.x);
|
|
tryRead(j, "y", p.y);
|
|
}
|
|
|
|
void to_json(jsonobj& j, const cv::Point2f& p)
|
|
{
|
|
j["x"] = p.x;
|
|
j["y"] = p.y;
|
|
}
|
|
void from_json(const jsonobj& j, cv::Point2f& p)
|
|
{
|
|
tryRead(j, "x", p.x);
|
|
tryRead(j, "y", p.y);
|
|
}
|
|
|
|
|
|
void to_json(jsonobj& j, const cv::Size& p)
|
|
{
|
|
j["w"] = p.width;
|
|
j["h"] = p.height;
|
|
}
|
|
void from_json(const jsonobj& j, cv::Size& p)
|
|
{
|
|
tryRead(j, "w", p.width);
|
|
tryRead(j, "h", p.height);
|
|
}
|
|
|
|
void to_json(jsonobj& j, const cv::Rect& p)
|
|
{
|
|
j["x"] = p.x;
|
|
j["y"] = p.y;
|
|
j["w"] = p.width;
|
|
j["h"] = p.height;
|
|
}
|
|
|
|
void from_json(const jsonobj& j, cv::Rect& p)
|
|
{
|
|
tryRead(j, "x", p.x);
|
|
tryRead(j, "y", p.y);
|
|
tryRead(j, "w", p.width);
|
|
tryRead(j, "h", p.height);
|
|
} |