本文介绍一个 iPhone 图像处理库,提供了边缘检测、直方图均衡等功能。

简介

Chris Greening 开发了一个 iphone 图像处理库,该库基于 C++ 开发并提供了 Objective-C 封装,提供了边缘检测、直方图均衡等常用的图像处理功能。该图像库开源,遵循 BSD 协议。

该图像库的源代码中提供了一个 Xcode 实验床以便于用户体验该库的功能。在默认状态下,该实验床将图像转换成灰度模式 (grayscale),对图像做高斯模糊 (gaussian blur)操作,然后完成 Canny 边沿提取 (Canny edge extraction)。

simple iphone image processing:Provide a simple class for doing image processing on the iPhone。


使用方法

用户在使用该库时,通常是传入一个 UIImage 对象,该库将该对象转换成灰度图像,然后进行处理。

下面是一个代码样例:

    // convert to grey scale and shrink the image by 4 - this makes processing a lot faster!
    ImageWrapper *greyScale=Image::createImage(srcImage, srcImage.size.width/4, srcImage.size.height/4);

    // do a gaussian blur and then extract edges using the canny edge detector
    // you can play around with the numbers to see how it effects the edge extraction
    // typical numbers are  tlow 0.20-0.50, thigh 0.60-0.90
    ImageWrapper *edges=greyScale.image->gaussianBlur().image->cannyEdgeExtract(0.3,0.7);
    // show the results
    resultImage.image=edges.image->toUIImage();


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值