⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opencv用户手册之图像处理部分(之四):滤波器与色彩转换(中文翻译) - hunnish的opencv专栏.htm

📁 Opencv的中文参考指南
💻 HTM
📖 第 1 页 / 共 3 页
字号:
        <P align=center>B</FONT></P></TD>
      <TD><FONT color=#008000 size=5>
        <P align=center>G</FONT></P></TD>
      <TD><FONT color=#0000ff size=5>
        <P align=center>B</FONT></P></TD>
      <TD><FONT color=#008000 size=5>
        <P align=center>G</FONT></P></TD></TR></TBODY></TABLE>
  <P>The output RGB components of a pixel are interpolated from 1, 2 or 4 
  neighbors of the pixel having the same color. There are several modifications 
  of the above pattern that can be achieved by shifting the pattern one pixel 
  left and/or one pixel up. The two letters C<SUB>1</SUB> and C<SUB>2</SUB> in 
  the conversion constants CV_BayerC<SUB>1</SUB>C<SUB>2</SUB>2{BGR|RGB} indicate 
  the particular pattern type - these are components from the second row, second 
  and third columns, respectively. For example, the above pattern has very 
  popular "BG" type.</P></LI></UL>
<HR>

<H3><A name=decl_cvThreshold>Threshold</A></H3>
<P class=Blurb>对数组元素进行固定阈值操作</P><PRE>void cvThreshold( const CvArr* src, CvArr* dst, double threshold,
                  double max_value, int threshold_type );
</PRE>
<P>
<DL>
  <DT>src 
  <DD>原始数组 (单通道, 8-比特 of 32-比特 浮点数). 
  <DT>dst 
  <DD>输出数组,必须与 <CODE>src</CODE> 的类型一致,或者为 8-比特. 
  <DT>threshold 
  <DD>阈值 
  <DT>max_value 
  <DD>使用 <CODE>CV_THRESH_BINARY</CODE> 和 <CODE>CV_THRESH_BINARY_INV</CODE> 的最大值. 

  <DT>threshold_type 
  <DD>阈值类型 (见讨论) </DD></DL>
<P>函数 <A 
href="file:///D:/程序/OpenCV/docs/ref/opencvref_cv.HTM#decl_cvThreshold"><FONT 
color=#002c99>cvThreshold</FONT></A> 对单通道数组应用固定阈值操作。典型的是对灰度图像进行阈值操作得到二值图像。(<A 
href="file:///D:/程序/OpenCV/docs/ref/opencvref_cxcore.htm#decl_cvCmpS"><FONT 
color=#002c99>cvCmpS</FONT></A> 也可以达到此目的) 
或者是去掉噪声,例如过滤很小或很大象素值的图像点。有好几种对图像取阈值的方法,本函数支持的方法由 <CODE>threshold_type 
确定</CODE>:</P><PRE>threshold_type=CV_THRESH_BINARY:
dst(x,y) = max_value, if src(x,y)&gt;threshold
           0, otherwise

threshold_type=CV_THRESH_BINARY_INV:
dst(x,y) = 0, if src(x,y)&gt;threshold
           max_value, otherwise

threshold_type=CV_THRESH_TRUNC:
dst(x,y) = threshold, if src(x,y)&gt;threshold
           src(x,y), otherwise

threshold_type=CV_THRESH_TOZERO:
dst(x,y) = src(x,y), if (x,y)&gt;threshold
           0, otherwise

threshold_type=CV_THRESH_TOZERO_INV:
dst(x,y) = 0, if src(x,y)&gt;threshold
           src(x,y), otherwise
</PRE>
<P>下面是图形化的阈值描述:</P>
<P><IMG src="" align=center> </P>
<HR>

<H3><A name=decl_cvAdaptiveThreshold>AdaptiveThreshold</A></H3>
<P class=Blurb>自适应阈值方法</P><PRE>void cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double max_value,
                          int adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C,
                          int threshold_type=CV_THRESH_BINARY,
                          int block_size=3, double param1=5 );
