简体   繁体   English

UIImage灰度阈值

[英]UIImage grayscale thresholding

I want to threshold a grayscale UIImage. 我想阈值灰度UIImage。 What's the easiest way to do this? 最简单的方法是什么?

I think I have to get the bitmap of the UIImage and then compare it to some value and then set it to either 0/255. 我想我必须获取UIImage的位图,然后将其与某个值进行比较,然后将其设置为0/255。 How to get the bitmap? 如何获得位图?

If you are looking to get bitmap from UIImage here is a complete tutorial. 如果您希望从UIImage中获取位图,则这里是完整的教程。

iOS: Converting UIImage to RGBA8 Bitmaps and Back iOS:将UIImage转换为RGBA8位图并返回

This will surely help you. 这一定会对您有所帮助。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM