Manipulating and accessing Mat data in EmguCV: how to get array elements and apply scalar?

I’ve started using EmguCV in C# and there is a bit of an adjustment, as method calls here are not all 1-to-1 as they are in C++.

If I have a histogram image to work with I call “hist”, and I wanted to access its elements to push to another vector, I would simply:
d.push_back(hist.at(i - 1));

There does not seem to be a .at method available in the emgu wrapper. Does anyone have experience with this, and would this be its C# equivalent?:
var histMatData = hist.GetData();
d.Add((float)histMatData.GetValue(i-1, 0)); //crashes when doing (0, i-1)

While I am at it, I want to make a new image with a Scalar specified. But there is no option in any constructor in EmguCV’s Mat object. How could I do this?

I can make two separate topics if that is considered more appropriate. Thanks in advance for any advice.

if you want my 2 ct. - dont use emgu

it’s not supported from opencv (3rd party wrapper), their forum is dead, and once you have an API problem, – you’re dead in the water.

Thanks! I’m glad the solution is to just not do it. I’ll go tell my boss that.

look at “opencvsharp” instead.

but yes, bosses need to be told “no” more often or else they go on believing this “mind over matter” nonsense and walk off the holodeck.

Thank you, that is helpful. I will look at it.

It’s kind of my fault, I jumped into what looked like an easier project. When working with a certain package/api you won’t get the best idea of its shortcomings until you hit a wall.