Commit 201b6b07 authored by Anna Petrovicheva's avatar Anna Petrovicheva

Small interface change proposals

parent 551e17ea
......@@ -209,6 +209,13 @@ namespace dnn
*/
Mat getPlane(int n, int cn);
/** @brief Returns slice of first dimension.
* @details The behaviour is similar to getPlane(), but returns all
* channels * rows * cols values, corresponding to the n-th value
* of the first dimension.
*/
Mat getPlanes(int n);
/* Shape getters of 4-dimensional blobs. */
int cols() const; //!< Returns size of the fourth axis blob.
int rows() const; //!< Returns size of the thrid axis blob.
......
......@@ -391,6 +391,12 @@ inline Mat Blob::getPlane(int n, int cn)
return Mat(dims() - 2, sizes() + 2, type(), ptr(n, cn));
}
inline Mat Blob::getPlanes(int n)
{
CV_Assert(dims() > 3);
return Mat(dims() - 1, sizes() + 1, type(), ptr(n));
}
inline int Blob::cols() const
{
return xsize(3);
......
......@@ -111,7 +111,7 @@ class CV_EXPORTS Dict
public:
//! Checks a presence of the @p key in the dictionary.
bool has(const String &key);
bool has(const String &key) const;
//! If the @p key in the dictionary then returns pointer to its value, else returns NULL.
DictValue *ptr(const String &key);
......
......@@ -287,7 +287,7 @@ inline std::ostream &operator<<(std::ostream &stream, const DictValue &dictv)
/////////////////////////////////////////////////////////////////
inline bool Dict::has(const String &key)
inline bool Dict::has(const String &key) const
{
return dict.count(key) != 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment