Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better mat fromlist #137

Closed
wants to merge 110 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
0546cf5
add GScalar
rainyl May 8, 2024
bb9489c
Merge branch 'main' into gapi
rainyl May 10, 2024
45af00d
Merge branch 'main' into gapi
rainyl Jun 14, 2024
b4059e5
add gapi headers
rainyl Jun 14, 2024
2855856
try async in GComputation.apply
rainyl Jun 15, 2024
c7bf2da
add CVD_CALLBACK_DEF
rainyl Jun 16, 2024
c5b7ee5
regenerate
rainyl Jun 18, 2024
85a2290
Merge branch 'main' into async
rainyl Jun 22, 2024
03ee7e6
add cvRunAsync, cvtColorAsync, gaussianBlurAsync
rainyl Jun 22, 2024
f7a6982
refactor Size, Size2f, TermCriteria
rainyl Jun 24, 2024
aaf29a3
finish calib3d async
rainyl Jun 24, 2024
2f15396
add imgcodecs
rainyl Jun 24, 2024
30d9055
add svd async
rainyl Jun 24, 2024
474e5e4
Merge pull request #114 from rainyl/async-svd
rainyl Jun 24, 2024
511320f
separate async to new files
rainyl Jun 25, 2024
f38b063
initial async object detect work
abdelaziz-mahdy Jun 25, 2024
995a0c8
add async imgproc
rainyl Jun 25, 2024
5f6441b
finish imgproc_async c++
rainyl Jun 25, 2024
4e94941
fix vecPointToVecPoint2f
rainyl Jun 25, 2024
e0ceafb
add version async
rainyl Jun 25, 2024
93c0c0d
added missing headers
abdelaziz-mahdy Jun 25, 2024
c51c0b4
fixed some dart functions
abdelaziz-mahdy Jun 25, 2024
26ea4d6
an example
rainyl Jun 26, 2024
b966c6e
finish dart besides CLAHE and Subdiv2d
rainyl Jun 26, 2024
14cfc71
fixes dart errors
abdelaziz-mahdy Jun 26, 2024
3fd0262
added runasync4
abdelaziz-mahdy Jun 26, 2024
ca74d8c
fix memory leaks
abdelaziz-mahdy Jun 26, 2024
8a46455
dnn impl
abdelaziz-mahdy Jun 26, 2024
b77c54e
add precommit script
rainyl Jun 27, 2024
380e20f
fixing callbacks and free cname
abdelaziz-mahdy Jun 27, 2024
874a71d
Merge branch 'async-objdetect' of https://github.com/abdelaziz-mahdy/…
abdelaziz-mahdy Jun 27, 2024
978a499
fix callbacks on setters
abdelaziz-mahdy Jun 27, 2024
03b4a8a
formatting
abdelaziz-mahdy Jun 27, 2024
8558120
finish clahe and subdiv2d
rainyl Jun 27, 2024
a392358
async constructors
abdelaziz-mahdy Jun 27, 2024
57d925a
async dnn and constructors
abdelaziz-mahdy Jun 27, 2024
024e00a
finish imgproc async
rainyl Jun 27, 2024
0b5cae1
clean gapi
rainyl Jun 28, 2024
a121265
add formatter
rainyl Jun 28, 2024
6d8cba5
remove lib/utils
rainyl Jun 28, 2024
5f18ffc
finish objdetect test
rainyl Jun 28, 2024
aae3d1e
add formatter
rainyl Jun 28, 2024
323539c
fix re-definition
rainyl Jun 28, 2024
0d0e444
dnn async test
abdelaziz-mahdy Jun 28, 2024
168466d
dart format ✅
abdelaziz-mahdy Jun 28, 2024
0f87fbb
using sync version and added todos
abdelaziz-mahdy Jun 28, 2024
d969a3b
Merge branch 'async-objdetect' of https://github.com/abdelaziz-mahdy/…
abdelaziz-mahdy Jun 28, 2024
45622bd
fix String conversion
rainyl Jun 28, 2024
a757c28
Merge pull request #115 from abdelaziz-mahdy/async-objdetect
rainyl Jun 28, 2024
43290f1
Merge branch 'async' into async-imgproc
rainyl Jun 28, 2024
0594bc1
Merge pull request #117 from rainyl/async-imgproc
rainyl Jun 28, 2024
7f21313
fix test
rainyl Jun 28, 2024
8f53df4
fix test on linux
rainyl Jun 28, 2024
2adff92
fix ci
rainyl Jun 28, 2024
6bbf8c7
c wrappers, and dart
abdelaziz-mahdy Jun 28, 2024
90ce41a
general cleaning
abdelaziz-mahdy Jun 28, 2024
f099477
dart format ✅
abdelaziz-mahdy Jun 28, 2024
e5a41a2
tests and improve params
abdelaziz-mahdy Jun 28, 2024
bdf675d
Merge branch 'features2d_async' of https://github.com/abdelaziz-mahdy…
abdelaziz-mahdy Jun 28, 2024
c22b713
fix merge conflicts
abdelaziz-mahdy Jun 28, 2024
7d9cebe
dart format ✅
abdelaziz-mahdy Jun 28, 2024
8d4b0ab
c wrapper
abdelaziz-mahdy Jun 28, 2024
0ef9ff9
updating name
abdelaziz-mahdy Jun 28, 2024
3ae5ddc
updating name
abdelaziz-mahdy Jun 28, 2024
e7d33b2
Merge branch 'features2d_async' of https://github.com/abdelaziz-mahdy…
abdelaziz-mahdy Jun 28, 2024
01d2c39
photo_async dart
abdelaziz-mahdy Jun 28, 2024
aec9bd8
dart format ✅
abdelaziz-mahdy Jun 28, 2024
5c61cc3
fix redefinition in cpp
rainyl Jun 28, 2024
73a861b
add doc
rainyl Jun 28, 2024
3060e08
Merge pull request #126 from abdelaziz-mahdy/features2d_async
rainyl Jun 28, 2024
0664ce4
Revert "Features2d async"
rainyl Jun 29, 2024
a8b3732
Merge pull request #129 from rainyl/revert-126-features2d_async
rainyl Jun 29, 2024
99e395b
fix desc=Mat.empty()
rainyl Jun 29, 2024
dd0465f
add video, videoio
rainyl Jun 29, 2024
2faf766
migrate to mat inside cpp
abdelaziz-mahdy Jun 29, 2024
4c21932
fix cpp mat
abdelaziz-mahdy Jun 29, 2024
b41921c
fixing params
abdelaziz-mahdy Jun 29, 2024
4c7d9ca
fix casting and returns
abdelaziz-mahdy Jun 29, 2024
af3f63e
Merge branch 'Async-Photo-&-Stitching' of https://github.com/abdelazi…
abdelaziz-mahdy Jun 29, 2024
0dfa08d
dart fixes
abdelaziz-mahdy Jun 29, 2024
a84fc29
dart format ✅
abdelaziz-mahdy Jun 29, 2024
046a17d
added tests
abdelaziz-mahdy Jun 29, 2024
d08ce0e
Merge branch 'Async-Photo-&-Stitching' of https://github.com/abdelazi…
abdelaziz-mahdy Jun 29, 2024
3af3dea
dart format ✅
abdelaziz-mahdy Jun 29, 2024
75c6b72
dart fixes
abdelaziz-mahdy Jun 29, 2024
9dcd14a
Merge branch 'Async-Photo-&-Stitching' of https://github.com/abdelazi…
abdelaziz-mahdy Jun 29, 2024
54e9583
dart format ✅
abdelaziz-mahdy Jun 29, 2024
bc49f7d
finish video, videoio
rainyl Jun 29, 2024
4cbf0f1
Merge pull request #132 from abdelaziz-mahdy/features2d_async
rainyl Jun 29, 2024
1b61a7e
fix
rainyl Jun 29, 2024
35d5fad
Merge branch 'async' into Async-Photo-&-Stitching
rainyl Jun 29, 2024
feeb89a
Merge pull request #127 from abdelaziz-mahdy/Async-Photo-&-Stitching
rainyl Jun 29, 2024
e7285e5
Merge branch 'async' into async-video
rainyl Jun 29, 2024
0ff6839
fix
rainyl Jun 29, 2024
da5da09
Merge branch 'async' into async-video
rainyl Jun 29, 2024
7b93688
fix
rainyl Jun 29, 2024
08a50a3
Merge pull request #131 from rainyl:async-video
rainyl Jun 29, 2024
cd195b3
generate opecv.g.dart
rainyl Jun 29, 2024
b077b4a
small fix
rainyl Jun 29, 2024
6442830
add async core
rainyl Jun 29, 2024
dcea8c3
add rng async
rainyl Jun 30, 2024
d7e3177
more tests
rainyl Jun 30, 2024
d954bd3
Merge pull request #133 from rainyl/async-core
rainyl Jun 30, 2024
a7b6eca
dispose xdata of Mat
rainyl Jun 30, 2024
4569cda
Rng.uniform,gaussian,next returns a Stream now
rainyl Jun 30, 2024
1ef4195
Merge pull request #135 from rainyl/rng-stream
rainyl Jun 30, 2024
c576028
fix test
rainyl Jun 30, 2024
feb2427
dart format ✅
rainyl Jun 30, 2024
7d582f2
fix test
rainyl Jun 30, 2024
33c5f6c
delete xdata of Mat
rainyl Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build_test_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

