-
Notifications
You must be signed in to change notification settings - Fork 67
Can I use that to make a groups of similar images from source array? #19
Comments
@vadimkklim from what you want to make a group? If you can explain more I think I can help you. |
@kuls14 i am using "[[OSImageHashing sharedInstance] similarImagesWithHashingQuality:" to find similar images in photo library but it work only for copies of images. If images slightly different it will never find them. Maybe you can help how to setup accuracy? I am requesting 100x100 imgage from PHImageManager, convert it to Data by "pngData" and apply "medium quality" from OSImageHashing |
@kuls14 okay, i was trying also to convert image to 8x8 size, move it to grayscale but results became even badder
|
Yes
… On 26 Jul 2019, at 11:14, Kuldip Soliya ***@***.***> wrote:
Are you trying to get photos from PHAssets?
On Fri 26 Jul, 2019, 12:02 AM Igor Bizi, ***@***.***> wrote:
> @kuls14 <https://github.com/kuls14> okay, i was trying also to convert
> image to 8x8 size, move it to grayscale but results became even badder
>
> extension UIImage {
> var noir: UIImage? {
> let context = CIContext(options: nil)
> guard let currentFilter = CIFilter(name: "CIPhotoEffectNoir") else { return nil }
> currentFilter.setValue(CIImage(image: self), forKey: kCIInputImageKey)
> if let output = currentFilter.outputImage,
> let cgImage = context.createCGImage(output, from: output.extent) {
> return UIImage(cgImage: cgImage, scale: scale, orientation: imageOrientation)
> }
> return nil
> }
> }
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#19?email_source=notifications&email_token=AJHDKB7N34RQCRH54ZUHQ43QBHWUXA5CNFSM4IFQXQ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD22MFTY#issuecomment-515162831>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AJHDKB6TZX7OTH4FDHLMDVLQBHWUXANCNFSM4IFQXQ4Q>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sounds great, thank you
… On 26 Jul 2019, at 11:27, Kuldip Soliya ***@***.***> wrote:
I'll send you my code in 45 to 60 minutes so you can see what I have done
and can implement same. I have very satisfactory results.
On Fri 26 Jul, 2019, 8:55 AM Igor Bizi, ***@***.***> wrote:
> Yes
>
> > On 26 Jul 2019, at 11:14, Kuldip Soliya ***@***.***>
> wrote:
> >
> > Are you trying to get photos from PHAssets?
> >
> > On Fri 26 Jul, 2019, 12:02 AM Igor Bizi, ***@***.***>
> wrote:
> >
> > > @kuls14 <https://github.com/kuls14> okay, i was trying also to convert
> > > image to 8x8 size, move it to grayscale but results became even badder
> > >
> > > extension UIImage {
> > > var noir: UIImage? {
> > > let context = CIContext(options: nil)
> > > guard let currentFilter = CIFilter(name: "CIPhotoEffectNoir") else {
> return nil }
> > > currentFilter.setValue(CIImage(image: self), forKey: kCIInputImageKey)
> > > if let output = currentFilter.outputImage,
> > > let cgImage = context.createCGImage(output, from: output.extent) {
> > > return UIImage(cgImage: cgImage, scale: scale, orientation:
> imageOrientation)
> > > }
> > > return nil
> > > }
> > > }
> > >
> > > —
> > > You are receiving this because you were mentioned.
> > > Reply to this email directly, view it on GitHub
> > > <
> #19?email_source=notifications&email_token=AJHDKB7N34RQCRH54ZUHQ43QBHWUXA5CNFSM4IFQXQ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD22MFTY#issuecomment-515162831
> >,
> > > or mute the thread
> > > <
> https://github.com/notifications/unsubscribe-auth/AJHDKB6TZX7OTH4FDHLMDVLQBHWUXANCNFSM4IFQXQ4Q
> >
> > > .
> > >
> > —
> > You are receiving this because you commented.
> > Reply to this email directly, view it on GitHub, or mute the thread.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#19?email_source=notifications&email_token=AJHDKB2YUHPBTGWGR3KA7ZDQBJVCLA5CNFSM4IFQXQ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD23MGVA#issuecomment-515294036>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AJHDKBYS3QXM6SNUMGVS6JDQBJVCLANCNFSM4IFQXQ4Q>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#19?email_source=notifications&email_token=ABOZHCS4FA3GMNHBBT5HPKDQBJVIJA5CNFSM4IFQXQ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD23MISA#issuecomment-515294280>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABOZHCQMFYF44GRPHUYCDADQBJVIJANCNFSM4IFQXQ4Q>.
|
I am using this to get image from PHAssets
and for comparison I use
This will return tuples so I have use below method to get group of similar image in array so I can display it in tableview or collection view.
Please try to use 150*150 as max size for image otherwise it may cause memory issue. |
Thanks for the code, I use kind of the same.
Do you use it in some app?
Comparing to SmartCleaner this library is 100x slower. Looks like they use some kind of machine learning or vision to make comparison super fast the precise ...
… On 26 Jul 2019, at 12:10, Kuldip Soliya ***@***.***> wrote:
I am using this to get image from PHAssets
import Foundation
import Photos
extension PHAsset {
/// To get Thumbnail image from PHAssets
var image : UIImage {
var thumbnail = UIImage()
let imageManager = PHCachingImageManager()
let options = PHImageRequestOptions()
options.version = .current
// options.deliveryMode = .opportunistic
let scale = UIScreen.main.scale
let size = CGSize(width: 50.0 * scale, height: 50.0 * scale)
// let size = CGSize(width: 100.0, height: 100.0)
imageManager.requestImage(for: self, targetSize: size, contentMode: .aspectFill, options: nil) { (image, info) in
thumbnail = image!
}
return thumbnail
}
}
and for comparison I use
let similarImageIdsAsTuples = OSImageHashing.sharedInstance().similarImages(with: OSImageHashingQuality.high, forImages: images)
Please try to use 150*150 as max size for image otherwise it may cause memory issue.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#19?email_source=notifications&email_token=ABOZHCRRHKPCWAYQMYNKIMDQBJ2KXA5CNFSM4IFQXQ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD23OAJY#issuecomment-515301415>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABOZHCQ5WVPOL5SHYVJGF5LQBJ2KXANCNFSM4IFQXQ4Q>.
|
Yes smartClearner is definitely fast and more accurate for duplicate contacts too. |
Do you have any idea what technology they can use?
I am making similar app, but want similar quality
… On 26 Jul 2019, at 13:51, Kuldip Soliya ***@***.***> wrote:
Yes smartClearner is definitely fast and more accurate for duplicate contacts too.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#19?email_source=notifications&email_token=ABOZHCX35SGF5AM7TW3NXRDQBKGHXA5CNFSM4IFQXQ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD23SJNI#issuecomment-515318965>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABOZHCQ36DPGPNWU27BTUBLQBKGHXANCNFSM4IFQXQ4Q>.
|
@bizibizi Hey. did you find a better solution? |
No description provided.
The text was updated successfully, but these errors were encountered: