#include <stdlib.h>
#include "QuadTree.h"
#include <iostream>
#include <vector>
#include<malloc.h>
#include<stdio.h>
#include <string.h>
#include <queue>
#include <math.h>
using namespace std;
typedef struct structQTree QTree;
struct structQTree
{
unsigned char pixel;
bool isLeaf;
QTree *children[4];
};
/* 象限 */
enum
{
TOP_RIGHT = 0,
TOP_LEFT,
BOTTOM_LEFT,
BOTTOM_RIGHT
};
void DestroyQTree(QTree *tree)
{
if (tree != NULL)
{
for (int i = TOP_RIGHT; i <= BOTTOM_RIGHT; i++)
DestroyQTree(tree->children[i]);
free(tree);
}
}
void extractTOP_RIGHT(const unsigned char* image,char* nimage,int imageSize)
{
//0到m/2, n/2到n-1;
int m=imageSize;
int n=imageSize;
int k=0;
for(int i=0;i<=m/2-1;i++)
{
for(int j=n/2;j<=n-1;j++)
{
nimage[k++]=image[n*i+j];
}
}
}
void extrac
图像的四叉树深度优先存储
最新推荐文章于 2023-04-19 12:00:42 发布