- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
基于八邻域的边界跟踪代码(Border tracking code based on octa-based domain)
基于八邻域的边界跟踪代码(Border tracking code based on octa-based domain)
# include iostream. H
# include iomanip. H
# define NumberOfPossiblePoints 64
# define Size_of_Array 8
Void main ()
{
Int f [Size_of_Array] [Size_of_Array] =
{0,0,0,0,0,0,0,0.
0,0,1,1,0,0,0,0,
0,0,1,1,0,0,0,0,
0,1,1,1,1,0,0,0,
0,0,1,1,1,1,0,0,
0,0,1,1,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0};
Int border [Size_of_Array] [Size_of_Array]; / / also, 0, 1 means that the border array records the path of the walk;
int
Trace [NumberOfPossiblePoints] [2];
/ / you also need to use a second - dimensional array to record the walking coordinates in turn
Int chaincode [NumberOfPossiblePoints]; / / store direction code
Int dir.
Int I, j;
Int flag;
Int count;
Int p0x, p0y; / / the initial coordinates
Int p1x p1y; / / the coordinates of the second point found
Int pn_1x pn_1y, PNX, pny; / / used to record the target coordinates
/ / Initialization for some arrays:
For (I = 0; I NumberOfPossiblePoints; i++)
{
Chaincode [I] = 0;
For (j = 0; j 2; j++)
Trace [I] [j] = 0;
}
/ / begin, lets first look at the original data and, at the same time, clear border array:
For (I = 0; I Size_of_Array; i++)
{
For (j = 0; j Size_of_Array; j++)
{
Cout setw (6) f [I] [j];
Border [I] [j] = 0;
}
Cout endl;
}
Count = 0;
Flag = 1;
Dir = 7. / / based on the algorithm, determine the direction of the next boundary point first
/ / find the initial point (pixel) whose value is not zero.
P0x = 1; P0y = 2;
I = p0x;
J = p0y;
Border [I] [j] = 1;
Trace [count] [0] = I; Trace [count] [1] = j;
/ / repeat
/ / in order to keep the cycle going, the walking number must be more than 1, otherwise
/ / the first step is to find p0, p1, and since this is the coordinates of p0 and p1 of p0 and p1 for the final pn - 1, the loop exits.
/ / increase the count in the while loop condition, and when count is less than 2, it should not end.
while
(count 2 | | (pn_1x! = p0x) | | (pn_1y! = p0y) | | (PNX! = p1x) | | (pny! = p1y))
{
/ / log the coordinates of wa
您可能关注的文档
- 印刷术语齐齐讲(The printing term is qiqi).doc
- 历年真题4(The years are real).doc
- 压制玻璃(Pressed glass).doc
- 压力加工设备(Pressure processing equipment).doc
- 压力管道考核试题2005(Pressure pipeline assessment test item 2005).doc
- 压型钢板(Pressed steel plate).doc
- 压实度试验检测(Test of compaction test).doc
- 压榨机器,Hack,设计极限强度的网络应用(Press machine, Hack, design limit strength network application).doc
- 压力容器何时进行无损检测以及无损检测方法的选择(The selection of nondestructive testing and nondestructive testing methods for pressure vessels).doc
- 压缩机培训教材(Compressor training materials).doc
- DB11 891-2020 居住建筑节能设计标准.docx
- DB11_T 1832.13-2022 建筑工程施工工艺规程 第13部分:给水与排水工程.docx
- DB11_T 1832.12-2022 建筑工程施工工艺规程 第12部分:保温工程.docx
- DB11_T 689-2025 既有建筑抗震加固技术规程.docx
- DB11_T 1832.20-2022 建筑工程施工工艺规程 第20部分:电梯系统工程.docx
- DB11 685-2013 雨水控制与利用工程设计规范.docx
- DB42_T 2272-2024 微粒化岩沥青改性沥青路面施工技术规范.docx
- DB11_T 642-2021 预拌混凝土绿色生产管理规程 清晰正式版.docx
- DB11_T 464-2023 建筑工程清水混凝土施工技术规程.docx
- DB36∕T 943.8-2021 中小型水利水电工程单元工程施工质量验收评定规程 第8部分:电气设备安装工程.docx
最近下载
- TS-0019418 汽车零部件和材料的禁用和限制物质要求Requirements on prohibited and restricted substance for automotive parts and materialsV3.0 ELV.pdf VIP
- 宗地基本信息表.PDF VIP
- 污水处理设备投标方案.doc VIP
- 三上册(第单元:万以内的加法和减法).doc VIP
- 新大象版五年级科学上册全册配套教学课件.ppt
- 视听语言10色彩的运用概要.ppt VIP
- NBT47013.2-2015承压设备无损检测第2部分:射线检测.docx VIP
- QCSTORY讲解学习课件.pptx VIP
- 农业科技创新与政策支持机制.pptx VIP
- 精神科专科护士准入理论考核试题.docx VIP
文档评论(0)