분류, 패키지 및 저장소 검색

opencv_4 표지
패키지 상세v1.0.0

opencv_4

OpenCV 모듈의 컬렉션을 포함하는 플러터 패키지 프로젝트입니다.

AndroidiOS
30일 다운로드
80
좋아요
102
Pub 점수
130

패키지 설치

flutter pub add opencv_4

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flutter 애플리케이션 내에서 컴퓨터 비전 기능을 가능하게 하는 OpenCV 모듈의 컬렉션을 통합하는 플러터 패키지입니다. Android 및 iOS 플랫폼을 지원하며 개발자가 OpenCV의 강력한 이미지 및 비디오 처리 기능을 직접 앱에서 활용할 수 있도록 합니다. 원격 OpenCV 라이브러리와 함께 사용하도록 설계되어 객체 감지, 이미지 필터링, 얼굴 인식 등의 기능에 접근할 수 있습니다. 멀티미디어 편집, 증강 현실 및 실시간 이미지 분석 작업에 적합합니다.

사용 사례

  • 모바일 앱에서의 이미지 처리
  • 실시간 비디오 분석
  • 객체 탐지 및 추적
  • 증강현실 애플리케이션
  • 얼굴 인식 시스템

주요 기능

  • 여러 OpenCV 모듈에 대한 액세스
  • 크로스 플랫폼 지원 (Android 및 iOS)
  • 내장 OpenCV 통합
  • 이미지 및 비디오 조작을 지원합니다
  • 가벼우면서도 모듈식 디자인

적합한 대상

  • 모바일 앱 개발자
  • 컴퓨터 비전 애호가
  • AR/VR 애플리케이션 제작자
  • 다중미디어 처리 도구
  • 이미지 분석을 포함하는 교육 프로젝트

고려 사항

  • 네이티브 OpenCV 설정이 필요합니다
  • 앱 크기 증가 가능
  • 사용 가능한 문서가 제한되어 있습니다
  • 플랫폼별 빌드 구성
  • 저사양 기기에서 성능 오버헤드 가능성

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

OpenCV_4

This package contains the implementation of OpenCV modules, the version used is 4.3.0 for both Android and iOS platforms.


Platform Nullsafety Pub Package
License: BSD-3-Clause


Español | Portugués


Table of contents

About this version

Compatibility

  • It is developed for the integration of the OpenCV artificial vision library in its version 4.3.0
  • It is compatible with Android and iOS.
  • Easy integration with popular flutter packages like image_picker was kept in mind, to process images from gallery or camera, you can see the implementation example here, in this case you need to configure the flutter project with Nullsafety..
  • The implemented OpenCV modules are the following:
    • Image Processing
      • Image Filtering
        • bilateralFilter
        • blur
        • boxFilter
        • dilate
        • erode
        • filter2D
        • gaussianBlur
        • laplacian
        • medianBlur
        • morphologyEx
        • pyrDown
        • pyrMeanShiftFiltering
        • pyrUp
        • scharr
        • sobel
        • sqrBoxFilter
      • Miscellaneous Image Transformations
        • adaptiveThreshold
        • distanceTransform
        • threshold
      • Color Space Conversions
        • cvtColor
      • ColorMaps in OpenCV
        • applyColorMap

Image processing

  • All processing is through the image string path.
  • Images in flutter through the asset folder configured in the pubspect.yaml file. Default
  • Images in URLs.
  • Images from gallery or camera using image_picker

Syntax

  • Similar to Python for method calls and image processing constants for example
    • Cv2.ctvColor
    • Cv2.COLOR_BGR2GRAY

Installing

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  opencv_4: ^1.0.0
2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get
3. Import it

Now in your Dart code, you can use:

import 'package:opencv_4/opencv_4.dart';

How to use

Pre requirements

  1. Android: requires the minimum version 21 in your project android (folder) -> app (folder) -> build.gradle
defaultConfig {
    ...
    minSdkVersion 21
    ...
}
  1. If you are going to work with the asset path, flutter does not require permissions in Android and iOS.
  2. If you want to work with images from URLs, no configuration is required.
  3. If the image_picker package is to be used to work with images from the camera and gallery, follow your permission settings for Android and iOS.
  4. Nullsafety If you are going to test the example you need to configure pubspect.yaml
environment:
  sdk: ">=2.12.0 <3.0.0"

Classes

Cv2: Class that contains the implementation of OpenCV modules

CVPathFrom: Allows you to configure the path to process the images

  • URL (static constant) configure opencv for web images
  • GALLERY_CAMERA (static constant) configure opencv for images obtained from the image_picker package
  • ASSETS (static constant) configure opencv for flutter images in pubspect.yaml --> assets/test.jpg

Module: Image Filtering

