ios 图像翻转

Human eyes are very receptive to visual representations. Similarly, computer vision enables systems to understand and process images.

人眼很容易接受视觉表现。 同样,计算机视觉使系统能够理解和处理图像。

Core Image and Vision are the two main pillars of Computer Vision in iOS. During WWDC 2020 Apple pushed the envelope for both of them.

Core Image和Vision是iOS中计算机视觉的两个主要Struts。 在WWDC 2020期间,苹果公司为两者推波助澜。

Core Image in iOS 14 now includes a few new built-in filters for image processing. Specifically, we have a CIColorThreshold filter to convert an image into just black and white by setting threshold value as well as another CIColorThresholdOtsu which determines the appropriate threshold from the image’s histogram.

iOS 14中的Core Image现在包括一些用于图像处理的新内置过滤器。 具体来说,我们有一个CIColorThreshold过滤器,可以通过设置阈值将图像转换为黑白图像,以及另一个CIColorThresholdOtsu ,它可以根据图像的直方图确定适当的阈值。

More importantly, we can now compare two images using the new CIColorAbsoluteDifference filter — our main focus in this article.

更重要的是,我们现在可以使用新的CIColorAbsoluteDifference过滤器比较两个图像,这是本文的重点。

In the following sections, we’ll explore the use cases that can be achieved by analyzing the difference between images.

在以下各节中,我们将探讨通过分析图像之间的差异可以实现的用例。

绝对像差 (Absolute Image Difference)

This image processing task involves computing the absolute difference of each pixel across two images and adding them up.

该图像处理任务涉及计算两个图像上每个像素的绝对差并将其相加。

In doing so, we get a new transformed image that shows the variations across the two images.

这样,我们得到了一个新的变换图像,该图像显示了两个图像之间的变化。

In the new Core Image filter, if the two images are exactly, the same, our output image would be black.

在新的Core Image滤镜中,如果两个图像完全相同,则我们的输出图像将为黑色。

By comparing color differences across images we can:

通过比较图像之间的色差,我们可以:

  • Analyze video frames. For example, we can determine if the frames are consistent or there’s some shadow in any of the frames.分析视频帧。 例如,我们可以确定帧是否一致或任何帧中是否有阴影。
  • Anamoly detection to find outliers that can be missed by the naked eye. This is useful for spotting differences between images such as if a credit card or currency note has missing symbols.进行异常检测以找到肉眼可能遗漏的异常值。 这对于发现图像之间的差异很有用,例如信用卡或纸币的符号是否缺失。

Next up, we’ll explore a few examples of comparing two images.

接下来,我们将探讨一些比较两个图像的示例。

核心图像过滤器:CIColorAbsoluteDifference (Core Image Filter: CIColorAbsoluteDifference)

Let’s create a new SwiftUI application that performs image processing.

让我们创建一个执行图像处理的新SwiftUI应用程序。

Core Image requires setting the input CIImage(which we’ll convert from UIImage) onto the CIFilter. Subsequently, we can set thresholds if any, and retrieve the outputImage instance from the filter. That outputImage instance is basically a copy of the inputImage which is then passed into CIContext’s function createCGImage to perform the transformation.

Core Image需要将输入CIImage (我们将从UIImage转换为输入)设置到CIFilter 。 随后,我们可以设置阈值(如果有),并从过滤器中检索outputImage实例。 这outputImage例如基本的副本inputImage ,然后传递到CIContext的功能createCGImage执行转换。

CIContext is where all the image processing takes place.

CIContext是所有图像处理发生的地方。

发现SwiftUI中图像之间的差异 (Spot The Difference Between Images in SwiftUI)

The following example shows the classic “spot the difference in images” puzzle. But with computer vision.

以下示例显示了经典的“发现图像差异”难题。 但是具有计算机视觉。

CIFilter.colorAbsoluteDifference() creates the CIFilter and we passed the two images on it.

CIFilter.colorAbsoluteDifference()创建CIFilter,我们在其上传递了两个图像。

We can also transform the two images into grayscale before comparing them.

在比较它们之前,我们还可以将两个图像转换为灰度图像。

水印检测/提取 (Watermark Detection/Extraction)

It’s common to come across a task where you need to ensure that a watermark or logo overlay is set over the image. Again, using the CIColorAbsoluteDifference we can determine that as shown below:

通常需要执行一项任务,以确保在图像上设置水印或徽标覆盖。 同样,使用CIColorAbsoluteDifference我们可以确定如下所示:

