flython 0.1.2
flython: ^0.1.2 copied to clipboard
Use Flython to combine the power of Python with Dart. It was originally created to be used with Flutter but, it doesn't depend on Flutter and can be used in pure Dart code.
import 'package:flython/flython.dart';
class OpenCV extends Flython {
static const cmdToGray = 1;
Future<dynamic> toGray(
String inputFile,
String outputFile,
) async {
var command = {
"cmd": cmdToGray,
"input": inputFile,
"output": outputFile,
};
return await runCommand(command);
}
}
void main() async {
final opencv = OpenCV();
await opencv.initialize("python", "./example/opencv.py", false);
await opencv.toGray("./image.png", "./image_gray.png");
opencv.finalize();
}