Read .bin image file with opencv

Can we read a .bin image file with the opencv imread function or should we use it with traditional fopen or ifstream for that?

no, opencv cannot figure out what’s in a headerless binary file. nothing can.

only you know what is in there.

you can construct a new Mat to fit the parameters that you know. you can make it use other memory (from a vector). you can even .clone() it so that you get a Mat that owns fresh memory with the contents copied over.