Skip to main content

No project description provided

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.

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

⚠️ 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"

Installation

Puoi usare unimi_crop_sensing come pacchetto Python installabile via PyPI. Installa tutto con:

pip install unimi_crop_sensing

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

unimi_crop_sensing-0.4.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unimi_crop_sensing-0.4-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file unimi_crop_sensing-0.4.tar.gz.

File metadata

  • Download URL: unimi_crop_sensing-0.4.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for unimi_crop_sensing-0.4.tar.gz
Algorithm Hash digest
SHA256 9251291c35313033eae39f1287cbbd9110ede71eb7fed76f8e61289a303a56fa
MD5 d968f5346fdc6a31d5940680de0c6f70
BLAKE2b-256 2135363851e50eaf9d553652e0ec12930dec3005c35d960b8c22c9671216b9eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for unimi_crop_sensing-0.4.tar.gz:

Publisher: release.yml on Hoppip48/unimi_crop_sensing

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unimi_crop_sensing-0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for unimi_crop_sensing-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0a50889809002da93d79df478983ea8437e6a665c2cc0850c57a3535c5872f1d
MD5 e3b0a5e4bc28bc0abc3ac788f933e0cc
BLAKE2b-256 f4fb76d265c74b02c2d92ae78f3ac53403da1e02a0ba10e0a46ee7cfe8ee2075

See more details on using hashes here.

Provenance

The following attestation bundles were made for unimi_crop_sensing-0.4-py3-none-any.whl:

Publisher: release.yml on Hoppip48/unimi_crop_sensing

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page