Image segmentation on difficult background

Hi,
I'm trying image segmentation of the red striped zones in the picture. However, i always get an unclear segmentation of back- and foreground if i generalize one code for other pictures that lookalike. I've triend threshold (global and adaptive), region growing, k-means clustering, edge based (roberts, sobel, prewitt, canny, approxcanny, zerocross, log), texture based (using entropyfilt), the image segmenter app and the color segmentation app (HSV segmentation). However, for each of these i always got bad results if i made a script for one picture and then used it for other pictures that were a like f.e. make one for the first picture 'untitled1' and then use it for the second 'untitled3'. I'm trying to look for other ways but I'm kind off stuck... Is there any type of segmentation that I'm missing? Do you know a code that could work for these kinds of images?
Thanks in advance!

5 Comments

I don't know what you are trying to say. The red pixels are just one pixel wide lines/curves that partically cross the "legs" of the V. Where are the zones? Do you want each zone to be segmented as a binary image mask for that one zone only?
Even if it were clear which part of the image you were trying to segment, we'd need an example of the image without the annotations.
Hi, yes i'm sorry i get my explanation is confusing. So these red lines are not pixels that i want to segment. These are lines that i added manually to show what I need to segment out of the picture. So this red hatched area, is the area that is foreground. So the foreground is the grey (or purple) area. I added the two images without the red lines.
Are you just trying to get everything other than the very tops of the V? Or is it just the part with the repeating bar pattern?
If it's just the bar pattern, is the blue part included? What about the part of the bar pattern in the top-left of the first picture?
I get they're annotations, but I don't understand conceptually what the common target is between the images.
First of all, Thank you! Very much appreciated that your willing to help me!
It is just the bar pattern. So the purple areas on your images are good, however for example for the first and second picture the bleu encircled areas are background (see my attachments). So actually i'm trying to segment the bar pattern out of this images (not in edges but really the area). The goal is to make a script to see where the patterns are interrupted. So the left image is whole, while the right one is interrupted. If i know the area's of the patterns i can see for example that in the right picture this area where such a bar pattern is, is smaller then the left one which indicates it's interrupted.

Sign in to comment.

Answers (1)

Hi,
I believe you've tried a broad range of conventional methods without satisfactory results, it might be worthwhile to explore deep learning based approaches, which has shown significant success in image segmentation tasks.
You can use semantic segmentation in MATLAB for your purpose. You can refer the following documentaion for further reference: https://www.mathworks.com/help/vision/ug/semantic-segmentation-using-deep-learning.html
You can also consider creating your own deep learning network that you can customize as per your input data. You can create your own custom training loops, loss functions, and optimization algorithms. This is particularly useful for adapting the network to the specific characteristics of your images.
You can refer the following documentation on how to create your own Deep Learning Network in MATLAB using the Deep Learning Toolbox: https://www.mathworks.com/help/deeplearning/ref/dlnetwork.html
Hope this helps!

Products

Release

R2021b

Asked:

on 6 Dec 2021

Answered:

on 18 Apr 2024

Community Treasure Hunt

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

Start Hunting!