Advanced image processing in Metal

Hi all, hi Caroline,

I have been programming my prototype on Matlab. And I have read a lot of doing advanced image processing. In Matlab it was no problem. However I need to integrate this on swift. The image size is relatively huge.

There are a few things I want to try:

  1. do a superpixel algorithm.
  2. Add rows and columns of an “edge”, or binary, image
  3. perform a convolution on an image and finding the maximum point.

So please: any help? I am trying to focus while my kids are home schooling but I cannot. I am in dire need of a push.

Thanks a lot

Hi, @omarfakhr, and welcome to the forums :slight_smile:

I haven’t done much image processing, so I can’t help you, I’m afraid.

Just to give you something to google, you’d do this sort of thing in Metal kernel shaders. It’s possible that Metal Performance Shaders might help you too:

https://developer.apple.com/documentation/metalperformanceshaders

https://developer.apple.com/documentation/metalperformanceshaders/convolutional_neural_network_kernels

Thanks Caroline for your answer. I really enjoy your course

I guess I have a long way to go then.

If you’re not confident in Metal, then perhaps you might check out Core Image. If you’re a pro member, there’s a video tutorial course: https://www.raywenderlich.com/5428948-core-image-from-ciimage-to-metal-and-beyond

Also, Simon Gladman wrote a book on CI a few years ago: ‎Core Image for Swift on Apple Books. It’s now free I think. The code might need to be updated for Swift 5.0, but the concepts are the same.

1 Like

Thanks Caroline,
I already took the course from S Davies. It was really good and helped my a lot. But I still cannot find what I am looking for :slight_smile:

I will check Simon Gladman book. Thanks a lot.

BTW: After the image processing I will have to do image warping, vertex manipulation and rendering. Maybe also cloth simulation. So I will get back to you. As I said, i have a log way to go.

1 Like