{"id":25388938,"url":"https://github.com/potatomexicano/identify_leaf","last_synced_at":"2026-04-30T15:31:16.739Z","repository":{"id":140407734,"uuid":"491926226","full_name":"PotatoMexicano/Identify_LEAF","owner":"PotatoMexicano","description":"Identificação de elementos verdes em fotos, usado para detectar folhas/mato em fotos","archived":false,"fork":false,"pushed_at":"2022-06-09T14:28:53.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T21:43:08.584Z","etag":null,"topics":["leaf","opencv","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PotatoMexicano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-05-13T14:20:21.000Z","updated_at":"2023-02-15T19:46:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"75634170-308f-4d7f-a865-088974359613","html_url":"https://github.com/PotatoMexicano/Identify_LEAF","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PotatoMexicano/Identify_LEAF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMexicano%2FIdentify_LEAF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMexicano%2FIdentify_LEAF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMexicano%2FIdentify_LEAF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMexicano%2FIdentify_LEAF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PotatoMexicano","download_url":"https://codeload.github.com/PotatoMexicano/Identify_LEAF/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMexicano%2FIdentify_LEAF/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32469344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["leaf","opencv","python"],"created_at":"2025-02-15T13:40:20.813Z","updated_at":"2026-04-30T15:31:16.725Z","avatar_url":"https://github.com/PotatoMexicano.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Identify_LEAF\nIdentificação de elementos verdes em fotos, usado para detectar folhas/mato em fotos\n![EPF_20220316135458_af1db44382964e22bc121a1fc84fa38c](https://user-images.githubusercontent.com/34165801/171314607-f4803803-e98c-416c-ba99-46b4ccad7430.jpg)\n\n# Código\n\n```python\nimport cv2\nimport numpy as np\nimport os \n\ncaminho_imagem = input(\"Caminho Imagens: \")\nfor root, _, files in os.walk(caminho_imagem):\n    for file in files:\n        if file.endswith(\".jpg\"):\n            imagem = os.path.join(root, file)\n            img = cv2.imread(imagem)\n            hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)\n\n            lower = np.array([27, 0, 20])\n            upper = np.array([70, 255, 255])\n\n            mask = cv2.inRange(hsv, lower, upper)\n\n            total_pix = mask.size\n            number_of_white_pix = np.sum(mask==255)\n            number_of_black_pix = np.sum(mask==0)\n\n            print(f\"Brancos | Folhas: {number_of_white_pix}\")\n            print(f\"Pretos | Não Folhas: {number_of_black_pix}\")\n            print(\"Porcentagem folhas: {:.0%}\".format((number_of_white_pix/total_pix)))\n\n            if (not(os.path.exists(os.path.join(caminho_imagem,'RESULT')))):\n                os.makedirs(os.path.join(caminho_imagem, 'RESULT'))\n\n            store = os.path.join(caminho_imagem, \"RESULT\",file)\n\n            img2 = cv2.merge((mask,mask,mask))\n\n            vis = np.concatenate((img, img2), axis=1)\n            cv2.imwrite(store, vis)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotatomexicano%2Fidentify_leaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotatomexicano%2Fidentify_leaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotatomexicano%2Fidentify_leaf/lists"}