0

How to use Emgu CV inpaint function to reconstruct image without logo

I am trying to remove a logo from an image with Emgu CV and the following C# code, please help me make it remove the logo by creating a white logo on a black picture mask through binary inversion then use inpainting to reconstruct the original image without the logo. Here is the code am using   //get the image in picture box 1             Bitmap map = (Bitmap)pictureBox1.Image;             //convert the bitmap object to an emgu cv Image<Bgr, Byte> object             Image<Bgr, Byte> image = new Image<Bgr,Byte>(pictureBox1.ImageLocation);             //make sure you use an emgu cv library version 3.X , later versions do not support the above constructor                         //create a Mat object out of that inage object                         Mat mymat = image.Mat;             //convert the mat to gray scale             Mat gray = new Mat();             CvInvoke.CvtColor(mymat, gray,ColorConversion.Bgr2Gray);             //apply a threshold to the image to             //create a black and white mask  

12th Jan 2023, 5:20 PM
Timothy Njiru
Timothy Njiru - avatar
2 Answers
+ 3
1. Load the image into Emgu CV. 2. Create a mask image that covers the logo area. 3. Use the Inpaint function to reconstruct the image without the logo. 4. Save the reconstructed image to a file.
12th Jan 2023, 6:20 PM
Reza Mardani
Reza Mardani - avatar
0
Do you have sample code that compiles and works?
15th Jan 2023, 7:19 AM
Timothy Njiru
Timothy Njiru - avatar