這裏是另一個用戶將數據轉換成圖像... Reading binary image data from a web service into UIImage
但如果你能我會去了解一下布拉德拉鬆斯真棒GPU圖像過濾器可能會更適合你https://github.com/BradLarson/GPUImage非常容易使用
添加GPUImage框架的答案:對不起,我不能幫助第一,如果你想繼續使用第二,如果你只需要一個所需的閾值效應,你可以使用gpuimage作爲一個框架的工作和設置後,自適應閾值我簡單地使用一個不同效果的開關盒,或者調用init,你想要什麼,我用一個滑塊來獲得效果控制或選擇一個預定的值,但代碼結束如此簡單
case GPUIMAGE_ADAPTIVETHRESHOLD:
{
self.title = @"Adaptive Threshold";
self.filterSettingsSlider.hidden = NO;
[self.filterSettingsSlider setMinimumValue:1.0];
[self.filterSettingsSlider setMaximumValue:20.0];
[self.filterSettingsSlider setValue:1.0];
UIImage *newFilteredImage = [[[GPUImageAdaptiveThresholdFilter alloc] init] imageByFilteringImage:[self.originalImageView image] ];
self.myEditedImageView = newFilteredImage;
}; break;
感謝您的答覆,非常感謝。關於你的第一點,你能告訴我這對我有什麼幫助嗎? pixOtsuAdaptiveThreshold()返回0表示沒有錯誤,1表示錯誤。其次,我玩過Brad Larsons GPU圖像。這是偉大的,但我一直無法得到像pixOtsuAdaptiveThreshold()所需的效果。你能告訴我應該使用哪些特定的方法嗎?謝謝! – Teddy13
對不起,我不能更多的幫助你想要使用的閾值,但是如果你想玩GPUImage過濾器,我的原始答案添加了一些代碼 – rezand