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
Used this code from Keely to make circular ROIs & will brainstorm how to best add this feature flexibly.
import geopandas as gpd
# Try to convert points file to shapefile with circles
gdf = gpd.read_file("./plant_positions.shp")
# Specify the desired diameter (in the same units as the CRS, e.g., meters)
radius = 0.4 # Half the diameter to use as buffer radius
# Generate a circle (buffer) around each point
gdf['geometry'] = gdf.geometry.buffer(radius)
# Save the resulting circles as a GeoJSON file
gdf.to_file('./output_circles.geojson', driver='GeoJSON')
geo_rois = geo.transform_polygons(img=spectral, geojson='./shpfiles/kura_center_circles.geojson')
# now take these contours and make them into a labeled mask?
all_objs = Objects()
lbl_mask = np.zeros(np.shape(gray)).astype(np.int32)
i = 1
for roi in geo_rois:
new = [np.array(roi, dtype=np.int32)]
lbl_mask = cv2.drawContours(lbl_mask.astype(np.int32), new, -1, (i), -1)
all_objs.append(contour=roi, h=[])
i += 1
label_mask_where = np.where(plant_mask == 255, lbl_mask, 0)
The text was updated successfully, but these errors were encountered:
Used this code from Keely to make circular ROIs & will brainstorm how to best add this feature flexibly.
The text was updated successfully, but these errors were encountered: