{"id":25298817,"url":"https://github.com/azad77/detecting-and-counting-plants-using-computer-vision-techniques","last_synced_at":"2025-07-20T21:37:13.085Z","repository":{"id":253101347,"uuid":"842468033","full_name":"Azad77/Detecting-and-Counting-Plants-Using-Computer-Vision-Techniques","owner":"Azad77","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-23T21:40:59.000Z","size":989,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T05:41:27.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azad77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-14T12:14:22.000Z","updated_at":"2025-02-27T07:02:13.000Z","dependencies_parsed_at":"2024-08-14T13:50:11.846Z","dependency_job_id":null,"html_url":"https://github.com/Azad77/Detecting-and-Counting-Plants-Using-Computer-Vision-Techniques","commit_stats":null,"previous_names":["azad77/detecting-and-counting-plants-using-computer-vision-techniques"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Azad77/Detecting-and-Counting-Plants-Using-Computer-Vision-Techniques","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azad77%2FDetecting-and-Counting-Plants-Using-Computer-Vision-Techniques","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azad77%2FDetecting-and-Counting-Plants-Using-Computer-Vision-Techniques/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azad77%2FDetecting-and-Counting-Plants-Using-Computer-Vision-Techniques/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azad77%2FDetecting-and-Counting-Plants-Using-Computer-Vision-Techniques/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azad77","download_url":"https://codeload.github.com/Azad77/Detecting-and-Counting-Plants-Using-Computer-Vision-Techniques/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azad77%2FDetecting-and-Counting-Plants-Using-Computer-Vision-Techniques/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266204640,"owners_count":23892366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-13T04:51:52.142Z","updated_at":"2025-07-20T21:37:13.059Z","avatar_url":"https://github.com/Azad77.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plant Detection and Counting Using Computer Vision Techniques\n\n**Author:** Azad Rasul (azad.rasul@soran.edu.iq)  \n**Attribution:** The code was inspired by the DroneMapper CropAnalysis project.\n\n## Introduction\nThis project explores the use of computer vision techniques to detect and count plants using raster data. By leveraging tools like OpenCV, rasterio, and EarthPy, the tutorial processes raster datasets to identify and visualize plant locations. The method employs blob detection to count plants within a specified plot area accurately, providing valuable insights for applications in agriculture and environmental monitoring.\n\n## Data Download\nDownload the data from: [DroneMapper Crop Analysis Data](#) and extract it into the `data/` directory of your notebook.\n\n## Dependencies\nThe following Python libraries are required to run the code in this repository:\n\n- GeoPandas\n- NumPy\n- Rasterio\n- Matplotlib\n- EarthPy\n- OpenCV\n- Pandas\n\nYou can install them using pip:\n\n```bash\npip install geopandas numpy rasterio matplotlib earthpy opencv-python pandas\n```\n## Code Overview ##\n1. Import Libraries\nThe project starts by importing essential libraries for geospatial data handling, raster data processing, computer vision, and data visualization.\n\n2. Reading and Processing Data\nread_plot_data(file_path): Reads the plot data from a shapefile using GeoPandas.\nload_raster(file_path): Loads raster data from a file using Rasterio.\nmask_raster_with_plot(raster, plot): Masks the raster data with the plot extent, cropping and filtering the data.\ngenerate_plant_model(dem_clip, dtm_clip): Generates a plant model by calculating the difference between the DEM (Digital Elevation Model) and the DTM (Digital Terrain Model).\n3. Visualization\nplot_plant_model_and_binary(plant_model, binary_image, plot_extent): Plots the plant model and binary image using EarthPy and Matplotlib.\n4. Plant Detection\nsetup_blob_detector(): Configures the SimpleBlobDetector with parameters to detect blobs (plants) in an image.\ndetect_plants(binary_image_int, rgb): Detects plant keypoints in the binary image.\nplot_plant_count(rgb, keypoints): Visualizes the detected plants with blue circles on the RGB image.\n5. Image Normalization and Building True Color Image\nnormalize_rgb(image): Normalizes RGB image data to the range [0, 255].\nbuild_true_color_image(rgb_clip): Ensures RGB values are correctly scaled for true color representation.\nUsage\nAfter setting up the environment and downloading the necessary data, run the Python scripts or Jupyter notebooks provided in this repository. Follow the instructions within the code to process the data, detect plants, and visualize the results.\n\n## License ##\nThis project is licensed under the MIT License.\n\n## Acknowledgements ##\nThis project is heavily inspired by the DroneMapper CropAnalysis project. Special thanks to the original authors for providing the data and initial code structure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazad77%2Fdetecting-and-counting-plants-using-computer-vision-techniques","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazad77%2Fdetecting-and-counting-plants-using-computer-vision-techniques","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazad77%2Fdetecting-and-counting-plants-using-computer-vision-techniques/lists"}