Ask Your Question
0

Agricultural field boundary segmentation and delineation

asked 2020-03-20 05:49:43 -0600

Hi, I'm looking for a method to segment cultivated fields quite accurately using satellite images. I initially tried edge delimitation but I don't think this can be converted to shapefile later so I'm considering the idea of segmenting the image. How can I proceed?

image description

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-03-27 10:46:04 -0600

mrersatz gravatar image

You might have some luck using the HFS segmentation technique built into the more recent versions:

import cv2
import numpy as np

img = cv2.imread("test-image.png")
# create engine
engine = cv2.hfs.HfsSegment_create(img.shape[0], img.shape[1])
engine.setSlicSpixelSize(50)
# perform segmentation
# now "res" is a matrix of indices
# change the second parameter to "True" to get a rgb image for "res"
res = engine.performSegmentCpu(img, True)
edit flag offensive delete link more

Comments

Sorry, I can't import the module 'cv2.hfs.HfsSegment_create' neither from cv2 nor from opencv-contrib.

How can I do that?

vins_26 gravatar imagevins_26 ( 2020-03-29 11:40:07 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-03-20 05:49:43 -0600

Seen: 789 times

Last updated: Mar 20 '20