</PRE>
<P>
<DL>
  <DT>src 
  <DD>输入图像. 
  <DT>dst 
  <DD>输出图像. 
  <DT>max_value 
  <DD>使用 <CODE>CV_THRESH_BINARY</CODE> 和 <CODE>CV_THRESH_BINARY_INV</CODE> 的最大值. 

  <DT>adaptive_method 
  <DD>自适应阈值算法使用:<CODE>CV_ADAPTIVE_THRESH_MEAN_C</CODE> 或 
  <CODE>CV_ADAPTIVE_THRESH_GAUSSIAN_C</CODE> (见讨论). 
  <DT>threshold_type 
  <DD>取阈值类型:必须是下者之一 
  <UL>
    <LI><CODE>CV_THRESH_BINARY,</CODE> 
    <LI><CODE>CV_THRESH_BINARY_INV</CODE> </LI></UL>
  <DT>block_size 
  <DD>用来计算阈值的象素邻域大小: 3, 5, 7, ... 
  <DT>param1 
  <DD>与方法有关的参数。对方法 <CODE>CV_ADAPTIVE_THRESH_MEAN_C</CODE> 和 
  <CODE>CV_ADAPTIVE_THRESH_GAUSSIAN_C</CODE>, 它是一个从均值或加权均值提取的常数(见讨论), 尽管它可以是负数。 
  </DD></DL>
<P>函数 <A 
href="file:///D:/程序/OpenCV/docs/ref/opencvref_cv.HTM#decl_cvAdaptiveThreshold"><FONT 
color=#002c99>cvAdaptiveThreshold</FONT></A> 将灰度图像变换到二值图像,采用下面公式:</P><PRE>threshold_type=<CODE>CV_THRESH_BINARY</CODE>:
dst(x,y) = max_value, if src(x,y)&gt;T(x,y)
           0, otherwise

threshold_type=<CODE>CV_THRESH_BINARY_INV</CODE>:
dst(x,y) = 0, if src(x,y)&gt;T(x,y)
           max_value, otherwise
</PRE>
<P>其中 T<SUB>I</SUB> 是为每一个象素点单独计算的阈值</P>
<P>对方法 CV_ADAPTIVE_THRESH_MEAN_C,它是 block_size × block_size 块中的象素点,被参数 param1 
所减,得到的均值,</P>
<P>对方法 CV_ADAPTIVE_THRESH_GAUSSIAN_C 它是 block_size × block_size 块中的象素点,被参数 
param1 所减,得到的加权和(gaussian)。</P><BR><BR>
<P id=TBPingURL>Trackback: 
http://tb.blog.csdn.net/TrackBack.aspx?PostId=95534</P></DIV>
<DIV class=postFoot>
<SCRIPT 
src="OPENCV用户手册之图像处理部分(之四):滤波器与色彩转换(中文翻译) - HUNNISH的OPENCV专栏.files/PromoteIcon.aspx"></SCRIPT>
[<A href="javascript:StorePage()">点击此处收藏本文</A>]&nbsp;&nbsp; 发表于 2004年09月06日 
10:17 AM </DIV></DIV><LINK 
href="http://blog.csdn.net/hunnish/Services/Pingback.aspx" rel=pingback><!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://blog.csdn.net/hunnish/archive/2004/09/06/95534.aspx"
dc:identifier="http://blog.csdn.net/hunnish/archive/2004/09/06/95534.aspx"
dc:title="OPENCV用户手册之图像处理部分(之四):滤波器与色彩转换(中文翻译) "
trackback:ping="http://tb.blog.csdn.net/TrackBack.aspx?PostId=95534" />
</rdf:RDF>
-->
<SCRIPT>function hide(){showComment();}</SCRIPT>
<BR>
<SCRIPT>document.write("<img src=http://counter.csdn.net/pv.aspx?id=24 border=0 width=0 height=0>");</SCRIPT>
<BR>
<DIV id=comments>
<H3></H3><A name=291249>&nbsp;</A>
<DIV class=post>
<DIV class=postTitle>schwartz&nbsp;发表于2005-02-17 4:45 PM&nbsp;&nbsp;IP: 
202.232.87.*</DIV>
<DIV class=postText>谢谢楼主的介绍,不过色彩空间转换中反求G的公式中,Cb和Cr位置反了。</DIV></DIV><BR></DIV>
<DIV class=CommentForm id=commentform>
<H3>发表评论</H3>
<TABLE class=CommentForm>
  <TBODY>
  <TR>
    <TD width=69 height=0></TD>
    <TD></TD></TR>
  <TR>
    <TD width=70>大名:</TD>
    <TD align=left><INPUT id=PostComment.ascx_tbName style="WIDTH: 300px" 
      size=40 name=PostComment.ascx:tbName> <SPAN 
      id=PostComment.ascx_RequiredFieldValidator2 
      style="DISPLAY: none; COLOR: red" initialvalue="" 
      evaluationfunction="RequiredFieldValidatorEvaluateIsValid" 
      display="Dynamic" errormessage="<br>请输入尊姓大名" 
      controltovalidate="PostComment.ascx_tbName"><BR>请输入尊姓大名</SPAN> </TD></TR>
  <TR>
    <TD width=70>网址:</TD>
    <TD align=left><INPUT id=PostComment.ascx_tbUrl style="WIDTH: 300px" 
      size=40 name=PostComment.ascx:tbUrl> </TD></TR>
  <TR>
    <TD colSpan=3>评论&nbsp; <SPAN id=PostComment.ascx_RequiredFieldValidator3 
      style="DISPLAY: none; COLOR: red" initialvalue="" 
      evaluationfunction="RequiredFieldValidatorEvaluateIsValid" 
      display="Dynamic" errormessage="<br>请输入评论" 
      controltovalidate="PostComment.ascx_tbComment"><BR>请输入评论</SPAN> <BR><TEXTAREA id=PostComment.ascx_tbComment style="WIDTH: 381px; HEIGHT: 193px" name=PostComment.ascx:tbComment rows=10 cols=50></TEXTAREA> 
    </TD></TR>
  <TR style="DISPLAY: none">
    <TD height=24>验证码</TD>
    <TD><INPUT id=PostComment.ascx_ValidationKey style="WIDTH: 150px" 
      name=PostComment.ascx:ValidationKey> <INPUT id=VCImageSrc type=hidden 
      value=/VerifyCode.aspx?url=http%3a%2f%2fblog.csdn.net%2fhunnish%2farchive%2f2004%2f09%2f06%2f95534.aspx&amp;datetime=4%2f6%2f2006+6%3a09%3a58+PM&amp;ip=61.167.60.209> 
      <SPAN id=VCImageSpan></SPAN>
      <SCRIPT 
      src="OPENCV用户手册之图像处理部分(之四):滤波器与色彩转换(中文翻译) - HUNNISH的OPENCV专栏.files/deferShowVerifyImage.js" 
      type=text/javascript></SCRIPT>
    </TD></TR>
  <TR>
    <TD colSpan=3><INPUT language=javascript class=Button id=PostComment.ascx_btnSubmit onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " type=submit value=提交 name=PostComment.ascx:btnSubmit>&nbsp;&nbsp;&nbsp; 
      <INPUT id=PostComment.ascx_chkRemember type=checkbox 
      name=PostComment.ascx:chkRemember><LABEL 
      for=PostComment.ascx_chkRemember>记住我?</LABEL></TD></TR>
  <TR>
    <TD colSpan=3><SPAN id=PostComment.ascx_Message 
    style="COLOR: red"></SPAN></TD></TR></TBODY></TABLE></DIV></DIV>
