Hi, it seems like the text has a fixed color with few shades all with low saturation.
Drop everything with high saturation and different shades (working in HSV or Lab) by setting it to black. Something like: img[sat > 10] = [0,0,0] img[hue > x or hue < y] = [0,0,0] Open/close to remove "dust", you should have something to work on. Do not upscale the image because this will add new shades. If you have control over the image generation, choosing the font size/color of course may help. Bye, Lorenzo Il giorno sabato 20 luglio 2024 alle 08:13:08 UTC+2 abdulh...@gmail.com ha scritto: > Hi Tom. > > The position of text in thermography images are usually arbitrary. The > code I used for Otsu worked for some images, but not this. Seems like I > will have to optimize it. I need to be able to extract SP1, SP2 and Average > only. > > I actually just need the numericals. > > My usual MO during the times I use OpenCV would be just a binary > thresholding but it wasn't for text detection back then. > > I wish I could share more images; I'm on mobile right now. You might me > able to see what I mean better. > > Vizier87 > > > On Saturday 20 July 2024 at 01:00:20 UTC+8 tfmo...@gmail.com wrote: > >> It's going to be hard to solve a problem that you don't understand, but >> to start with you almost certainly don't want to be using Otsu >> thresholding. I would threshold precisely on the white that is used in the >> digits (assuming those are what you're trying to detect). >> >> Do you want just the average temp? If so, and it's in a fixed location, >> that should simplify the problem. >> >> If you want the SP1 & SP2 temps and they can be in variable places, >> that's going to be a little trickier and the first thing you probably want >> to do is to locate the registration marks and the text in the image. >> >> Tom >> > -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-ocr+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/06791d4f-7559-47f9-9dc3-a6c0efd852f2n%40googlegroups.com.