build-ubuntu:
name: build-ubuntu-android-armv7
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: setup
Expand All @@ -92,7 +92,7 @@ jobs:
libswscale-dev libgflags-dev \
libjpeg-dev libpng-dev libtiff-dev python3-pip

python3 -m pip install conan
python3 -m pip install conan --break-system-packages
conan profile detect -f
- uses: actions/checkout@v4
with:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/formatter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
pull_request:

name: Format Code

jobs:
build:
name: format code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Flutter
uses: subosito/flutter-action@v1
- name: Format code
run: |
dart format --line-length 110 \
$(find lib test -name '*.dart' -not -name '*.g.dart' -and -not -name '*.freezed.dart')
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "dart format ✅"
branch: ${{ github.head_ref }}
2 changes: 2 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def build_requirements(self):
self.tool_requires("cmake/3.28.1")
if self.settings.os != "Windows":
self.tool_requires("ninja/1.11.1")
# if self.settings.os == "Linux":
# self.tool_requires("ffmpeg/6.1")
if self.settings.os == "Android":
ndk_path = os.environ.get("ANDROID_NDK_HOME", None) or os.environ.get(
"ANDROID_NDK_ROOT", None
Expand Down
22 changes: 16 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,18 @@ class _MyAppState extends State<MyApp> {
gray = cv.cvtColor(im, cv.COLOR_BGR2GRAY);
blur = cv.gaussianBlur(im, (7, 7), 2, sigmaY: 2);
}
return (
cv.imencode(cv.ImageFormat.png.ext, gray),
cv.imencode(cv.ImageFormat.png.ext, blur)
);
return (cv.imencode(".png", gray), cv.imencode(".png", blur));
});

