detectAllRectangles method

  1. @override
Future<List<Map<String, dynamic>>> detectAllRectangles(
  1. Uint8List imageData
)
override

检测图片中所有矩形并返回四个顶点坐标

  • Parameter imageData: 图片的字节数据
  • Returns: 包含所有矩形顶点坐标的List

Implementation

@override
Future<List<Map<String, dynamic>>> detectAllRectangles(
  Uint8List imageData,
) async {
  final result = await methodChannel.invokeMethod('detectAllRectangles', {
    'imageData': imageData,
  });
  if (result == null) return [];

  if (result is List) {
    return result.map<Map<String, dynamic>>((item) {
      return _convertToStringDynamicMap(item);
    }).toList();
  }
  return [];
}