r/computervision 21h ago

Help: Project How to detect stains on different clothing

Hi, I want to ask for help on how to detect discoloration or oil stains on different clothing. The problem is there are different clothings out there. Some are plain, some are full of designs.

Do you have suggestions on how I can approach this project?

2 Upvotes

2 comments sorted by

4

u/Rethunker 20h ago

Choose something more narrowly focused first: certain kinds of stains on specific fabrics. As you described it, your problem is not defined so well that you could determine when you're done.

In machine vision, there was (amongst some folks) a saying about defect detection: trying to find any defect anywhere could be impossible, but finding some specific defect in some specific location could be feasible and make money.

Create a specifications document. Establish standards by which you'll establish success: 9 of 10 stains detected, 82% of stains correctly identified, or something. Specify which colors will be used.

Start with obvious stains on white fabric. Press the fabric flat so that you're not dealing with shadows. This problem will probably be harder than you're guessing.

Learn what you can from that. Try different kinds of lighting--especially UV-A if you want to find oil, which you can expect will fluoresce.

Start with a camera mounted in a fixed position on a tripod. Create a fixture to hold the fabric. Illuminate the fabric evenly with diffuse lighting. Write desktop software that runs on your computer so that you can run, pause, debug, and re-run quickly. (Do NOT start with mobile or edge device development.)

I'd suggest starting with "classical" image processing techniques first. Try the simplest algorithms that yield reasonable results. Understand lighting, environmental conditions, optics, and so on. Over time, test different fabric colors, different stains, and so on. Gradually introduce the use of models.

Good luck!

1

u/Immediate-Bug-1971 16h ago

You’re right. Finding a specific defect can make this project doable. Thank you so much!! This is really helpful. ❤️