【问题标题】:how to convert image from rgb to grayscale in flutter?如何在颤动中将图像从rgb转换为灰度?
【发布时间】:2021-09-17 02:50:04
【问题描述】:

我正在使用 tensorflow lite 模型和颤振,其中模型接收灰度图像作为输入。有没有办法使用颤振将RGB图像转换为灰度图像?

【问题讨论】:

  • 请注意,图像格式之间的转换不是artificial-intelligence 问题(已删除标记)。

标签: flutter tensorflow-lite


【解决方案1】:

ColorFiltered 小部件可以提供帮助。请注意,这也会影响透明像素。

ColorFiltered(
    colorFilter: const ColorFilter.mode(
      Colors.grey,
      BlendMode.saturation,
    ),
  child: Your Image Here),
)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-02-26
    • 2014-12-22
    • 2012-08-25
    • 2016-09-16
    • 2021-07-27
    • 1970-01-01
    相关资源
    最近更新 更多