no image
Flutter FFI Plugin Project
New Project FFI PluginAndroid Studio New Flutter Project에 FFI Plugin type이 있다. 살펴보자 https://github.com/cornpip/ffi_plugin_test.git프로젝트 생성 후 OpenCV SDK를 추가하고, 몇 가지 예제 코드를 추가했다.※ OpenCV 설정은 안드로이드만 적용했다.ffigen.yamlFFI Plugin으로 프로젝트를 만들어보면 FFI 기본 구조와 `ffigen.yaml` 이 있다.# ffigem.yaml# Run with `dart run ffigen --config ffigen.yaml`.name: FfiPluginLookBindingsdescription: | Bindings for `src/ffi_plug..
2025.11.26
no image
Flutter ML Kit FaceMesh 실시간 얼굴 인식 예제
실행 가능한 예제는 최고의 문서다. 실행 가능한 예제는 최고의 문서라고 생각하며, 이번 포스팅도 예제 레포지토리를 제공한다. ML Kit 이란?https://developers.google.com/ml-kit/guidesML Kit is a mobile SDK that brings Google's on-device machine learning expertise to Android and iOS appsML Kit은 Google이 제공하는 사전 학습된 AI 모델을, 앱 개발 환경(on-device)에서 바로 활용할 수 있도록 추상화한 SDK다. Face detection의 경우 두 가지 모델이 있다. 자세한 차이에 대해서는 문서를 한 번 읽어보길 권장한다.참고) face mesh detection의 경우..
2025.10.24
no image
Flutter Camera ImageStream Issue: The Previous frames remained
플러터 Camera 플러그인에서 ImageStream 재시작시, 이전 프레임이 남아있고 그 프레임부터 시작되는 이슈 Camera Pluginhttps://pub.dev/packages/camera camera | Flutter packageA Flutter plugin for controlling the camera. Supports previewing the camera feed, capturing images and video, and streaming image buffers to Dart.pub.dev환경flutter: 3.32.7camera: ^0.10.0+1android: 10 ~ 15 문제controller.startImageStream -> stopImageStream -> startIma..
2025.08.12
no image
Flutter Camera Preview Blank - Android10
환경flutter: 3.29.0camera: ^0.10.0+1android 10문제https://pub.dev/packages/camera camera | Flutter packageA Flutter plugin for controlling the camera. Supports previewing the camera feed, capturing images and video, and streaming image buffers to Dart.pub.dev위 조합에서 camera plugin의 preview가 정상적으로 보이지 않는 현상이 있다.android 11 이상에선 문제가 없었다. 아마 10 이하에서 어떤 문제가 있는 듯하다.해결https://github.com/flutter/flutter/issue..
2025.08.04
no image
Flutter C++ OpenCV로 이미지 처리하기 + 16KB Memory Page Size
Dart나 Java에서 복잡한 이미지 처리 알고리즘을 직접 구현하면 코드량이 많아지고 연산 부담이 커진다. 예를 들어, filter2D 알고리즘을 구현하려면 컨볼루션 연산을 수행해야 하는데, 이를 위해 각 픽셀에 직접 접근하여 연산하는 코드를 작성해야 한다. 그러나 C/C++과 달리, 높은 수준의 언어들은 메모리에 직접 접근할 수 없기 때문에 성능이 저하될 수 있다. 이러한 한계를 고려하여, Flutter에서 C++ OpenCV를 사용해 보자. Flutter FFI(Foreign Function Interface)를 활용하면 Dart 코드에서 네이티브 코드를 직접 호출할 수 있다.예제에서는 cv::cvtColor를 사용해 컬러 이미지를 흑백으로 변환하고, 이를 Flutter 화면에 표시해 볼 것이다.이 ..
2025.04.08