mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
core: fix persistence with deprecated traits
This commit is contained in:
@@ -7367,8 +7367,18 @@ void read(const FileNode& node, std::vector<KeyPoint>& keypoints)
|
||||
if (first_node.isSeq())
|
||||
{
|
||||
// modern scheme
|
||||
#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
|
||||
FileNodeIterator it = node.begin();
|
||||
size_t total = (size_t)it.remaining;
|
||||
keypoints.resize(total);
|
||||
for (size_t i = 0; i < total; ++i, ++it)
|
||||
{
|
||||
(*it) >> keypoints[i];
|
||||
}
|
||||
#else
|
||||
FileNodeIterator it = node.begin();
|
||||
it >> keypoints;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
keypoints.clear();
|
||||
@@ -7394,8 +7404,18 @@ void read(const FileNode& node, std::vector<DMatch>& matches)
|
||||
if (first_node.isSeq())
|
||||
{
|
||||
// modern scheme
|
||||
#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
|
||||
FileNodeIterator it = node.begin();
|
||||
size_t total = (size_t)it.remaining;
|
||||
matches.resize(total);
|
||||
for (size_t i = 0; i < total; ++i, ++it)
|
||||
{
|
||||
(*it) >> matches[i];
|
||||
}
|
||||
#else
|
||||
FileNodeIterator it = node.begin();
|
||||
it >> matches;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
matches.clear();
|
||||
|
||||
Reference in New Issue
Block a user