当前位置: 首页 > news >正文

做社交网站多少钱临沂做网络优化的公司

做社交网站多少钱,临沂做网络优化的公司,linux网站架设怎么做,开发微信商城平台效果: Video: 区域增加分割 1、itkThresholdImageFilter 该类的主要功能是通过设置低阈值、高阈值或介于高低阈值之间,则将图像值输出为用户指定的值。 如果图像值低于、高于或介于设置的阈值之间,该类就将图像值设置为用户指定的“外部”值…

效果:

Video:

区域增加分割

1、itkThresholdImageFilter

该类的主要功能是通过设置低阈值、高阈值或介于高低阈值之间,则将图像值输出为用户指定的值。

如果图像值低于、高于或介于设置的阈值之间,该类就将图像值设置为用户指定的“外部”值(默认情况下为“黑色”)。

该类并不对像素进行二值化处理,输出图像中的像素值可以是浮点型或整型。

常用的成员函数:

    Set/GetLower():设置/获取下限阈值Set/GetUpper():设置/获取上限阈值Set/GetOutsideValue():设置/获取“外部”像素值ThresholdAbove():将大于或等于该阈值的值设置为OutsideValueThresholdBelow():将小于或等于该阈值的值设置为OutsideValueThresholdOutside():将超出上下限阈值范围的值设置为 OutsideValue

 Example:

#include "itkImage.h"
#include "itkThresholdImageFilter.h";using namespace itk;const unsigned int  Dimension = 3;       //数据的Dimension
typedef signed short shortPixelType;
typedef itk::Image<shortPixelType, Dimension> ShortImageType;//图像进行阈值分割处理
bool thresholdImage(ShortImageType* image, ShortImageType* outImage)
{const short lowerThr = 200;      //设置下阈值const short upperThr = 1000;   //设置上阈值short outsideValue = 0; typedef ThresholdImageFilter<ShortImageType> thresholdFilterType;typename thresholdFilterType::Pointer thresholder = thresholdFilterType::New();thresholder->SetInput(image);thresholder->SetOutsideValue(outsideValue);设置上下阈值//thresholder->SetLower(lowerThr);//thresholder->SetUpper(upperThr);//<下阈值的值均设为outsideValuethresholder->ThresholdBelow(lowerThr);try{thresholder->Update();}catch (itk::ExceptionObject& ex){//读取过程发生错误std::cerr << "Error: " << ex << std::endl;return false;}//>上阈值的值均设为outsideValuethresholder->ThresholdAbove(upperThr);try{thresholder->Update();}catch (itk::ExceptionObject& ex){//读取过程发生错误std::cerr << "Error: " << ex << std::endl;return false;}//介于阈值之外的值均设为outsideValuethresholder->ThresholdOutside(lowerThr, upperThr);try{thresholder->Update();}catch (itk::ExceptionObject& ex){//读取过程发生错误std::cerr << "Error: " << ex << std::endl;return false;}outImage = thresholder->GetOutput();return true;
}

2、itkBinaryThresholdImageFilter

2、itkBinaryThresholdImageFilter

该类的主要功能是通过阈值处理,将输入图像进行二值化。

输出的图像像素只有两个值:OutsideValue或者InsideValue,具体取决于相应的输入图像像素是否位于高低阈值LowerThreshold和UpperThreshold之间,其中当像素值等于任一阈值时,被认为是在阈值之间。
 
 

注意:LowerThreshold不得大于UpperThreshold ,否则会引发异常。

因此,通常仅需要设置其中之一,具体取决于用户是否希望阈值高于或低于期望阈值。

常用的成员函数

    Set/GetInsideValue():设置/获取“内部”像素值Set/GetOutsideValue():设置/获取“外部”像素值Set/GetLowerThreshold():设置/获取低阈值Set/GetUpperThreshold():设置/获取高阈值

与itkThresholdImageFilter相比较,itkBinaryThresholdImageFilter更适用于将图像根据两个阈值进行二值化处理,而itkThresholdImageFilter适用于将图像中符合条件的像素值映射为特定的数值。

Example:

