react-native - 有没有办法可以使用 Expo React Native 从图像中检测文本?
问题描述
我正在使用Expo
,React Native
我希望能够从图像中检测文本。有没有我可以使用的软件包来实现这一目标?
我正在使用Expo camera module
拍摄图片并将 URI 提供给我尝试使用 react-native-text-detector 的文本检测器,但我收到未定义函数 detectFromUri 的错误。我也尝试过使用 tesserect.js,但导入失败并显示“无法解析变量位置”。
await this.camera.takePictureAsync(options).then(photo => {
photo.exif.Orientation = 1;
//console.log(photo.uri);
const visionResp = await RNTextDetector.detectFromUri(photo.uri);
if (!(visionResp && visionResp.length > 0)) {
throw "UNMATCHED";
}
console.log(visionResp);
});
我期待 visionResp 记录从检测返回的结果,但我得到了undefined is not an object (evaluating '_reactNativeTextDetector.default.detectFromUri')
解决方案
推荐阅读
- google-chrome-extension - chrome.storage.sync 限制与 Google Keep
- ios - 如何在 iOS 中转换时区格式?
- sql - 在使用 SQL Server 进行增量加载时在单独的表中捕获更新和删除记录
- tabulator - 函数 table.setColumnLayout(columnSettings); 不适合我
- powershell - 如何读取具有两个数据集(即两个不同的标题和列)的 CSV 文件
- flutter - Flutter SizedBox 与 LimitedBox
- flutter - 如何更改 Flutter 中子树的文本颜色?
- javascript - 我究竟做错了什么?类型错误:这是未定义的
- python - Python 3 的帮助功能中的西里尔字母在 Powershell Windows 10 中不起作用
- ios - 使用 willDisplay 单元格方法向上滚动 tableView 时如何从 API 获取数据并更新单元格和部分?