开发者

Need help on data types and class implementation

开发者 https://www.devze.com 2023-02-19 07:12 出处:网络
I need to implement a class which will be used for same image operations. Class should store image data and have methods to do:

I need to implement a class which will be used for same image operations. Class should store image data and have methods to do:

  • cropping (this will return object of same class)
  • binarization of image (making it black-white with specific threshold)
  • some other stuff based on direct pixel manipulation (so I need access to raw data)

I'd need some advices on data types to use. What to use for storing image data? NSImage, CGImage, CIImage? Which of those can help me binarize image? With which could I do pixel manipulation?

I was thinking in saving image data in 2-D array and then implement my binarization method and others. But how do I get 2D array of pixels and how to mak开发者_Go百科e of that image later?

Thank you!


If you are allowed to use 3rd party libraries, take a look at OpenCV.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号