?? opencv用戶手冊(cè)之圖像處理部分(之四):濾波器與色彩轉(zhuǎn)換(中文翻譯) - hunnish的opencv專(zhuān)欄.htm
字號(hào):
<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>對(duì)數(shù)組元素進(jìn)行固定閾值操作</P><PRE>void cvThreshold( const CvArr* src, CvArr* dst, double threshold,
double max_value, int threshold_type );
</PRE>
<P>
<DL>
<DT>src
<DD>原始數(shù)組 (單通道, 8-比特 of 32-比特 浮點(diǎn)數(shù)).
<DT>dst
<DD>輸出數(shù)組,必須與 <CODE>src</CODE> 的類(lèi)型一致,或者為 8-比特.
<DT>threshold
<DD>閾值
<DT>max_value
<DD>使用 <CODE>CV_THRESH_BINARY</CODE> 和 <CODE>CV_THRESH_BINARY_INV</CODE> 的最大值.
<DT>threshold_type
<DD>閾值類(lèi)型 (見(jiàn)討論) </DD></DL>
<P>函數(shù) <A
href="file:///D:/程序/OpenCV/docs/ref/opencvref_cv.HTM#decl_cvThreshold"><FONT
color=#002c99>cvThreshold</FONT></A> 對(duì)單通道數(shù)組應(yīng)用固定閾值操作。典型的是對(duì)灰度圖像進(jìn)行閾值操作得到二值圖像。(<A
href="file:///D:/程序/OpenCV/docs/ref/opencvref_cxcore.htm#decl_cvCmpS"><FONT
color=#002c99>cvCmpS</FONT></A> 也可以達(dá)到此目的)
或者是去掉噪聲,例如過(guò)濾很小或很大象素值的圖像點(diǎn)。有好幾種對(duì)圖像取閾值的方法,本函數(shù)支持的方法由 <CODE>threshold_type
確定</CODE>:</P><PRE>threshold_type=CV_THRESH_BINARY:
dst(x,y) = max_value, if src(x,y)>threshold
0, otherwise
threshold_type=CV_THRESH_BINARY_INV:
dst(x,y) = 0, if src(x,y)>threshold
max_value, otherwise
threshold_type=CV_THRESH_TRUNC:
dst(x,y) = threshold, if src(x,y)>threshold
src(x,y), otherwise
threshold_type=CV_THRESH_TOZERO:
dst(x,y) = src(x,y), if (x,y)>threshold
0, otherwise
threshold_type=CV_THRESH_TOZERO_INV:
dst(x,y) = 0, if src(x,y)>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>自適應(yīng)閾值方法</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>自適應(yīng)閾值算法使用:<CODE>CV_ADAPTIVE_THRESH_MEAN_C</CODE> 或
<CODE>CV_ADAPTIVE_THRESH_GAUSSIAN_C</CODE> (見(jiàn)討論).
<DT>threshold_type
<DD>取閾值類(lèi)型:必須是下者之一
<UL>
<LI><CODE>CV_THRESH_BINARY,</CODE>
<LI><CODE>CV_THRESH_BINARY_INV</CODE> </LI></UL>
<DT>block_size
<DD>用來(lái)計(jì)算閾值的象素鄰域大小: 3, 5, 7, ...
<DT>param1
<DD>與方法有關(guān)的參數(shù)。對(duì)方法 <CODE>CV_ADAPTIVE_THRESH_MEAN_C</CODE> 和
<CODE>CV_ADAPTIVE_THRESH_GAUSSIAN_C</CODE>, 它是一個(gè)從均值或加權(quán)均值提取的常數(shù)(見(jiàn)討論), 盡管它可以是負(fù)數(shù)。
</DD></DL>
<P>函數(shù) <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)>T(x,y)
0, otherwise
threshold_type=<CODE>CV_THRESH_BINARY_INV</CODE>:
dst(x,y) = 0, if src(x,y)>T(x,y)
max_value, otherwise
</PRE>
<P>其中 T<SUB>I</SUB> 是為每一個(gè)象素點(diǎn)單獨(dú)計(jì)算的閾值</P>
<P>對(duì)方法 CV_ADAPTIVE_THRESH_MEAN_C,它是 block_size × block_size 塊中的象素點(diǎn),被參數(shù) param1
所減,得到的均值,</P>
<P>對(duì)方法 CV_ADAPTIVE_THRESH_GAUSSIAN_C 它是 block_size × block_size 塊中的象素點(diǎn),被參數(shù)
param1 所減,得到的加權(quán)和(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用戶手冊(cè)之圖像處理部分(之四):濾波器與色彩轉(zhuǎn)換(中文翻譯) - HUNNISH的OPENCV專(zhuān)欄.files/PromoteIcon.aspx"></SCRIPT>
[<A href="javascript:StorePage()">點(diǎn)擊此處收藏本文</A>] 發(fā)表于 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用戶手冊(cè)之圖像處理部分(之四):濾波器與色彩轉(zhuǎn)換(中文翻譯) "
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> </A>
<DIV class=post>
<DIV class=postTitle>schwartz 發(fā)表于2005-02-17 4:45 PM IP:
202.232.87.*</DIV>
<DIV class=postText>謝謝樓主的介紹,不過(guò)色彩空間轉(zhuǎn)換中反求G的公式中,Cb和Cr位置反了。</DIV></DIV><BR></DIV>
<DIV class=CommentForm id=commentform>
<H3>發(fā)表評(píng)論</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>請(qǐng)輸入尊姓大名"
controltovalidate="PostComment.ascx_tbName"><BR>請(qǐng)輸入尊姓大名</SPAN> </TD></TR>
<TR>
<TD width=70>網(wǎng)址:</TD>
<TD align=left><INPUT id=PostComment.ascx_tbUrl style="WIDTH: 300px"
size=40 name=PostComment.ascx:tbUrl> </TD></TR>
<TR>
<TD colSpan=3>評(píng)論 <SPAN id=PostComment.ascx_RequiredFieldValidator3
style="DISPLAY: none; COLOR: red" initialvalue=""
evaluationfunction="RequiredFieldValidatorEvaluateIsValid"
display="Dynamic" errormessage="<br>請(qǐng)輸入評(píng)論"
controltovalidate="PostComment.ascx_tbComment"><BR>請(qǐng)輸入評(píng)論</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>驗(yàn)證碼</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&datetime=4%2f6%2f2006+6%3a09%3a58+PM&ip=61.167.60.209>
<SPAN id=VCImageSpan></SPAN>
<SCRIPT
src="OPENCV用戶手冊(cè)之圖像處理部分(之四):濾波器與色彩轉(zhuǎn)換(中文翻譯) - HUNNISH的OPENCV專(zhuān)欄.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>
<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用戶手冊(cè)之圖像處理部分(之四):濾波器與色彩轉(zhuǎn)換(中文翻譯) - HUNNISH的OPENCV專(zhuān)欄.files/100x30_Logo.gif"
border=0></A> <A id=Footer1_Hyperlink3 href="http://asp.net/"
name=Hyperlink1><IMG alt=""
src="OPENCV用戶手冊(cè)之圖像處理部分(之四):濾波器與色彩轉(zhuǎn)換(中文翻譯) - HUNNISH的OPENCV專(zhuān)欄.files/PoweredByAsp.Net.gif"
border=0></A> <BR>Copyright ? HUNNISH </P>
<SCRIPT
src="OPENCV用戶手冊(cè)之圖像處理部分(之四):濾波器與色彩轉(zhuǎn)換(中文翻譯) - HUNNISH的OPENCV專(zhuān)欄.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>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -