Does image segmentation algorithm consider only shape? Or size, color and surface pattern as well? - image-segmentation

I have 100 different object categories that are sometimes closely similar in shape but they differ in color, size and surface pattern. Does any image segmentation algorithm consider color, size and pattern as well or they just look at the outlines of the object?
Thanks

Image segmentation can be based on the following:
contrast
colour
shape
pattern
depth (or temperature, etc)
motion
Just to avoid citing wikipedia here is a combination of depth and colour segmentation:
Complete example.
Complex colour:
Complete example
More segmentation examples

Related

Why superpixel should adhere well to image boundaries?

I am reading a paper from EPFL SLIC-Superpixel comparision to state-of-the-art which says that superpixel should adhere to image boundaries. What is the need of adhering to image boundary of the image ?
A superpixel is an image region containing similar pixels. An image boundary, or edge, is a boundary between different parts of the image (not to be confused with the outside border of the image). As a consequence, a good superpixel algorithm will have all edges in the image covered by superpixel boundaries, because otherwise, this would mean that there is an edge going through a superpixel, i.e. the superpixel would span two different image regions, and that is not compatible with the superpixel definition.
Of course, as superpixels become larger and larger, and allow including pixels that are more and more different from one another, superpixels will start extending past weak edges in the image. Strong edges will, however, still be covered by superpixel boundaries.

how to include a dark border to bright segmented image?

I have an image like this.note that the regions are not perfectly shaped.it is rectangular like region and ellipse like region. I have segmented the ellipse like region using some algorithm.segmented region is bright one.the border (red rectangle) is dark one
finally i must get red rectangular like region
can you suggest any algorithm to perform this
I see that you have done some real progress on your segmentation. Because you already have an idea of the location of elements you want to segment, you should use a watershed with constraints/markers:
Your actual segmentation represents the inner markers.
You dilate it with a big structuring element (bugger than the inter disk space).
You take the contour of the dilation, and that's your outer markers.
You compute the gradient of the original image.
You apply the watershed on the gradient image, using the markers you have just computed.
[EDIT] As the segmentation you provided does not match with the original image (different dimensions), I had to simulate roughly a simple segmentation, using this image (the red lines being the the segmentation you already have). And I got this result.

Image Segmentation Using Prior Shape Information Matlab

I have a series of medical images from which I am attempting to segment out and analyze the ECG tracings in Matlab (the green, spiking line in the image below):
I have so far been successful in doing this on a small set of images using color thresholding and region properties. My problem is that almost all aspects of this feature of interest can change depending on the manufacturer of the machine used to produce the images and the behavior of the user operating it (over which I have 0 control).
Potentially differing attributes include line position in the image (which can change to be almost anywhere in the image), amplitude, frequency, and even color (which can be changed to match the color of the large white surface under the line in the above image). This makes it extremely difficult to create a robust segmentation solution for all images relying only on "simple" methods (color segmentation, region properties, edge detection etc).
Would it be straight forward to train a classifier to identify the general shape of this line and segment it out? Alternatively, is there another way to search and segment an image using prior shape information?
If you are currently applying an arbitrary threshold, you can look at various technique for dynamic thresholding (here a technique that applies the concept on edge detection).
What you could also try is to threshold on a different representation of the image, such as HSL and HSV (as I am assuming you are thresholding on the RGB values)
You may use a classifier and active contour model to segment the desired region. An example can be found here: http://pratondo.staff.telkomuniversity.ac.id/2016/01/14/robust-edge-stop-functions-for-edge-based-active-contour-models-in-medical-image-segmentation/

thresholding an image based on gradient

I have multiple simple circle objects in grid of an image from which I want to create mask image for the objects. A gotcha is that light intensity for each object is different. So simple thresholding would not create a mask.
As a solution, I want to threshold based on gradient. Basically, I'd like to first find the circle with edge detection and make inside of the circle white and outside black. But this is really slow. Is there any better way to do this on matlab?
I would create a low-pass filtered version of the image, and use it as the threshold. The "strength" of the filter should be tuned carefully in order to make the result follow the distribution of light intensity, but this is not that hard.
(This approach worked for me when I had to extract the contour of blood vessels from brain-surface images, few years ago.)

Remove paper texture pattern from a photograph

I've scanned an old photo with paper texture pattern and I would like to remove the texture as much as possible without lowering the image quality. Is there a way, probably using Image Processing toolbox in MATLAB?
I've tried to apply FFT transformation (using Photoshop plugin), but I couldn't find any clear white spots to be paint over. Probably the pattern is not so regular for this method?
You can see the sample below. If you need the full image I can upload it somewhere.
Unfortunately, you're pretty much stuck in the spatial domain, as the pattern isn't really repetitive enough for Fourier analysis to be of use.
As #Jonas and #michid have pointed out, filtering will help you with a problem like this. With filtering, you face a trade-off between the amount of detail you want to keep and the amount of noise (or unwanted image components) you want to remove. For example, the median filter used by #Jonas removes the paper texture completely (even the round scratch near the bottom edge of the image) but it also removes all texture within the eyes, hair, face and background (although we don't really care about the background so much, it's the foreground that matters). You'll also see a slight decrease in image contrast, which is usually undesirable. This gives the image an artificial look.
Here's how I would handle this problem:
Detect the paper texture pattern:
Apply Gaussian blur to the image (use a large kernel to make sure that all the paper texture information is destroyed
Calculate the image difference between the blurred and original images
EDIT 2 Apply Gaussian blur to the difference image (use a small 3x3 kernel)
Threshold the above pattern using an empirically-determined threshold. This yields a binary image that can be used as a mask.
Use median filtering (as mentioned by #Jonas) to replace only the parts of the image that correspond to the paper pattern.
Paper texture pattern (before thresholding):
You want as little actual image information to be present in the above image. You'll see that you can very faintly make out the edge of the face (this isn't good, but it's the best I have time for). You also want this paper texture image to be as even as possible (so that thresholding gives equal results across the image). Again, the right hand side of the image above is slightly darker, meaning that thresholding it well will be difficult.
Final image:
The result isn't perfect, but it has completely removed the highly-visible paper texture pattern while preserving more high-frequency content than the simpler filtering approaches.
EDIT
The filled-in areas are typically plain-colored and thus stand out a bit if you look at the image very closely. You could also try adding some low-strength zero-mean Gaussian noise to the filled-in areas to make them look more realistic. You'd have to pick the noise variance to match the background. Determining it empirically may be good enough.
Here's the processed image with the noise added:
Note that the parts where the paper pattern was removed are more difficult to see because the added Gaussian noise is masking them. I used the same Gaussian distribution for the entire image but if you want to be more sophisticated you can use different distributions for the face, background, etc.
A median filter can help you a bit:
img = imread('http://i.stack.imgur.com/JzJMS.jpg');
%# convert rgb to grayscale
img = rgb2gray(img);
%# apply median filter
fimg = medfilt2(img,[15 15]);
%# show
imshow(fimg,[])
Note that you may want to pad the image first to avoid edge effects.
EDIT: A smaller filter kernel than [15 15] will preserve image texture better, but will leave more visible traces of the filtering.
Well i have tried out a different approach using Anisotropc diffusion using the 2nd coefficient that operates on wider areas
Here is the output i got:
From what i can See from the Picture, the Noise has a relatively high Frequency Compared to the image itself. So applying a low Pass filter should work. Have a look at the Power spectrum abs(fft(...)) to determine the cutoff Frequency.