Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColorKit, when using dominantColors(algorithm: .kMeansClustering) memory error #19

Open
Alexandre-BARBIER opened this issue Feb 24, 2022 · 3 comments

Comments

@Alexandre-BARBIER
Copy link

I'm using this function on each image of a video feed, and after a few seconds/tens of second, my program stops with this error, EXC_BAD_ACCESS (code=1, address=0xd833deece4d0). I assume it comes from this function and precisely kMeansClustering, because I don't encounter this issue using .iterative algorithm

@Boris-Em
Copy link
Owner

I haven't been able to reproduce this issue. Are you sure that you're releasing the images after processing them?

@vbovasia
Copy link

Decoupled private func kMeansClustering(image: NSImage, colorsCount: Int = 8) throws -> [NSColor] to be used separately within the macOS project without the whole library. When we invoke the method to often, than we get a crash mentioned above
Screen Shot 2022-12-18 at 6 02 51 PM

@vbovasia
Copy link

  1. Row with the CIKMeans algorithm (ColorKit)
  2. Row with a custom implementation (Not from ColorKit)
  3. Row with .iterative algorithm (ColorKit)

Screen Shot 2022-12-18 at 6 27 17 PM

Dominant_Color_Image_4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants