Hello, the module is working perfect with your demo image, but, as you can see with the attached screenshot, the result is really not good with our test files, where the camera position is fixed.
Unfortunately the background and foreground images need to be very close for it to work well. You can see in your images that the contrast has changed which is tripping it up. You might try adjusting the input images.
For instance, here is a quick test I did where I auto-adjusted the color and cropping of your images before subtraction:
But you should test the various color adjustment methods to see what gives you the best result:
Hi Nigel, thanks for your response. It seems that we need to make manual adjustments, because you know in real life background doesnt remain %100 same :)) We put a denim over the surface and want to crop the denim but we can not keep the background lightning completely constant of course. Even the denim is changing the light...
Yes, unfortunately we are limited by the functionality of the OpenCV library that this feature is based on. You might find that some adjustments can be automated, e.g. cropping based on the know bounds of the denim, and some sort of equalization of the image color range or brightness.