I have several small images and I want them to have exactly 100x100 pixel without scaling. To archieve that, I'm creating a white 100x100 image and copy the small image into those.
My code:
/*Small image*/
Emgu.CV.Mat Char = new Emgu.CV.Mat();
/*...fill small Image with stuff...*/
/*Create black Image (don't know how to create a White Image)*/
FinalChar = Emgu.CV.Mat.Zeros(100, 100, Emgu.CV.CvEnum.DepthType.Cv8U, 1);
/*Invert Image to become white*/
Emgu.CV.CvInvoke.BitwiseNot(FinalChar, FinalChar);
/*Copy small Image to large Image starting at row 5 and column 5*/
Char.CopyTo(FinalChar.Row(5).Col(5)); /*This is NOT working... Image 'Finalchar' is still White.*/
Please don't tell me about this post: OpenCV draw an image over another image
I don't know, but rowRange
and colRange
is not part of Emgu.CV.
Here is a small, not working example you can copy to try out:
/*Create small black image*/
Emgu.CV.Mat Small = Emgu.CV.Mat.Zeros(10, 10, Emgu.CV.CvEnum.DepthType.Cv8U, 1);
/*Create large white image*/
Emgu.CV.Mat Large = Emgu.CV.Mat.Zeros(20, 20, Emgu.CV.CvEnum.DepthType.Cv8U, 1);
Emgu.CV.CvInvoke.BitwiseNot(Large, Large);
/*Copy small, black image to large white image at 5,5 - the large image should
now contain a black rect in its center*/
Small.CopyTo(Large.Row(5).Col(5));
Emgu.CV.CvInvoke.NamedWindow("Output", Emgu.CV.CvEnum.NamedWindowType.AutoSize);
Emgu.CV.CvInvoke.Imshow("Output", Large);
Emgu.CV.CvInvoke.WaitKey();
return;