You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: imagery/i.segment/outline
+2-2
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ I think this will apply to vector lines only, initially it was framed as being f
109
109
110
110
/*ML: vector to raster conversion is probably necessary. Pixels crosses by a line (polygon boundary or not) have to become part of a segment boundary.*/
111
111
/*EM: hmm, OK, something else for discussion: These pixels that are on a vector line, should they eventually be included in one of the adjacent segments? Is "segment boundary" just the edge pixels of the segment, or are the not included in any segment?*/
112
-
/*ML: Here is where a difference comes into play between lines that are boundary polgons and lines as linear features. In my eyes pixels that are on boundarylines of polygons should be part of the segments that are internal to that boundary. Linear features would have to be treated differently. During discussions with colleagues we did have some difficulties finding actual use cases for linear features. Maybe we can start with only polygon features and if the use case of a linear features comes up try to integrate that then ?*/
112
+
/*ML: Here is where a difference comes into play between lines that are boundary polygons and lines as linear features. In my eyes pixels that are on boundarylines of polygons should be part of the segments that are internal to that boundary. Linear features would have to be treated differently. During discussions with colleagues we did have some difficulties finding actual use cases for linear features. Maybe we can start with only polygon features and if the use case of a linear features comes up try to integrate that then ?*/
113
113
/*EM: But for polygons covering the entire map, there is a segment on either side of the polygon line. If the line crosses the pixel, what should be done... It looks like this will not be a problem for multi-scalar segmentation, the polygons generated in a high level segmentation will be exactly between pixels. This will only be an issue for polygons generated elsewhere, smoothed, at different resolution, etc.*/
114
114
/* MM: You can not know where the polygons are coming from, therefore you have consider all cases or, better, come up with a general solution. You will need to clone (substantial) parts of the t.to.vect module if you want to rasterize polygons/boundaries. If you do not rasterize, you will need to check for a boundary/line whenever you evaluate a neighbor. This could be sped up a bit by selecting all boundaries/lines crossing the current 3x3 neighborhood. The spatial selection of vector features is fast, but doing that for every cell/3x3 neighborhood can substantially slow down the module. You will also need to check if the boundary is actually part of an area (not an invalid boundary). Then you will need to check if the focus cell is inside the area, if not, if the neighbor is inside the area. Even though some spatial information gets lost by rasterization, I tend to recommend rasterization. In any case, taking into account boundaries/lines can easily become the bulk of the code, the most complex part of the code, and the most time-consuming component of the module. */
115
115
/* EM: left the above discussion... unresolved. One thought: instead of storing the output as a raster, maybe it should be first converted to a map, edges representing the neighbor relationship. After we have a map, we could use the vector map to delete edges crossing the borders. This is done once, afterwards we never calculate neighbors, only check for edges. It seems this will be a very large memory structure to start with, but as the segmentation continues it will get smaller.
@@ -271,7 +271,7 @@ will use function pointer based on input, to select 4 or 8 neighbors
0 commit comments