---
# System prepended metadata

title: 3.2 Placing Markers

---

# 3.2 Placing Markers

The following tools can be used to place markers in 2D iamge in an interactive manner:
-- Grain markers
![](https://i.imgur.com/ZPAGKPa.png) add grain marker
![](https://i.imgur.com/cYljEVs.png)  erase grain marker - by pixel
![](https://i.imgur.com/a3wautH.png) delete grain marker - by connected pixels

-- Background markers
![](https://i.imgur.com/nHWwaCz.png) add background marker
![](https://i.imgur.com/YwT6FrR.png) erase background marker - by pixel
![](https://i.imgur.com/DllQZLz.png) delete background marker - by connected pixels


## For both grain and background markers
- Markers are of the size of "a pixel".
- Placing markers in a connected fashion (see following examples) to guide the segmentation process to produce desirded result.
- Although they have different names, they are treated equally as "markers" in marker controlled watershed segmentation in iPeriGrain. This means they have the same influence on the segmentation process to generate segments.
- The only difference is in the post-processing, where the resultant segments would be discarded if the background markers are placed inside it. In the case when both grain and background markers are present in the same segment, it will be discarded due to the presence of background marker.
## Common issues of delineating gravel grains in 2D images with automatic algorithm

- Oversegmentation
&emsp;- A grain is divided into more than two segments.
- Undersegmentation
&emsp;- Several grains are grouped as one segment.
 - Backgound area
&emsp;- Blurry area in the image that cannot be regarded as a grain with certainty.

## Example with DEM
### ***How to fix oversegmentation with iPeriGrain***
In this example, the target grain in the DEM is oversegmented as 3 grains.

-- DEM
![](https://i.imgur.com/pGGRszb.png)


-- Result with oversegmentation
![](https://i.imgur.com/ybWcaAt.png)


-- Use "add grain marker" tool to place the grain markers on the target grain in a connected fashion.
![](https://i.imgur.com/XFsjBxs.png)

-- ReSegment
![](https://i.imgur.com/WXiaA22.png)

---
### ***How to fix undersegmentation with iPeriGrain***
In this example, several grains are undersegmented as one large grain.

-- DEM
![](https://i.imgur.com/V4E4fKW.png)

-- Result with undersegmentation
![](https://i.imgur.com/CdU0dY2.png)

-- Use "add grain marker" tool to place the grain markers on the target grain and its neighboring grain in a connected fashion. Robust result can be obtained by placing the grain markers follwing the perimenters of the grain-of-interest, while staying inside the grain. Avoid placing markers on the edge.
![](https://i.imgur.com/bgfrd5F.png)


-- ReSegment
![](https://i.imgur.com/4WDTAnH.png)

---
### ***How to discard background area***
-- DEM
![](https://i.imgur.com/zywZrUf.png)

-- First, grains that surround the background area should be segmented. Grain markers should be used to guide the segementation process when necessary.
![](https://i.imgur.com/JjJV0By.png)

-- Second, use "add background marker" tool to place the background marker in the background area.
![](https://i.imgur.com/bTU5bNZ.png)

-- ReSegment
![](https://i.imgur.com/zmaGZuE.png)

---
## Example with optical image
### ***How to fix oversegmentation and undersegmentation simulataneously in iPeriGrain***

The issues of oversegmentation and undersegmentaion is prominent due to variations of textures, size, shape, shadow, etc, inside the optical image. It is quite common to see co-existence of oversegmentation and undersegmentaion.

-- Optical image
![](https://i.imgur.com/CcnmhiK.jpg)

-- The target grain is oversegmented into several grains while the upper portion of the target grain is grouped into another grain (i.e., undersegmentation).
![](https://i.imgur.com/lT2QXVh.jpg)

-- Use "add grain marker" tool to place the grain markers on the target grain in a connected fashion. Robust result can be obtained by placing the grain markers follwing the perimenters of the grain-of-interest, while staying inside the grain.
![](https://i.imgur.com/HzlZbHa.jpg)

-- ReSegment
![](https://i.imgur.com/8oiz1Dt.jpg)

### ***How to discard background area***

-- Optical image
![](https://i.imgur.com/92FCR3M.jpg)

-- First, grains that surround the background area should be segmented. Grain markers should be used to guide the segementation process when necessary.
![](https://i.imgur.com/gv2iyOk.jpg)

-- Second, use “add background marker” tool to place the background marker in the background area
![](https://i.imgur.com/TVMtInA.jpg)

-- ReSegment
![](https://i.imgur.com/PQsOjUx.jpg)


