2008-5-27 00:32
donno_1
窗口查询算法
正在研究多媒体信息检索,线形四叉树算法不明白啊,请教大家:
algorithm WindowQuery (window w, quadtree block b)
Mb = Morton Block representing b;
If b is totally enclosed in w then
/* get all Quadtree Blocks of database enclosed in b */
Compute Mbmax;
Perform a B-tree scannen for all Morton Blocks Mb<=M<=Mbmax;
Add Object ids corresponding to the retrieval Morton Blocks zu result set;
Else /*w overlaps b without containing it */
/*check if b is in Database*/
Perform a B-Tree scann for all Morton Blocks M=Mb;
Add Object ids corresponding to the retrieval Morton Blocks zu result set;
/*Rekursive applikations of algorithm */
Decompose b into its four children, sw, nw, se and ne;
For child in {sw, nw, se and ne} do
If child overlaps w then
WindowQuery (w, child);
End if;
End for;
End if;
End WindowQuery;
谁能给解释一下为什么Mb可以是b的Morton Block呢?b可能会被多个Morton Blocks 来表示,不会只有一个值吧?然后怎么就用Mb<=M<=Mbmax这个不等式就能得出所有数据库中所需要的Blocks 了?
还有当w覆盖b但却不完全含有b的时候,为什么要先检查b是否在数据库中?为什么要先对B树进行扫描,使得M=Mb?
哪位达人能够解释一下?最好有例子,当w完全含有b的时候是如何如何分解和扫描,当不完全含有的时候是如何分解和存储。
急啊,小女子先谢谢了! :rose: :rose: :rose:
2008-5-28 10:16
takhsis
线形四叉树算法有很多,执行方法都不一样.你给的代码信息不全(我怎么觉得这个不是代码,而是伪代码呢?),只能从中大概的判断:先把整个SPACE递归分解,直到得到足够"小"但又完全覆盖W的四叉树BLOCK.然后用这些四叉树BLOCK查B树.MONTON BLOCK是执行四叉树BLOCK的方法,一个b可能会被多个Morton Blocks 来表示,所以要找到所有的b的可能的MONTON BLOCK(这里的b是递归到最后得到的完全覆盖w的b,也就IF判断为真的情况),在B树中查这些BLOCK.程序开始执行时,当四叉树BLOCK不完全覆盖W,除了要继续递归分解四叉树BLOCK,还要检测所有执行当前四叉树BLOCK的MOTON BLOCK,以排除那些不完全包含在B树中的MONTON BLOCK.