?? opencv用戶手冊之圖像處理部分(之二):采樣、差值與幾何變換(中文翻譯) - hunnish的opencv專欄.htm
字號:
<DT>fillval
<DD>用來填充邊界外面的值 </DD></DL>
<P>函數 <SPAN lang=EN-US><A
href="file:///C:/DOCUME~1/user/LOCALS~1/Temp/FrontPageTempDir/pvw1.htm#decl_cvWarpAffine">cvWarpAffine</A>
利用下面指定的矩陣變換輸入圖像:</SPAN></P><PRE>dst(x&apos;,y&apos;)<-src(x,y)
如果沒有指定<SPAN lang=EN-US> CV_WARP_INVERSE_MAP , (x&apos;,y&apos;)<SUP>T</SUP>=map_matrix?(x,y,1)<SUP>T</SUP>+b ,</SPAN>
否則,<SPAN lang=EN-US> (x, y)<SUP>T</SUP>=map_matrix?(x&apos;,y&apos,1)<SUP>T</SUP>+b</SPAN>
</PRE>
<P>函數與 <SPAN lang=EN-US><A
href="file:///C:/DOCUME~1/user/LOCALS~1/Temp/FrontPageTempDir/pvw1.htm#decl_cvGetQuadrangleSubPix">cvGetQuadrangleSubPix</A>
類似,但是不完全相同。 <A
href="file:///C:/DOCUME~1/user/LOCALS~1/Temp/FrontPageTempDir/pvw1.htm#decl_cvWarpAffine">cvWarpAffine</A>
要求輸入和輸出圖像具有同樣的數據類型,有更大的資源開銷(因此對大圖像不太合適)而且輸出圖像的部分可以保留不變。而 <A
href="file:///C:/DOCUME~1/user/LOCALS~1/Temp/FrontPageTempDir/pvw1.htm#decl_cvGetQuadrangleSubPix">cvGetQuadrangleSubPix</A>
可以精確地從8位圖像中提取四邊形到浮點數緩存區中,具有比較小的系統開銷,而且總是全部改變輸出圖像的內容。</SPAN></P>
<P>要變換稀疏矩陣,使用<SPAN lang=EN-US> cxcore 中的函數 <A
href="file:///C:/DOCUME~1/user/LOCALS~1/Temp/FrontPageTempDir/pvw1.htm#decl_cvTransform">cvTransform</A>
。</SPAN></P>
<HR>
<H3><A name=decl_cv2DRotationMatrix>2DRotationMatrix</A></H3>
<P class=Blurb><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: Helvetica; mso-hansi-font-family: Helvetica">計算二維旋轉的仿射變換矩陣</SPAN></P><PRE>CvMat* cv2DRotationMatrix( CvPoint2D32f center, double angle,
double scale, CvMat* map_matrix );
</PRE>
<P>
<DL>
<DT>center
<DD>輸入圖像的旋轉中心
<DT>angle
<DD>旋轉角度(度)。正值表示逆時針旋轉<SPAN lang=EN-US>(坐標原點假設在左上角).</SPAN>
<DT>scale
<DD>各項同性的尺度因子
<DT>map_matrix
<DD>輸出<SPAN lang=EN-US> 2×3 矩陣的指針</SPAN> </DD></DL>
<P>函數 <SPAN lang=EN-US><A
href="file:///C:/DOCUME~1/user/LOCALS~1/Temp/FrontPageTempDir/pvw1.htm#decl_cv2DRotationMatrix">cv2DRotationMatrix</A>
計算矩陣:</SPAN></P><PRE>[ α β | (1-α)*center.x - β*center.y ]
[ -β α | β*center.x + (1-α)*center.y ]
where α=scale*cos(angle), β=scale*sin(angle)
</PRE>
<P>該變換映射旋轉中心到它本身。如果這不是目的的話,應該調整平移(<SPAN lang=EN-US>Hunnish: 這段話令人費解:The
transformation maps the rotation center to itself. If this is not the purpose,
the shift should be adjusted)</SPAN></P>
<HR>
<H3><A name=decl_cvWarpPerspective>WarpPerspective</A></H3>
<P class=Blurb><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: Helvetica; mso-hansi-font-family: Helvetica">對圖像進行透視變換</SPAN></P><PRE>void cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* map_matrix,
int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS,
CvScalar fillval=cvScalarAll(0) );
</PRE>
<P>
<DL>
<DT>src
<DD>輸入圖像.
<DT>dst
<DD>輸出圖像.
<DT>map_matrix
<DD><SPAN lang=EN-US>3×3 變換矩陣</SPAN>
<DT>flags
<DD>差值方法的開關選項:
<UL>
<LI>CV_WARP_FILL_OUTLIERS - <SPAN
lang=EN-US>填充所有縮小圖像的象素。如果部分象素落在輸入圖像的邊界外,那么它們的值設定為 </SPAN><CODE><SPAN
lang=EN-US>fillval</SPAN></CODE><SPAN lang=EN-US>.</SPAN>
<LI>CV_WARP_INVERSE_MAP - <SPAN lang=EN-US>指定 </SPAN><CODE><SPAN
lang=EN-US>matrix</SPAN></CODE><SPAN lang=EN-US>
是輸出圖像到輸入圖像的反變換,因此可以直接用來做象素差值。否則, 函數從 </SPAN><CODE><SPAN
lang=EN-US>map_matrix 得到反變換。</SPAN></CODE> </LI></UL>
<DT>fillval
<DD>用來填充邊界外面的值 </DD></DL>
<P>函數 <SPAN lang=EN-US><A
href="file:///C:/DOCUME~1/user/LOCALS~1/Temp/FrontPageTempDir/pvw1.htm#decl_cvWarpPerspective">cvWarpPerspective</A>
利用下面指定矩陣變換輸入圖像:</SPAN></P><PRE>dst(x&apos;,y&apos;)<-src(x,y)
若指定<SPAN lang=EN-US> CV_WARP_INVERSE_MAP, (tx&apos;,ty&apos;,t)<SUP>T</SUP>=map_matrix?(x,y,1)<SUP>T</SUP>+b</SPAN>
否則,<SPAN lang=EN-US> (tx, ty, t)<SUP>T</SUP>=map_matrix?(x&apos;,y&apos,1)<SUP>T</SUP>+b</SPAN>
</PRE>
<P>要變換稀疏矩陣,使用<SPAN lang=EN-US> cxcore 中的函數 <A
href="file:///C:/DOCUME~1/user/LOCALS~1/Temp/FrontPageTempDir/pvw1.htm#decl_cvTransform">cvTransform</A>
。</SPAN></P>
<HR>
<H3><A name=decl_cvWarpPerspectiveQMatrix>WarpPerspectiveQMatrix</A></H3>
<P class=Blurb><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: Helvetica; mso-hansi-font-family: Helvetica">用</SPAN><SPAN
lang=EN-US>4</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: Helvetica; mso-hansi-font-family: Helvetica">個對應點計算透視變換矩陣</SPAN></P><PRE>CvMat* cvWarpPerspectiveQMatrix( const CvPoint2D32f* src,
const CvPoint2D32f* dst,
CvMat* map_matrix );
</PRE>
<P>
<DL>
<DT>src
<DD>輸入圖像的四邊形的<SPAN lang=EN-US>4個點坐標</SPAN>
<DT>dst
<DD>輸出圖像的對應四邊形的<SPAN lang=EN-US>4個點坐標</SPAN>
<DT>map_matrix
<DD>輸出的<SPAN lang=EN-US> 3×3 矩陣</SPAN> </DD></DL>
<P>函數 <SPAN lang=EN-US><A
href="file:///C:/DOCUME~1/user/LOCALS~1/Temp/FrontPageTempDir/pvw1.htm#decl_cvWarpPerspectiveQMatrix">cvWarpPerspectiveQMatrix</A>
計算透視變換矩陣,使得:</SPAN></P><PRE>(t<SUB>i</SUB>x'<SUB>i</SUB>,t<SUB>i</SUB>y'<SUB>i</SUB>,t<SUB>i</SUB>)<SUP>T</SUP>=matrix?(x<SUB>i</SUB>,y<SUB>i</SUB>,1)<SUP>T</SUP>
</PRE>
<P>where <CODE>dst(i)=(x'<SUB>i</SUB>,y'<SUB>i</SUB>),
src(i)=(x<SUB>i</SUB>,y<SUB>i</SUB>), i=0..3</CODE>.</P><BR><BR>
<P id=TBPingURL>Trackback:
http://tb.blog.csdn.net/TrackBack.aspx?PostId=93174</P></DIV>
<DIV class=postFoot>
<SCRIPT
src="OPENCV用戶手冊之圖像處理部分(之二):采樣、差值與幾何變換(中文翻譯) - HUNNISH的OPENCV專欄.files/PromoteIcon.aspx"></SCRIPT>
[<A href="javascript:StorePage()">點擊此處收藏本文</A>] 發表于 2004年09月03日 9:26
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/03/93174.aspx"
dc:identifier="http://blog.csdn.net/hunnish/archive/2004/09/03/93174.aspx"
dc:title="OPENCV用戶手冊之圖像處理部分(之二):采樣、差值與幾何變換(中文翻譯) "
trackback:ping="http://tb.blog.csdn.net/TrackBack.aspx?PostId=93174" />
</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=93587> </A>
<DIV class=post>
<DIV class=postTitle>stone 發表于2004-09-03 2:48 PM IP:
61.170.214.*</DIV>
<DIV class=postText>斑竹真是勞苦功高啊!</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>評論 <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%2f03%2f93174.aspx&datetime=4%2f6%2f2006+6%3a09%3a32+PM&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>
<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 + -