1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2018-10-13 15:13:45 +00:00
17 changed files with 494 additions and 136 deletions
@@ -544,6 +544,11 @@ public:
*/
CV_WRAP_AS(at) FileNode operator[](int i) const;
/** @brief Returns keys of a mapping node.
@returns Keys of a mapping node.
*/
CV_WRAP std::vector<String> keys() const;
/** @brief Returns type of the node.
@returns Type of the node. See FileNode::Type
*/
+5 -4
View File
@@ -355,15 +355,16 @@ void Mat::create(int d, const int* _sizes, int _type)
#endif
if(!a)
a = a0;
CV_TRY
try
{
u = a->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, USAGE_DEFAULT);
CV_Assert(u != 0);
}
CV_CATCH_ALL
catch (...)
{
if(a != a0)
u = a0->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, USAGE_DEFAULT);
if (a == a0)
throw;
u = a0->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, USAGE_DEFAULT);
CV_Assert(u != 0);
}
CV_Assert( step[dims-1] == (size_t)CV_ELEM_SIZE(flags) );
+14
View File
@@ -274,6 +274,20 @@ FileNode FileNode::operator[](int i) const
i == 0 ? *this : FileNode();
}
std::vector<String> FileNode::keys() const
{
std::vector<String> res;
if (isMap())
{
res.reserve(size());
for (FileNodeIterator it = begin(); it != end(); ++it)
{
res.push_back((*it).name());
}
}
return res;
}
String FileNode::name() const
{
const char* str;