1

In C++ if you wanted to emplace one mat into another, the code would simply be:

clone_img.emplace(out_mat);

Now, I know in C# there is no real equivalent to the "emplace" method. If I was working with other data types in a more standard collection, I can find the answer for what I want to do on Google. Working with a cv::Mat is a bit different though, and I can't find anything about that.

There is a Mat.PushBack method, but it doesn't construct the new object in-place within the collection. Or does that not matter?

What is the C#/EmguCV equivalent of this emplacement, and what would be the differences under the hood to be aware of?

  • 1
    What would be the output of that method in c++? Also, can this answer your question in any way? https://stackoverflow.com/a/35986274/17667233 – erik7854 Apr 15 '22 at 07:26

1 Answers1

0

I found the answer for what I wanted to do, although it may not exactly answer this above question.

What I wanted to do was to create an empty Mat, and then call Mat.emplace() to put something else in it.
I found out it was as simple as doing:

Mat newMat = old_mat;
erik7854
  • 150
  • 1
  • 16