Future<(cv.Mat, cv.Mat)> heavyTaskAsync(cv.Mat im) async {
late cv.Mat gray, blur;
for (var i = 0; i < 1000; i++) {
gray = await cv.cvtColorAsync(im, cv.COLOR_BGR2GRAY);
blur = await cv.gaussianBlurAsync(im, (7, 7), 2, sigmaY: 2);
}
return (gray, blur);
}

@override
Widget build(BuildContext context) {
return MaterialApp(
Expand Down Expand Up @@ -80,9 +86,13 @@ class _MyAppState extends State<MyApp> {
final data = await DefaultAssetBundle.of(context).load("images/lenna.png");
final bytes = data.buffer.asUint8List();
// heavy computation
final (gray, blur) = await heavyTask(bytes);
// final (gray, blur) = await heavyTask(bytes);
// setState(() {
// images = [bytes, gray, blur];
// });
final (gray, blur) = await heavyTaskAsync(cv.imdecode(bytes, cv.IMREAD_COLOR));
setState(() {
images = [bytes, gray, blur];
images = [bytes, cv.imencode(".png", gray), cv.imencode(".png", blur)];
});
},
child: const Text("Process"),
Expand Down
1 change: 1 addition & 0 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

28 changes: 28 additions & 0 deletions ffigen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,74 @@ sort: true
headers:
entry-points:
- src/calib3d/calib3d.h
- src/calib3d/calib3d_async.h
- src/core/core.h
- src/core/core_async.h
- src/core/exception.h
- src/core/svd.h
- src/core/svd_async.h
- src/core/types.h
- src/core/vec.h
- src/core/version.h
- src/dnn/asyncarray.h
- src/dnn/dnn.h
- src/dnn/dnn_async.h
- src/extra/aruco.h
- src/extra/img_hash.h
- src/extra/wechat_qrcode.h
- src/features2d/features2d.h
- src/features2d/features2d_async.h
- src/gapi/gapi.h
- src/highgui/highgui.h
- src/imgcodecs/imgcodecs.h
- src/imgcodecs/imgcodecs_async.h
- src/imgproc/imgproc.h
- src/imgproc/imgproc_async.h
- src/objdetect/objdetect.h
- src/objdetect/objdetect_async.h
- src/photo/photo.h
- src/photo/photo_async.h
- src/stitching/stitching.h
- src/stitching/stitching_async.h
- src/video/video.h
- src/video/video_async.h
- src/video/videoio.h
- src/video/videoio_async.h
include-directives:
- src/calib3d/calib3d.h
- src/calib3d/calib3d_async.h
- src/core/core.h
- src/core/core_async.h
- src/core/exception.h
- src/core/svd.h
- src/core/svd_async.h
- src/core/vec.h
- src/core/version.h
- src/dnn/asyncarray.h
- src/dnn/dnn.h
- src/dnn/dnn_async.h
- src/extra/aruco.h
- src/extra/img_hash.h
- src/extra/wechat_qrcode.h
- src/features2d/features2d.h
- src/features2d/features2d_async.h
- src/gapi/gapi.h
- src/highgui/highgui.h
- src/imgcodecs/imgcodecs.h
- src/imgcodecs/imgcodecs_async.h
- src/imgproc/imgproc.h
- src/imgproc/imgproc_async.h
- src/objdetect/objdetect.h
- src/objdetect/objdetect_async.h
- src/photo/photo.h
- src/photo/photo_async.h
- src/stitching/stitching.h
- src/stitching/stitching_async.h
- src/video/video.h
- src/video/video_async.h
- src/video/videoio.h
- src/video/videoio_async.h

functions:
symbol-address:
include:
Expand Down
57 changes: 56 additions & 1 deletion lib/opencv_dart.dart
Original file line number Diff line number Diff line change
@@ -1 +1,56 @@
export 'src/opencv.dart';
library cv;

export 'src/calib3d/calib3d.dart';
export 'src/calib3d/calib3d_async.dart';
export 'src/calib3d/fisheye.dart';
export 'src/constants.g.dart';
export 'src/contrib/aruco.dart';
export 'src/contrib/aruco_dict.dart';
export 'src/contrib/img_hash.dart';
export 'src/contrib/wechat_qrcode.dart';
export 'src/core/array.dart';
export 'src/core/asyncarray.dart';
export 'src/core/base.dart';
export 'src/core/contours.dart';
export 'src/core/core.dart';
export 'src/core/core_async.dart';
export 'src/core/cv_vec.dart';
export 'src/core/dmatch.dart';
export 'src/core/error_code.dart';
export 'src/core/exception.dart';
export 'src/core/keypoint.dart';
export 'src/core/mat.dart';
export 'src/core/mat_async.dart';
export 'src/core/mat_type.dart';
export 'src/core/moments.dart';
export 'src/core/point.dart';
export 'src/core/rect.dart';
export 'src/core/rng.dart';
export 'src/core/rng_async.dart';
export 'src/core/scalar.dart';
export 'src/core/size.dart';
export 'src/core/vec.dart';
export 'src/dnn/dnn.dart';
export 'src/dnn/dnn_async.dart';
export 'src/features2d/features2d.dart';
export 'src/features2d/features2d_async.dart';
export 'src/highgui/highgui.dart';
export 'src/imgcodecs/imgcodecs.dart';
export 'src/imgcodecs/imgcodecs_async.dart';
export 'src/imgproc/clahe.dart';
export 'src/imgproc/clahe_async.dart';
export 'src/imgproc/imgproc.dart';
export 'src/imgproc/imgproc_async.dart';
export 'src/imgproc/subdiv2d.dart';
export 'src/imgproc/subdiv2d_async.dart';
export 'src/objdetect/objdetect.dart';
export 'src/objdetect/objdetect_async.dart';
export 'src/photo/photo.dart';
export 'src/photo/photo_async.dart';
export 'src/stitching/stitching.dart';
export 'src/stitching/stitching_async.dart';
export 'src/svd/svd.dart';
export 'src/video/video.dart';
export 'src/video/video_async.dart';
export 'src/video/videoio.dart';
export 'src/video/videoio_async.dart';
6 changes: 6 additions & 0 deletions lib/opencv_gapi.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
library cv.gapi;

export 'src/gapi/gapi.dart';
export 'src/gapi/gcomputation.dart';
export 'src/gapi/gmat.dart';
export 'src/gapi/gscalar.dart';
Loading
Loading