{"id":13744329,"url":"https://github.com/sawankumarbundelkhandi/edge_detection","last_synced_at":"2025-05-16T16:01:45.389Z","repository":{"id":37735008,"uuid":"163279392","full_name":"sawankumarbundelkhandi/edge_detection","owner":"sawankumarbundelkhandi","description":"This is a flutter plugin to detect edges in a live camera, take the picture of detected edges object, crop it, and save.","archived":false,"fork":false,"pushed_at":"2024-10-02T16:41:22.000Z","size":200539,"stargazers_count":259,"open_issues_count":49,"forks_count":258,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-31T00:08:22.033Z","etag":null,"topics":["android","crop-image","edge-detection","flutter","flutter-plugin","ios","opencv","opencv-kotlin","scan-tool","scanner","smartpaperscanner","wescan"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/edge_detection","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sawankumarbundelkhandi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-12-27T10:10:51.000Z","updated_at":"2025-03-28T04:02:24.000Z","dependencies_parsed_at":"2023-02-08T06:01:04.783Z","dependency_job_id":"ee5ae2d5-c85e-400c-ba1b-e321bd158f97","html_url":"https://github.com/sawankumarbundelkhandi/edge_detection","commit_stats":{"total_commits":141,"total_committers":25,"mean_commits":5.64,"dds":0.5106382978723405,"last_synced_commit":"6c5399b39096186bbe4b86fdb015d434c2cf2bac"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawankumarbundelkhandi%2Fedge_detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawankumarbundelkhandi%2Fedge_detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawankumarbundelkhandi%2Fedge_detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawankumarbundelkhandi%2Fedge_detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sawankumarbundelkhandi","download_url":"https://codeload.github.com/sawankumarbundelkhandi/edge_detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247574085,"owners_count":20960496,"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":["android","crop-image","edge-detection","flutter","flutter-plugin","ios","opencv","opencv-kotlin","scan-tool","scanner","smartpaperscanner","wescan"],"created_at":"2024-08-03T05:01:07.476Z","updated_at":"2025-04-07T01:08:06.318Z","avatar_url":"https://github.com/sawankumarbundelkhandi.png","language":"Swift","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# edge_detection\n\nA flutter plugin to detect edges of objects, scan paper, detect corners, detect rectangles. It allows cropping of the detected object image and returns the path of the cropped image.\n\n## Usage:\n\n### iOS\n\niOS 13.0 or higher is needed to use the plugin. If compiling for any version lower than 13.0 make sure to check the iOS version before using the plugin. Change the minimum platform version to 13 (or higher) in your `ios/Podfile` file, and inform/request access to the permissions acording with `permission_handler`\n\n```\npost_install do |installer|\n  installer.pods_project.targets.each do |target|\n    flutter_additional_ios_build_settings(target)\n    target.build_configurations.each do |config|\n      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [\n        '$(inherited)',\n\n        ## dart: PermissionGroup.camera\n         'PERMISSION_CAMERA=1',\n\n        ## dart: PermissionGroup.photos\n         'PERMISSION_PHOTOS=1',\n      ]\n\n    end\n    # End of the permission_handler configuration\n  end\nend\n```\n\n## Fix build on xCode 15\n\nAdd this line to your Podfile in your project:\n\n```\npod 'WeScan', :path =\u003e '.symlinks/plugins/edge_detection/ios/WeScan-3.0.0'\n```\n\n=\u003e like this below:\n\n```\ntarget 'Runner' do\n  use_frameworks!\n  use_modular_headers!\n  pod 'WeScan', :path =\u003e '.symlinks/plugins/edge_detection/ios/WeScan-3.0.0'\n  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))\nend\n```\n\nAdd below permission to the `ios/Runner/Info.plist`:\n\n- one with the key `Privacy - Camera Usage Description` and a usage description.\n\nOr in text format add the key:\n\n```xml\n\u003ckey\u003eNSCameraUsageDescription\u003c/key\u003e\n\u003cstring\u003eCan I use the camera please?\u003c/string\u003e\n\u003ckey\u003eNSPhotoLibraryUsageDescription\u003c/key\u003e\n\u003cstring\u003eCan I use the photos please?\u003c/string\u003e\n\u003ckey\u003eNSPhotoLibraryAddUsageDescription\u003c/key\u003e\n\u003cstring\u003eCan I use the photos please?\u003c/string\u003e\n```\n\nAdd to your need localizations to your app through XCode for localize actions buttons from WeScan (https://github.com/WeTransfer/WeScan/tree/master/WeScan/Resources/Localisation)\n\n### Android\n\nThe plugin code is written in kotlin 1.8.0 so the same has to be set to the android project of yours for compilation.\nChange the kotlin_version to 1.8.0 in your `android/build.gradle` file.\n\n```\next.kotlin_version = '1.8.0'\n```\n\nChange the minimum Android SDK version to 21 (or higher) in your `android/app/build.gradle` file.\n\n```\nminSdkVersion 21\n```\n\n### Add dependency：\n\nPlease check the latest version before installation.\n\n```\ndependencies:\n  flutter:\n    sdk: flutter\n  edge_detection: ^1.1.3\n  permission_handler: ^10.0.0\n  path_provider: ^2.0.11\n  path: ^1.8.2\n```\n\n### Add the following imports to your Dart code:\n\n```\nimport 'package:edge_detection/edge_detection.dart';\n```\n\n```dart\n// Check permissions and request its\nbool isCameraGranted = await Permission.camera.request().isGranted;\nif (!isCameraGranted) {\n    isCameraGranted = await Permission.camera.request() == PermissionStatus.granted;\n}\n\nif (!isCameraGranted) {\n    // Have not permission to camera\n    return;\n}\n\n// Generate filepath for saving\nString imagePath = join((await getApplicationSupportDirectory()).path,\n    \"${(DateTime.now().millisecondsSinceEpoch / 1000).round()}.jpeg\");\n\n// Use below code for live camera detection with option to select from gallery in the camera feed.\n\ntry {\n    //Make sure to await the call to detectEdge.\n    bool success = await EdgeDetection.detectEdge(imagePath,\n        canUseGallery: true,\n        androidScanTitle: 'Scanning', // use custom localizations for android\n        androidCropTitle: 'Crop',\n        androidCropBlackWhiteTitle: 'Black White',\n        androidCropReset: 'Reset',\n    );\n} catch (e) {\n    print(e);\n}\n\n// Use below code for selecting directly from the gallery.\n\ntry {\n    //Make sure to await the call to detectEdgeFromGallery.\n    bool success = await EdgeDetection.detectEdgeFromGallery(imagePath,\n        androidCropTitle: 'Crop', // use custom localizations for android\n        androidCropBlackWhiteTitle: 'Black White',\n        androidCropReset: 'Reset',\n    );\n} catch (e) {\n    print(e);\n}\n\n```\n\n## Demo\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/sawankumarbundelkhandi/edge_detection/master/screenshots/demo.gif\" alt=\"Demo\" style=\"margin:auto\" width=\"372\" height=\"686\"\u003e\n\u003c/p\u003e\n\n## Screenshots\n\n# Android\n\n\u003cdiv style=\"text-align: center\"\u003e\n   \u003ctable\u003e\n      \u003ctr\u003e\n         \u003ctd style=\"text-align: center\"\u003e\n            \u003cimg src=\"https://raw.githubusercontent.com/sawankumarbundelkhandi/edge_detection/master/screenshots/android/1.png\" width=\"200\"/\u003e\n         \u003c/td\u003e\n         \u003ctd style=\"text-align: center\"\u003e\n            \u003cimg src=\"https://raw.githubusercontent.com/sawankumarbundelkhandi/edge_detection/master/screenshots/android/2.png\" width=\"200\" /\u003e\n         \u003c/td\u003e\n         \u003ctd style=\"text-align: center\"\u003e\n            \u003cimg src=\"https://raw.githubusercontent.com/sawankumarbundelkhandi/edge_detection/master/screenshots/android/3.png\" width=\"200\"/\u003e\n         \u003c/td\u003e\n      \u003c/tr\u003e\n   \u003c/table\u003e\n\u003c/div\u003e\n\n# iOS\n\n\u003cdiv style=\"text-align: center\"\u003e\n   \u003ctable\u003e\n      \u003ctr\u003e\n         \u003ctd style=\"text-align: center\"\u003e\n            \u003cimg src=\"https://raw.githubusercontent.com/sawankumarbundelkhandi/edge_detection/master/screenshots/ios/1.PNG\" width=\"200\"/\u003e\n         \u003c/td\u003e\n         \u003ctd style=\"text-align: center\"\u003e\n            \u003cimg src=\"https://raw.githubusercontent.com/sawankumarbundelkhandi/edge_detection/master/screenshots/ios/2.PNG\" width=\"200\" /\u003e\n         \u003c/td\u003e\n         \u003ctd style=\"text-align: center\"\u003e\n            \u003cimg src=\"https://raw.githubusercontent.com/sawankumarbundelkhandi/edge_detection/master/screenshots/ios/3.PNG\" width=\"200\"/\u003e\n         \u003c/td\u003e\n      \u003c/tr\u003e\n   \u003c/table\u003e\n\u003c/div\u003e\n   \nUsing these native implementation   \n\u003ca\u003ehttps://github.com/WeTransfer/WeScan\u003c/a\u003e\n\n\u003ca\u003ehttps://github.com/KePeng1019/SmartPaperScan\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsawankumarbundelkhandi%2Fedge_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsawankumarbundelkhandi%2Fedge_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsawankumarbundelkhandi%2Fedge_detection/lists"}