<P id=footer>Powered by: <BR><A id=Footer1_Hyperlink2 
href="http://scottwater.com/blog" name=Hyperlink1><IMG alt="" 
src="OPENCV用户手册之图像处理部分(之四):滤波器与色彩转换(中文翻译) - HUNNISH的OPENCV专栏.files/100x30_Logo.gif" 
border=0></A> <A id=Footer1_Hyperlink3 href="http://asp.net/" 
name=Hyperlink1><IMG alt="" 
src="OPENCV用户手册之图像处理部分(之四):滤波器与色彩转换(中文翻译) - HUNNISH的OPENCV专栏.files/PoweredByAsp.Net.gif" 
border=0></A> <BR>Copyright © HUNNISH </P>
<SCRIPT 
src="OPENCV用户手册之图像处理部分(之四):滤波器与色彩转换(中文翻译) - HUNNISH的OPENCV专栏.files/counter.js"></SCRIPT>

<SCRIPT language=javascript type=text/javascript>
<!--
	var Page_Validators =  new Array(document.all["PostComment.ascx_RequiredFieldValidator2"], document.all["PostComment.ascx_RequiredFieldValidator3"]);
		// -->
</SCRIPT>

<SCRIPT language=javascript type=text/javascript>
<!--
var Page_ValidationActive = false;
if (typeof(clientInformation) != "undefined" && clientInformation.appName.indexOf("Explorer") != -1) {
    if ((typeof(Page_ValidationVer) != "undefined") && (Page_ValidationVer == "125"))
        ValidatorOnLoad();
}

function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    return true;
}
// -->
</SCRIPT>
</FORM>
<SCRIPT language=javascript>
	<!--
	try{
		hide();
		}
		catch(e){
		}
	//-->
	</SCRIPT>
</BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -