Read and detect font from RGB image

1 次查看(过去 30 天)
Hey,
I try to detect textures from objects by the help of a color changing sensor. Depending on the underlaying texture, the stress of the surface of my sensor changes and thereby the color changes (no stress = red, more stress = green, much stress = blue). As you can see in the uploaded imaged, the texture is more or less "clearly" visible. Now I want to write a code that creates a binary mask which shows the texture. In the example that you can see here, I want to detect the letters "Grol" in the same font as seen on the picture, so if everything would work out as planed I would have a binary mask with black pixels on a white background shaping the word "Grol" in the handwritten-looking font.
I tried different ways to realize this. One by converting the picture into RGB, HSV, or Grayscale and analyzing the edges of the individual image channels (R/G/B or H/S/V). By morphological operations (erosion, dilatation) I wanted to solve my problem. However, several edge detection algorithms (canny, sobel, roberts, prewitt, log, zerocross) did not end up in the results I wanted. Mostly only a part of a letter is recognized, sometimes none are detected. Even after playing around with the parameters of all algorithms (structuring elements, gradients,...), I was not able to solve the problem.
My second approach, to detect only a specific color space and binarize pixels as 1 or 0 belonging to the fact if they are in, or out of the colour space, did also not work. The problem hereby is, that for example the background color on the picture I uploaded is dark green, but also parts of the font (bottom of the letters, have that green tone).
My question now is, whether you know another way to analyze images? Is there a function, or algorithm to detect such textures reliabley?
I mean as a human I find it very easy to read the writing when I look at the picture. I could trace the binary mask very easily if asked to draw it over the image. If it's so easy for me, then there must be a feature that makes the writing stand out. Am I on the wrong track?
If there are some image processing geniuses here, I would be very happy about help and tips. Many thanks for the help in advance.
Best, Raphael
  5 个评论
DGM
DGM 2022-5-13
So it really is strictly a matter of hue shift, and the intensity information is largely a matter of incidence.
Still, at least with this one image, I'm having a hard time getting a better extraction of the logo from the image. One of my points of attention has been the connecting stroke between the O and L. It's proving difficult to actually pick up that subtle, yet plainly visible detail. Some other areas are a bit difficult to manage due to the reflections of the surroundings.
That difficulty aside, the task of converting a tensile strain map to a binarized representation of the logo seems like it would be a challenge. The strain map is kind of a defacto map of edges and corners. If we consider an idealized edge map, how does one back-calculate the original image from its edge map? You might try to integrate or do something, but in this case, it's not really a consistent edge map to think that would work. Not all edges are highlighted. I'm not sure of a good approach. Then again, for the task of object discrimination, there may be a way to utilize the strain map without the need to actually fully recover the binarized logo. I'm not sure.
If you have a few other image examples, maybe I could poke around some more with those.
Raphael Pesch
Raphael Pesch 2022-5-13
@DGM First of all, thanks for still answering and trying to help. :-)
Of cause I can share some more pictures (I uploaded a bunch of example pictures in a dropbox file). Here is the link to them: DropBox Images (https://www.dropbox.com/scl/fo/q5hx2ke4kqu91ggttazu7/h?dl=0&rlkey=wfy2pf9myexxtgcmc5mrmpt6b). If you have time for it, feel free to play areound with them.
The reflections of the surroundings are hopefully soon no problem anymore. I am currently working on a process step that enables a anti reflection layer on the material, so that the white apperaing reflection won't/should,'t be a problem anymore.
Another idea than edge detection could be analyzing and filtering the picture with fourier transformation. However, I am have no good results with that approach so far. I still would be interested in how @Image Analyst was able to seperate the letters from the background so good as in his uploaded image. :/

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by