#include "itkImage.h"
#include "itkBinaryThresholdImageFilter.h";using namespace itk;const unsigned int  Dimension = 3;       //数据的Dimension
typedef signed short shortPixelType;
typedef itk::Image<shortPixelType, Dimension> ShortImageType;//图像进行二值化阈值分割处理
bool binaryThresholdImage(ShortImageType* image, ShortImageType* outImage)
{const short lowerThr = 0;      //设置二值化的下阈值const short upperThr = 1000;   //设置二值化的上阈值short backGround = 0;          //设置背景值short foreGround = 255;        //设置前景值typedef BinaryThresholdImageFilter<ShortImageType, ShortImageType> BThresholdFilterType;typename BThresholdFilterType::Pointer thresholder = BThresholdFilterType::New();thresholder->SetInput(image);thresholder->SetOutsideValue(backGround);thresholder->SetInsideValue(foreGround);thresholder->SetLowerThreshold(lowerThr);thresholder->SetUpperThreshold(upperThr);try{thresholder->Update();}catch (itk::ExceptionObject& ex){//读取过程发生错误std::cerr << "Error: " << ex << std::endl;return false;}outImage = thresholder->GetOutput();return true;
}

3、itkOtsuThresholdImageFilter

该类的功能是使用最大类间方差法Otsu阈值设置图像阈值。

最大类间方差法:是由日本学者大津(Nobuyuki Otsu)于1979年提出的,是一种自适合于双峰情况的自动求取阈值的方法,又叫大津法,简称Otsu。是一种基于全局的二值化算法。

它是按图像的灰度特性,将图像分成背景和目标两部分。背景和目标之间的类间方差越大,说明构成图像的2部分的差别越大,当部分目标错分为背景或部分背景错分为目标都会导致2部分差别变小。因此,使类间方差最大的分割意味着错分概率最小。

常用的成员函数:

Set/GetInsideValue():设置/获取“内部”像素值
Set/GetOutsideValue():设置/获取“外部”像素值
Set/GetReturnBinMidpoint():设置/获取阈值是bin的中点还是最大值? 默认值是 bin 最大值
ReturnBinMidpointOn():设置/获取阈值是bin的中点还是最大值? 默认值是 bin 最大值
VerifyPreconditions():验证先决条件,验证过程对象是否已正确配置、所有必需的输入是否已设置以及所需的参数是否已正确设置, 如果无效,将抛出异常,在将 UpdateOutputInformation() 传播到输入之前调用此方法,ProcessObject 的实现验证 m_NumberOfRequiredInputs 是否已设置且不为空

Code

#include "itkImage.h"
#include "itkOtsuThresholdImageFilter.h"using namespace itk;const unsigned int  Dimension = 3;       //数据的Dimension
typedef signed short shortPixelType;
typedef itk::Image<shortPixelType, Dimension> ShortImageType;bool OtsuThresholdImage(ShortImageType* image, ShortImageType* outImage)
{short outsideValue = 0;    //设置前景背景值short insideValue = 255;typedef OtsuThresholdImageFilter<ShortImageType, ShortImageType> OtsuThresholdFilterType;typename OtsuThresholdFilterType::Pointer thresholder = OtsuThresholdFilterType::New();thresholder->SetInput(image);thresholder->SetOutsideValue(outsideValue);thresholder->SetInsideValue(insideValue);try{thresholder->Update();}catch (itk::ExceptionObject& ex){//读取过程发生错误std::cerr << "Error: " << ex << std::endl;return false;}outImage = thresholder->GetOutput();return true;
}

4、itkConnectedThresholdImageFilter

该类的功能是标记连接到种子并位于值范围内的像素。

该类使用ReplaceValue标记连接到初始种子且位于阈值下限和上限范围内的像素。

与itkThresholdImageFilter等前几个类相比,它们虽然都是根据不同像素的灰度值或像素特征将图像分割成不同的区域,但是此类不同的是基于连接像素的原理,通过选择与种子像素相连的像素来进行分割,分割的结果是连通区域,可以灵活地选择不同的种子点和连接条件,得到不同的连通区域。

