A toolkit for crop sensing using the ZED camera
Project description
About The Project
unimi_crop_sensing nasce con l’obiettivo di offrire un insieme di operazioni semplici e intuitive per interagire con la camera ZED. Consiste in un toolkit per l'elaborazione e segmentazione di immagini e point cloud acquisiti tramite la camera stereo ZED. Il progetto è pensato per applicazioni di agricoltura di precisione, consentendo di identificare piante in 2D e 3D, generare bounding box e comunicare con un cobot attraverso WebSocket in ambiente ROS.
https://github.com/Hoppip48/unimi_crop_sensing/
Funzionalità principali
- Segmentazione del verde con Excess Green Index
- Clustering delle piante tramite KMeans
- Calcolo bounding box 2D e 3D su point cloud
- Salvataggio
.ply, immagini, normal map - Integrazione WebSocket ROS (
rosbridge) per invio/lettura pose
Built With
Getting Started
Prerequisites
Assicurati di avere:
- Python 3.9
- ZED SDK installato correttamente e funzionante
- ROS + rosbridge in esecuzione se si usa WebSocket
- Le librerie listate in
requirements.txt
Installation
Puoi usare unimi_crop_sensing come pacchetto Python installabile via PyPI. Installa tutto con:
pip install unimi_crop_sensing
⚠️ Pyzed 5.0 richiede numpy 2.x, ciò va in conflitto con altre funzioni del progetto, perciò se riscontri errori relativi a numpy, assicurati di installare una versione compatibile:
pip install "numpy<2"
Usage
Questo è un esempio di main che sfrutta ogni funzione per ottenere coordinate spaziali e point cloud di ogni piantina nel proprio raggio d'azione
# This function is used to test the functionalities of the crop sensing module
def main():
# Get the current pose of the cobot
pose = cobot_manager.get_cobot_pose(linux_ip)
# Initialize the ZED camera
zed = zed_manager.zed_init(pose)
# Capture the environment with the ZED camera
image, depth_map, normal_map, point_cloud = zed_manager.get_zed_image(zed, save=True)
# Filter the plants from the background
mask = find_plant.filter_plants(image, save_mask=True)
# Divide the plants into clusters
masks, bounding_boxes = find_plant.segment_plants(mask, plants_number)
find_plant.save_clustered_image(image, bounding_boxes)
# Extract the 3D points from the clusters
for m in masks:
bbxpts = find_plant.plot_3d_bbox(m, point_cloud)
# Communicate the bounding boxes to the cobot (only if the cobot is operated in another machine)
cobot_manager.send_cobot_map(linux_ip, bbxpts)
# Create point cloud (this will create a .ply file by taking a video of the environment)
create_plc.record_and_save(plant_name='piantina1', frames=300)
zed.close()
Contact
francescobassam.morgigno@studenti.unimi.it
Acknowledgments
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unimi_crop_sensing-0.5.tar.gz.
File metadata
- Download URL: unimi_crop_sensing-0.5.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d105d3ac9447925561716a72de04df085884c1c2bfd7b669d5c0a2db9d76d96
|
|
| MD5 |
689d0f5f95113f20d0ea1c73d44e0667
|
|
| BLAKE2b-256 |
e5891f9209f5de3c2c56bfe1439943be8ff9cf401c366f79090e9e9c5f817c86
|
Provenance
The following attestation bundles were made for unimi_crop_sensing-0.5.tar.gz:
Publisher:
release.yml on Hoppip48/unimi_crop_sensing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unimi_crop_sensing-0.5.tar.gz -
Subject digest:
5d105d3ac9447925561716a72de04df085884c1c2bfd7b669d5c0a2db9d76d96 - Sigstore transparency entry: 313017183
- Sigstore integration time:
-
Permalink:
Hoppip48/unimi_crop_sensing@9356db797699d63a68df706f08006ca78a3d0986 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Hoppip48
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9356db797699d63a68df706f08006ca78a3d0986 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file unimi_crop_sensing-0.5-py3-none-any.whl.
File metadata
- Download URL: unimi_crop_sensing-0.5-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1957d1fd8ef32060444c7c09cefa494c798dd81a54eaeac2f10187e2deebd93
|
|
| MD5 |
8dd96653cdf2be343e7ca0e1f15e4a10
|
|
| BLAKE2b-256 |
f6815b025ff599ed9a40458e674a0136ba76bbaa679cf5e768e65f7d884e50d8
|
Provenance
The following attestation bundles were made for unimi_crop_sensing-0.5-py3-none-any.whl:
Publisher:
release.yml on Hoppip48/unimi_crop_sensing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unimi_crop_sensing-0.5-py3-none-any.whl -
Subject digest:
e1957d1fd8ef32060444c7c09cefa494c798dd81a54eaeac2f10187e2deebd93 - Sigstore transparency entry: 313017197
- Sigstore integration time:
-
Permalink:
Hoppip48/unimi_crop_sensing@9356db797699d63a68df706f08006ca78a3d0986 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Hoppip48
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9356db797699d63a68df706f08006ca78a3d0986 -
Trigger Event:
workflow_dispatch
-
Statement type: