Advertisement

OpenCV 图像分割 合并分割后的图像

阅读量:

将整幅图像分割为若干个子图像,并针对每个子图像执行局部计算操作

复制代码
    #define WIDTH 320
    #define HEIGHT 240
    #define M 2
    #define N 2
    #define SUB_WIDTH WIDTH/ M
    #define SUB_HEIGHT HEIGHT/ N
    
    //canny多窗口自适应阈值
    int main()
    {
    	Mat Src;
    	Src = imread("0.bmp",0);
    	if (!Src.data) { printf("erro"); return false; }
    	
    	//图像分块
    	vector<Mat> ceil_img;
    	vector<int> name;
    	for (int t = 0; t < M * N; t++) name.push_back(t);
    	Mat image_cut, roi_img;
    	for(int j = 0; j < N; j ++)
    	{
    		for (int i = 0; i < M; i++)
    		{
    			Rect rect(i * SUB_WIDTH, j * SUB_HEI

全部评论 (0)

还没有任何评论哟~