信用卡异常检测 (Credit Card Anomaly Detection)

Scanning credit cards in our mobile applications and extracting the digits is a fairly common computer vision task.

在我们的移动应用程序中扫描信用卡并提取数字是相当常见的计算机视觉任务。

We can further leverage the power of the above Core Image Filter to determine if the credit card’s image hasn’t tampered. Moreover, we can keep a reference credit card image that’s blank and compare it with a scanned image to only extract the digits.

我们可以进一步利用上述“核心图像过滤器”的功能来确定信用卡图像是否未被篡改。 此外,我们可以保留空白的参考信用卡图像,并将其与扫描的图像进行比较,以仅提取数字。

The following example shows how to do both of these things:

下面的示例演示如何执行这两项操作:

Screengrabs by author
作者的屏幕截图

In the left-hand side image, to fully detect if outlier/anomaly is present using computer vision, we can extend the above example by comparing the output image with an opaque black image.

在左侧图像中,为了使用计算机视觉完全检测出异常值/异常,我们可以通过将输出图像与不透明的黑色图像进行比较来扩展上述示例。

The full source code of the above SwiftUI + CoreImage application is available in this Github Repository.

上面的SwiftUI + CoreImage应用程序的完整源代码可在此Github存储库中找到 。

结论 (Conclusion)

Apple’s image processing framework CoreImage is handy for image transformations and augmentations when preparing datasets.

Apple的图像处理框架CoreImage在准备数据集时可方便地进行图像转换和扩充。

We discussed a new filter CIColorAbsoluteDifference available in iOS 14 that compares two images by the color of each pixel(without the need of OpenCV).

我们讨论了iOS 14中提供的新滤镜CIColorAbsoluteDifference该滤镜通过每个像素的颜色比较两个图像(无需OpenCV)。

This is useful in spotting blemishes across images, determining and removing duplicate images from a video or dataset.

这对于发现图像上的瑕疵,确定视频或数据集中的重复图像并从中删除重复图像很有用。

That’s it for this one. Thanks for reading.

这就是它了。 谢谢阅读。

翻译自: https://towardsdatascience.com/image-difference-using-computer-vision-in-ios-14-7753b8d61e82

ios 图像翻转


http://www.taodudu.cc/news/show-863554.html

相关文章:

  • 熔池 沉积_用于3D打印的AI(第3部分):异常熔池分类的纠缠变分自动编码器
  • 机器学习中激活函数和模型_探索机器学习中的激活和丢失功能
  • macos上的硬盘检测工具_如何在MacOS上使用双镜头面部检测器(DSFD)实现90%以上的精度
  • 词嵌入应用_神经词嵌入的法律应用
  • 谷歌 colab_使用Google Colab在Python中将图像和遮罩拆分为多个部分
  • 美国人口普查年收入比赛_训练网络对收入进行分类:成人普查收入数据集
  • NLP分类
  • 解构里面再次解构_解构后的咖啡:焙炒,研磨和分层,以获得更浓的意式浓缩咖啡
  • 随机森林算法的随机性_理解随机森林算法的图形指南
  • 南加州大学机器视觉实验室_机器学习带动南加州爱迪生的变革
  • 机器学习特征构建_使用Streamlit构建您的基础机器学习Web应用
  • 数学建模算法:支持向量机_从零开始的算法:支持向量机
  • 普元部署包部署找不到构建_让我们在5分钟内构建和部署AutoML解决方案
  • 基于决策树的多分类_R中基于决策树的糖尿病分类—一个零博客
  • csdn无人驾驶汽车_无人驾驶汽车100年历史
  • 无监督学习 k-means_无监督学习-第2部分
  • regex 正则表达式_使用正则表达式(Regex)删除HTML标签
  • 精度,精确率,召回率_了解并记住精度和召回率
  • 如何在Python中建立回归模型
  • 循环神经网络 递归神经网络_了解递归神经网络中的注意力
  • 超参数优化 贝叶斯优化框架_mlmachine-使用贝叶斯优化进行超参数调整
  • 使用线性回归的预测建模
  • 机器学习 处理不平衡数据_在机器学习中处理不平衡数据
  • 目标检测迁移学习_使用迁移学习检测疟疾
  • 深度学习cnn人脸检测_用于对象检测的深度学习方法:解释了R-CNN
  • 人口预测和阻尼-增长模型_使用分类模型预测利率-第2部分
  • jupyter 共享_可共享的Jupyter笔记本!
  • 图像分割过分割和欠分割_使用图割的图像分割
  • 跳板机连接数据库_跳板数据科学职业生涯回顾
  • 模糊图像处理 去除模糊_图像模糊如何工作