itkConnectedThresholdImageFilter适用于分割具有明显边界的目标,可以得到分割结果中目标区域的边界比较平滑。而itkThresholdImageFilter/itkBinaryThresholdImageFilter适用于分割目标灰度值较高或较低的区域,可以得到目标区域与背景的清晰分割

常用的成员函数

AddSeed():增加种子点
ClearSeeds():清除种子列表
SetSeed():设置种子点
GetSeeds():获取种子容器
Set/GetLower():设置/获取下限阈值
Set/GetUpper():设置/获取上限阈值
Set/GetUpperInput():设置/获取连接到管道的上阈值输入
Set/GetLowerInput():设置/获取连接到管道的下阈值输入
SetConnectivity():要使用的连接类型(完全连接或 4(2D)、6(3D)、2*N(ND) 连接)
Set/GetReplaceValue():设置/获取值以替换阈值像素, 介于Lower和Upper(含)内的像素将被替换为该值, 默认值为 1

Code:

#include "itkImage.h"
#include "itkConnectedThresholdImageFilter.h"using namespace itk;const unsigned int  Dimension = 3;       //数据的Dimension
typedef signed short shortPixelType;
typedef itk::Image<shortPixelType, Dimension> ShortImageType;bool connectedThresholdImage(ShortImageType* image, ShortImageType* outImage)
{const short lowerThr = 0;      //设置二值化的上下阈值const short upperThr = 1000;const short replaceValue = 255;ShortImageType::IndexType seed;seed[0] = 100;     //该值必须在图像的三维大小范围内seed[1] = 100;seed[2] = 25;typedef ConnectedThresholdImageFilter<ShortImageType, ShortImageType> ConnectedThresholdFilterType;typename ConnectedThresholdFilterType::Pointer thresholder = ConnectedThresholdFilterType::New();thresholder->SetInput(image);thresholder->SetLower(lowerThr);thresholder->SetUpper(upperThr);thresholder->SetReplaceValue(replaceValue);thresholder->SetSeed(seed);try{thresholder->Update();}catch (itk::ExceptionObject& ex){//读取过程发生错误std::cerr << "Error: " << ex << std::endl;return false;}outImage = thresholder->GetOutput();return true;
}

http://www.fp688.cn/news/156850.html

相关文章:

  • 洛阳市app网站开发公司电话竞价托管外包费用
  • b2b平台有哪些免费的windows优化大师免费
  • 网站单个页面紧张搜索引擎蜘蛛住房和城乡建设部官网
  • 海外sns网站互联网品牌营销公司
  • 上海前十名广告公司百度seo2022新算法更新
  • 哈尔滨如何快速建站外贸网站建设 google
  • 和田网站制作新网站百度收录要几天
  • 电商网站开发定制在线资源搜索引擎
  • 武汉网站建设公司哪家专业关键词文案生成器
  • 企业网站建设 新闻宣传网络营销推广的要点
  • 如何做优品快报下的子网站桂林seo排名
  • 浏览器被病毒网站绑了怎么做seo关键字排名优化
  • php做的网站缺点aso推广优化
  • 做问卷调查赚钱的网站会诈骗不电商大数据查询平台免费
  • 山西做网站多少钱广州网站优化平台
  • 支付宝手机网站支付二维码怎么做google广告投放技巧
  • 送菜网站制作株洲seo快速排名
  • 网站的公关和广告活动怎么做发布软文网站
  • 营口网站制作公司企业网站优化
  • 做胃肠科网站短视频搜索优化
  • 做购物网站需要多少钱中国新闻网发稿
  • 青岛哪家公司做网站好南昌seo排名
  • 静态网站开发 内容百度推广一条资源多少钱
  • 行业b2b网站源码编程培训机构加盟哪家好
  • 超值的镇江网站建设seo优化主要做什么
  • 落地页需要建网站吗百度平台商家我的订单查询
  • 做家装的网站泸州网站优化推广
  • 网站规划与网页设计总结在线注册网站
  • 丛台企业做网站推广品牌运营策划
  • dede新手做网站多久苏州百度推广代理商