Questions tagged [image-segmentation]

Segmentation is a basic operation in image processing: its purpose is to group similar pixels into coherent regions = segments.

In image processing, image segmentation is the process of partitioning an image into multiple segments (sets of pixels). The goal of segmentation is to simplify and/or change the representation of an image into something that is more meaningful and easier to analyze. More precisely, image segmentation is the process of assigning a label to every pixel in an image such that pixels with the same label share certain visual characteristics.

The result of image segmentation is a set of segments that collectively cover the entire image. Each of the pixels in a region are similar with respect to some characteristic or computed property, such as color, intensity, or texture. Adjacent regions are significantly different with respect to the same characteristic(s).

Image segmentation is somewhat related to perceptual grouping: the spatial organization of visual stimuli. Some image segmentation algorithms attempt to employ Gestalt Laws of perceptual grouping to produce visually meaningful image segments.

Some popular image segmentation algorithms are Normalized cuts (by Shi and malik) and Mean-shift (by Comaniciu and Meer).

2542 questions
115
votes
2 answers

Image Segmentation using Mean Shift explained

Could anyone please help me understand how Mean Shift segmentation actually works? Here is a 8x8 matrix that I just made up 103 103 103 103 103 103 106 104 103 147 147 153 147 156 153 104 107 153 153 153 153 153 153…
Sharpie
  • 1,575
  • 2
  • 16
  • 22
113
votes
8 answers

Algorithm to detect corners of paper sheet in photo

What is the best way to detect the corners of an invoice/receipt/sheet-of-paper in a photo? This is to be used for subsequent perspective correction, before OCR. My current approach has been: RGB > Gray > Canny Edge Detection with thresholding >…
105
votes
3 answers

What is "semantic segmentation" compared to "segmentation" and "scene labeling"?

Is semantic segmentation just a Pleonasm or is there a difference between "semantic segmentation" and "segmentation"? Is there a difference to "scene labeling" or "scene parsing"? What is the difference between pixel-level and pixelwise…
78
votes
3 answers

How to define the markers for Watershed in OpenCV?

I'm writing for Android with OpenCV. I'm segmenting an image similar to below using marker-controlled watershed, without the user manually marking the image. I'm planning to use the regional maxima as markers. minMaxLoc() would give me the value,…
Tru
  • 1,467
  • 5
  • 18
  • 27
63
votes
4 answers

What is the difference between Keras model.evaluate() and model.predict()?

I used Keras biomedical image segmentation to segment brain neurons. I used model.evaluate() it gave me Dice coefficient: 0.916. However, when I used model.predict(), then loop through the predicted images by calculating the Dice coefficient, the…
35
votes
3 answers

Image segmentation based on edge pixel map

I have trained a classifier in Python for classifying pixels in an image of cells as edge or non edge. I've used it successfully on a few image datasets but am running into problems with this particular dataset, which seems pretty ambiguous even to…
33
votes
3 answers

Implementing skip connections in keras

I am implementing ApesNet in keras. It has an ApesBlock that has skip connections. How do I add this to a sequential model in keras? The ApesBlock has two parallel layers that merge at the end by element-wise addition.
Siddhartha rao
  • 487
  • 1
  • 4
  • 9
33
votes
5 answers

How to count the number of spots in this image?

I am trying to count the number of hairs transplanted in the following image. So practically, I have to count the number of spots I can find in the center of image. (I've uploaded the inverted image of a bald scalp on which new hairs have been…
B Faley
  • 17,120
  • 43
  • 133
  • 223
28
votes
2 answers

Data Augmentation Image Data Generator Keras Semantic Segmentation

I'm fitting full convolutional network on some image data for semantic segmentation using Keras. However, I'm having some problems overfitting. I don't have that much data and I want to do data augmentation. However, as I want to do pixel-wise…
TSW
  • 661
  • 2
  • 7
  • 11
27
votes
4 answers

scipy signal find_peaks_cwt not finding the peaks accurately?

I've got a 1-D signal in which I'm trying to find the peaks. I'm looking to find them perfectly. I'm currently doing: import scipy.signal as signal peaks = signal.find_peaks_cwt(data, np.arange(100,200)) The following is a graph with red spots…
cjm2671
  • 18,348
  • 31
  • 102
  • 161
25
votes
2 answers

How can I select the best set of parameters in the Canny edge detection algorithm implemented in OpenCV?

I am working with OpenCV on the Android platform. With the tremendous help from this community and techies, I am able to successfully detect a sheet out of the image. These are the step I…
Ankur Gautam
  • 1,412
  • 5
  • 15
  • 27
24
votes
4 answers

How to calculate the mean IU score in image segmentation?

How to compute the mean IU (mean Intersection over Union) score as in this paper? Long, Jonathan, Evan Shelhamer, and Trevor Darrell. "Fully Convolutional Networks for Semantic Segmentation."
hkcqr
  • 251
  • 1
  • 2
  • 5
22
votes
2 answers

OpenCV - Intersection between two binary images

Let's say I have two binary images of the same size. How do I find the intersection between the two binary images? Only pixels of the same coordinate (location) on the two images that are white (gray - 255) will give white pixels on the output image…
XterNalz
  • 325
  • 1
  • 5
  • 10
21
votes
5 answers

How to create mask images from COCO dataset?

So I have been using this code,. I am trying to generate the raw mask of the images from COCO dataset. dataDir='G:' dataType='train2014' annFile='{}/annotations/instances_{}.json'.format(dataDir,dataType) coco=COCO(annFile) annFile =…
21
votes
2 answers

TensorFlow: How to handle void labeled data in image segmentation?

I was wondering how to handle not labeled parts of an image in image segmentation using TensorFlow. For example, my input is an image of height * width * channels. The labels are too of the size height * width, with one label for every pixel. Some…
1
2 3
99 100