ios 图像翻转_在iOS 14中使用计算机视觉的图像差异相关推荐

  1. ios 表情符号 键盘_使用iOS键盘键入时,表情符号在NSAttributedString中不显示,在Android上键入时表示...

    我正在制作一个混合应用程序,当我从 Android端发送表情符号时,它在iOS端显示正常,但iOS方面不能(似乎)显示来自iOS自己键盘的表情符号! 我在显示表情符号的标签使用了属性文本,文本来自HT ...

  2. react 图像识别_无法在React中基于URL查找图像

    react 图像识别 If you're new to React and are having trouble accessing images stored locally, you're not ...

  3. python 颜色_如何使用python中matplotlib库分析图像颜色

    用代码分析图像可能很困难.你如何使代码"理解"图像的上下文? 通常,使用AI分析图像的第一步 是找到主要颜色.在如何使用python中matplotlib库分析图像颜色中,我们将使 ...

  4. coreldraw矫正两张图_如何在CorelDRAW中对倾斜的图像进行矫正

    旋转和预览 使用矫正图像对话框,可以通过移动滑块或输入旋转角度来旋转图像.可以指定一个 -15 度到 15 度的自定义旋转角度. 可以使用预览窗口动态预览所做调整.如果要在矫正前更改图像的方向,则可以 ...

  5. css背景图像属性_如何将CSS3转换应用于背景图像

    css背景图像属性 CSS transformations are great, but they don't (yet?) apply to background images. This arti ...

  6. ios 图像坐标系_[译] iOS 开源图形库 Core Plot 使用教程

    注意 :本篇教程已被 Attila Hegedüs 更新,可适用于 iOS 9 和 Swift 2.2.原始教程出自教程组成员 Steve Baranski. 如果你曾经想在自己的 app 中引入图表 ...

  7. android仿ios弹框_在“提示”框中:iOS外观(在Android上运行),Google Maps作为Time Machine,下载Wii游戏保存...

    android仿ios弹框 Once a week we round up some great reader tips and share them with everyone. Read on t ...

  8. ios设计组件_在ios上实现设计系统组件

    ios设计组件 As a native iOS developer, I've been jealous of web developers who can use design systems in ...

  9. python读取图像数据流_浅谈TensorFlow中读取图像数据的三种方式

    本文面对三种常常遇到的情况,总结三种读取数据的方式,分别用于处理单张图片.大量图片,和TFRecorder读取方式.并且还补充了功能相近的tf函数. 1.处理单张图片 我们训练完模型之后,常常要用图片 ...

最新文章

  1. 现代软件工程讲义 5 团队合作的阶段
  2. nginx 安装与配置
  3. npm安装依赖包报错
  4. maven中出现 ‘dependencies.dependency.version‘ for xxxx:jar is missing
  5. spring的@ControllerAdvice注解
  6. CLRS2e读书笔记—Chapter10
  7. 读取 wav 格式声音文件
  8. tensorflow prelu的实现细节
  9. Python爬虫-博客and贴吧
  10. 如何用两个栈实现一个队列?
  11. EasyCamera--更简单更灵活的相机应用编写
  12. UBUNTU VS C++ 调试报错Unable to open ‘libc-start.c‘: File not found.
  13. 在Windows中查看文件的MD5值
  14. 将单元格中的内容拆分成多列/行
  15. 2021-03-13 大数据课程笔记 day52
  16. 花菁染料CY3标记聚乙二醇修饰的活性基团MAL/SH/NH2-星戈瑞
  17. 上海尤劲恩AI视觉检测为工业制造赋能,帮助企业实现智造升级
  18. python3爬虫系列21之selenium自动化登录163邮箱并读取未读邮件内容
  19. 即时消息服务器eChat 与 通信解决方案
  20. 最适合入门的100个深度学习实战项目

热门文章

  1. JeeSite 4.0 内置功能模块规划
  2. virtualbox Linux与Windows共享文件
  3. 开发中常见的十种对缓存的错误使用
  4. TiDB 分布式数据库(一)
  5. Leetcode#206Reverse Linked List
  6. IOS 中视图控制器的生命周期
  7. 超棒的阿里巴巴矢量图标库——支持IE6
  8. Google Drive客户端
  9. 女人 这20种男人你永远不必等
  10. 架构宣言: MDA 实战