diff --git a/sdk/plugins/regions.cpp b/sdk/plugins/regions.cpp index 9d9086e..ec8f66a 100644 --- a/sdk/plugins/regions.cpp +++ b/sdk/plugins/regions.cpp @@ -79,23 +79,27 @@ BR_REGISTER(Transform, ByRow) class Cat : public UntrainableMetaTransform { Q_OBJECT + Q_PROPERTY(int partitions READ get_partitions WRITE set_partitions RESET reset_partitions) + BR_PROPERTY(int, partitions, 1) void project(const Template &src, Template &dst) const { - int vals = 0; - foreach (const cv::Mat &m, src) - vals += m.total() * m.channels(); - - Mat cat(1, (int)vals, CV_32FC1); - int offset = 0; - foreach (const cv::Mat &m, src) { - size_t size = m.total() * m.elemSize(); - memcpy(&cat.data[offset], m.ptr(), size); - offset += size; - } - dst.file = src.file; - dst = cat; + + QVector sizes(partitions, 0); + for (int i=0; i offsets(partitions, 0); + for (int i=0; i