gpt4 book ai didi

iphone - 比较两个图像是否相同(iOS)

转载 作者:可可西里 更新时间:2023-11-01 04:36:02 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How does one compare one image to another to see if they are similar by a certain percentage, on the iPhone?

我找到了这段代码并试图更好地理解它:

UIImage *img1 = // Some photo;
UIImage *img2 = // Some photo;

NSData *imgdata1 = UIImagePNGRepresentation(img1);

NSData *imgdata2 = UIImagePNGRepresentation(img2);

if ([imgdata1 isEqualToData:imgdata2]) {
NSLog(@"Same Image");
}

这会确认图像 1 与图像 2 完全相同吗?这种方法是最佳实践,还是有更好的方法?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com