Imagen original

from my behance acount

Some examples

Bilateral Filter

Must be called within a async function


Uint8List _byte = await Cv2.bilateralFilter(
        pathFrom: CVPathFrom.ASSETS,
        pathString: 'assets/Test.JPG',
        diameter: 20,
        sigmaColor: 75,
        sigmaSpace: 75,
        borderType: Cv2.BORDER_DEFAULT,
      );

      setState(() {
        _byte;
      });

Show result in an image widget

Image.memory(
      _byte,
      width: 300,
      height: 300,
      fit: BoxFit.fill,
    )

Note: If you want to process an image from the web you must configure pathFrom: CVPathFrom.URL replace in pathString with a URL, for example. pathString: 'https://mir-s3-cdn-cf.behance.net/project_modules/fs/313f8e114930481.6044f05fcd866.jpeg'

Dilate



Uint8List _byte = await Cv2.dilate(
        pathFrom: CVPathFrom.ASSETS,
        pathString: 'assets/Test.JPG',
        kernelSize: [3, 3],
      );

      setState(() {
        _byte;
      });




Filter2D


Uint8List _byte = await Cv2.filter2D(
        pathFrom: CVPathFrom.URL,
        pathString:
          'https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/634dba114930481.6044f05fcb2dd.jpeg',
        outputDepth: -1,
        kernelSize: [2, 2],
      );

      setState(() {
        _byte;
      });

Median Blur



Uint8List _byte = await Cv2.medianBlur(
        pathFrom: CVPathFrom.URL,
        pathString:
          'https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/16fe9f114930481.6044f05fca574.jpeg',
        kernelSize: 19,
      );

      setState(() {
        _byte;
      });

MorphologyEx



Uint8List _byte = await Cv2.morphologyEx(
        pathFrom: CVPathFrom.URL,
        pathString:
          'https://mir-s3-cdn-cf.behance.net/project_modules/fs/c7da51114930481.6044f05fcc76a.jpeg',
        operation: Cv2.MORPH_TOPHAT,
        kernelSize: [5, 5],
      );

      setState(() {
        _byte;
      });

PyrMeanShiftFiltering




Uint8List _byte = await Cv2.pyrMeanShiftFiltering(
        pathFrom: CVPathFrom.ASSETS,
        pathString: 'assets/Test.JPG',
        spatialWindowRadius: 20,
        colorWindowRadius: 20,
      );

      setState(() {
        _byte;
      });


Scharr



Uint8List _byte = await Cv2.scharr(
        pathFrom: CVPathFrom.ASSETS,
        pathString: 'assets/Test.JPG',
        depth: Cv2.CV_SCHARR,
        dx: 0,
        dy: 1,
      );

      setState(() {
        _byte;
      });


Module: Miscellaneous Image Transformations

Threshold



Uint8List _byte = await Cv2.threshold(
        pathFrom: CVPathFrom.ASSETS,
        pathString: 'assets/Test.JPG',
        thresholdValue: 150,
        maxThresholdValue: 200,
        thresholdType: Cv2.THRESH_BINARY,
      );

      setState(() {
        _byte;
      });


AdaptiveThreshold



Uint8List _byte = await Cv2.adaptiveThreshold(
        pathFrom: CVPathFrom.ASSETS,
        pathString: 'assets/Test.JPG',
        maxValue: 125,
        adaptiveMethod: Cv2.ADAPTIVE_THRESH_MEAN_C,
        thresholdType: Cv2.THRESH_BINARY,
        blockSize: 11,
        constantValue: 12,
      );

      setState(() {
        _byte;
      });

Module: Color Space Conversions

CvtColor



Uint8List _byte = await Cv2.cvtColor(
        pathFrom: CVPathFrom.ASSETS,
        pathString: 'assets/Test.JPG',
        outputType: Cv2.COLOR_BGR2GRAY,
      );

      setState(() {
        _byte;
      });


Module: Color Maps

ApplyColorMap



Uint8List _byte = await Cv2.applyColorMap(
        pathFrom: CVPathFrom.URL,
        pathString:
          'https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/16fe9f114930481.6044f05fca574.jpeg?raw=true',
        colorMap: Cv2.COLORMAP_JET,
      );

      setState(() {
        _byte;
      });


Bugs or Requests

Please file feature requests and bugs at the issue tracker.

  • BTC: bc1qhy5uer94d4xvp2wgtfg5l6s6jk8gwj6d0ufqvh
  • BNB: bnb17z7dqeeyrkhq2l9mx6p3hg6ewvshrpkqqzcpr9
  • ETH: 0xb76D1F1f97eBf5B2096D5449cB3DDD2096CCB4b3

카테고리

의존성

의존성 목록 1 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.