博客
关于我
【瑕疵检测】基于GUI Otsu织物疵点检测【Matlab 330期】
阅读量:714 次
发布时间:2019-03-21

本文共 1377 字,大约阅读时间需要 4 分钟。

大津法(OTSU)详解与应用

简介

大津法(OTSU)是一种广泛应用于图像二值化的算法,由日本计算机学家大津在1979年首次提出的。其核心原理在于通过最大化图像前景与背景的类间方差来确定最优阈值,这种方法也因其优化效果而被誉为“最大类间方差法”。

原理解析

大津法的核心思想是将图像的亮度值进行均匀划分,最终找出使类间方差最大的分割点。具体而言,算法通过数学上的统计推断,计算不同阈值所分割图像的类内方差和类间方差,选择使类间方差最大的阈值作为最终分割结果。这种方法不受图像亮度和对比度的显著影响,因此在无噪声干扰和复杂背景下的图像分割中表现尤为突出。

优缺点分析

优点:

  • 计算简单快速,适合在线或实时处理
  • 耐受噪声较好,但需结合其他降噪技术
  • 无需复杂预处理,可直接应用
  • 最大化类间方差,分割效果稳定
  • 缺点:

  • 对复杂背景(如阴影、颜色渐变)表现一般
  • 对目标与背景比例悬殊时效果较差
  • 对高噪声图像敏感,需额外降噪处理
  • 应用场景

    大津法广泛应用于:

  • 批量图像二值化2.Hist单像素分割
  • 矢量化图像处理
  • 文字识别、车牌识别等任务
  • 代码分析

    function varargout = FabricGui(varargin)    gui_Singleton = 1;    gui_State = struct(...);    % ...    function FabricGui_OpeningFcn(hObject, eventdata, handles, varargin)        handles.output = hObject;        guidata(hObject, handles);    function varargout = FabricGui_OutputFcn(hObject, eventdata, handles)        varargout{1} = handles.output;    function hedit_detect_Callback(hObject, eventdata, handles)        %...    function ptnRun_Callback(hObject, eventdata, handles)        srcDir = uigetdir('Choose source directory.');        allnames = struct2cell(dir('*.bmp'));        % ...        axes(handles.hyuanshiaxes);        imValue = imresize imgetnum ...        [M, N] = size(I);                J = junzhicaiyang(I, M, N, P);        J = uint8(J);        I1 = imresize(J, P, 'bilinear');        T = Otsu(I);        % ...    endend

    运行结果

    图片=<图片描述>(可删除图片引用的链接)

    ##备注版本:2014a

    请添加完整代码或代写业务联系QQ:912100926

    转载地址:http://wenrz.baihongyu.com/

    你可能感兴趣的文章
    nmon_x86_64_centos7工具如何使用
    查看>>
    NN&DL4.1 Deep L-layer neural network简介
    查看>>
    NN&DL4.3 Getting your matrix dimensions right
    查看>>
    NN&DL4.7 Parameters vs Hyperparameters
    查看>>
    NN&DL4.8 What does this have to do with the brain?
    查看>>
    nnU-Net 终极指南
    查看>>
    No 'Access-Control-Allow-Origin' header is present on the requested resource.
    查看>>
    No 'Access-Control-Allow-Origin' header is present on the requested resource.
    查看>>
    NO 157 去掉禅道访问地址中的zentao
    查看>>
    no available service ‘default‘ found, please make sure registry config corre seata
    查看>>
    No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
    查看>>
    no connection could be made because the target machine actively refused it.问题解决
    查看>>
    No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
    查看>>
    No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
    查看>>
    No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
    查看>>
    No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
    查看>>
    No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
    查看>>
    No module named 'crispy_forms'等使用pycharm开发
    查看>>
    No module named cv2
    查看>>
    No module named tensorboard.main在安装tensorboardX的时候遇到的问题
    查看>>