Remove black border lines around image after scan with opencv c++
I have tiff images. After scan those images, there are long black lines around the the borders.
I manualy crop the image with increase x += 50; y += 50; width -= 100; heigth -= 100
With above approache, I can crop the images.
I want to ask if there is any way i could remove it autometically without tunning the parameters of x, y, width and heigth such as image enhancement?
Thank
EDITED
- The image is grayscale image
- There is only black and white color in the image so basically i would like to replace those black color with whit color
- After scan the image there are long black pixel at the borders of the image and i want to remove that
you probably meant: x += 50; y += 50; width -= 100; heigth -= 100