日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2023/12/15 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ios 图像翻转_在iOS 14中使用计算机视觉的图像差异 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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 圖像翻轉

總結

以上是生活随笔為你收集整理的ios 图像翻转_在iOS 14中使用计算机视觉的图像差异的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 久久亚洲一区二区三区四区 | 老太脱裤让老头玩ⅹxxxx | 成人h动漫在线 | 国产精品综合久久久久久 | 欧美一区二区三区婷婷 | 涩涩屋视频 | 亚洲在线观看一区二区 | 中日韩精品视频 | 草视频在线 | 亚洲一区二区观看播放 | 永久免费看片 | 国产96在线 | 亚洲 | 国产香蕉一区二区三区 | 人妻一区在线 | 亚洲欧美成人综合 | 台湾男男gay做爽爽的视频 | 农村老熟妇乱子伦视频 | 99精品国产99久久久久久97 | 国产又粗又黄又爽的视频 | 伊人久久大香线蕉av色婷婷色 | 在线天堂在线 | 在线只有精品 | 99国产精品欲| 99久久99久久免费精品蜜臀 | 久久久成人精品一区二区三区 | 日韩少妇裸体做爰视频 | 91一区二区在线观看 | 巨大黑人极品videos精品 | 亚洲人人爱 | 在线免费一区 | 日韩视频 中文字幕 | 亚洲精品日日夜夜 | 激情影院内射美女 | 爱爱综合 | 一区二区三区不卡视频在线观看 | 领导揉我胸亲奶揉下面 | 手机在线播放av | 69免费| 福利一区二区 | 麻豆网站入口 | 午夜免费福利网站 | www.欧美一区二区三区 | 蝌蚪久久 | 国产18一19sex性护士 | 麻豆影视在线观看 | 欧美成在线观看 | 国产毛片毛片毛片毛片毛片 | 欧美日韩在线一区二区 | 国产无玛 | 欧美精品区| 特大黑人巨交吊性xxxx视频 | 好吊妞一区二区三区 | 国产乱码精品一区二三赶尸艳谈 | 老司机深夜免费福利 | 成人做爰69片免费看 | 国产 福利 在线 | 免费观看av| 日本美女a级片 | 在线免费观看污片 | 国产又黄又猛又爽 | 国产精品区在线观看 | 在线观看69 | 免费看美女隐私网站 | 欧美日韩高清丝袜 | 日韩精品tv| 午夜电影一区二区三区 | 日本在线免费播放 | 国产精品免费一区 | 自拍毛片| 99国内揄拍国内精品人妻免费 | 成人夜晚看av | 欧美日韩中文视频 | 伊人国产在线视频 | 国产免费观看一区 | 欧美成人黄 | 在线观看国产黄色 | 国产精品一区二区无码免费看片 | 青草久久网 | 黄色精品一区二区 | 国产综合区 | 日本免费在线观看 | 在线免费观看你懂的 | 成人动漫亚洲 | 九色视频偷拍少妇的秘密 | 日韩av影片| 人妻在卧室被老板疯狂进入 | 色婷婷色丁香 | 成人国产免费视频 | 国产无套免费网站69 | 亚洲天堂手机版 | 中日韩在线观看视频 | 国产91大片 | 色激情网 | 99久久精品国产一区二区成人 | 成人在线观看免费视频 | 不卡的av网站 | 亚洲国产不卡 | 熟妇人妻久久中文字幕 | 免费色片网站 |