Problems creating a chroma key without mask on C++

Hi,
Why do you mean by it does not work?
Vec3b is three byte. Are you sure that frame got three channel?

I can replace your code with one line
frame.setTo(bgra);

Don’t use loop to access pixel