POJ 1009 Edge Detection 解题报告 JAVA

Sobel-Edge-Detection A soble edge function using basic convolutions. CImg library is used to display, read, and write image files. 立即下载


Edge Detection
Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 14821 Accepted: 3333

Description

IONU Satellite Imaging, Inc. records and stores very large images using run length encoding. You are to write a program that reads a compressed image, finds the edges in the image, as described below, and outputs another compressed image of the detected edges. 
A simple edge detection algorithm sets an output pixel's value to be the maximum absolute value of the differences between it and all its surrounding pixels in the input image. Consider the input image below: 

The upper left pixel in the output image is the maximum of the values |15-15|,|15-100|, and |15-100|, which is 85. The pixel in the 4th row, 2nd column is computed as the maximum of |175-100|, |175-100|, |175-100|, |175-175|, |175-25|, |175-175|,|175-175|, and |175-25|, which is 150. 
Images contain 2 to 1,000,000,000 (109) pixels. All images are encoded using run length encoding (RLE). This is a sequence of pairs, containing pixel value (0-255) and run length (1-109). Input images have at most 1,000 of these pairs. Successive pairs have different pixel values. All lines in an image contain the same number of pixels. 

Input

Input consists of information for one or more images. Each image starts with the width, in pixels, of each image line. This is followed by the RLE pairs, one pair per line. A line with 0 0 indicates the end of the data for that image. An image width of 0 indicates there are no more images to process. The first image in the example input encodes the 5x7 input image above. 

Output

Output is a series of edge-detected images, in the same format as the input images, except that there may be more than 1,000 RLE pairs. 

Sample Input

7
15 4
100 15
25 2
175 2
25 5
175 2
25 5
0 0
10
35 500000000
200 500000000
0 0
3
255 1
10 1
255 2
10 1
255 2
10 1
255 1
0 0
0

Sample Output

7
85 5
0 2
85 5
75 10
150 2
75 3
0 2
150 2
0 4
0 0
10
0 499999990
165 20
0 499999990
0 0
3
245 9
0 0
0

poj的前几道题都比较简单,1009算是比较难的一道题。这道题的难点在于:1、跳跃编程(把输入数组转化成表示图像的二维数组)。2、效率优化。看见到这道题时比较没头绪,后来上网看了看一些大牛的解题报告,渐渐地有了思路。接下来我们分三步,慢慢的来解这道题。

1、暴力求解

我做任何算法题都有一个习惯,如果一开始没能想到优越解的时候我会试着用暴力循环的方式把这道题给解出来,然后再试图优化。暴力求解的过程中我们把难点一解决了。就是把通过输入数组得到某个点的值。例如:


我们想获得左边为(2,3)那个像素点的值(结果是100),我们可以计算改点离(0,0)点共相距10个,那么通过输入数据的第二列便可获得100的结果。

代码如下:

package poj1009;

import java.util.Scanner;


public class Main1 {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int m,n,cp,cpl,index,mn;//m图像像素的行数,n列数,cp输出结果的编码,cpl对应cp的出现次数,mn总共有像素点的数
		int[][] dt ;//用来装二维数组
		while(true){
			n = cin.nextInt();
			if(n==0){
				break;
			}
			System.out.println(n);
			index = 0;
			dt = new int[2][10000];
			while(true){
				dt[0][index] = cin.nextInt();
				dt[1][index] = cin.nextInt();
				if(dt[0][index]==0 && dt[1][index]==0){
					break;
				}
				index++;
			}
			mn=0;
			//把输入数组的第二列相加就能得到所有像素点的数量
			for(int i=0; i<10000;i++){
				if(dt[i][i]==0){
					break;
				}
				mn+=dt[1][i];
			}
			//获得行数
			m = mn/n;
			cp = getM(dt,0,0,m,n);//getM()方法用来获得某一像素点的编码值,名字取得不好
			cpl=0;
			
			//两层for循环,暴力求每一个(i,j)点的结果,从而得到整道题的结果
			for(int i=0; i<m; m++){
				for(int j=0; j<n; j++){
					if(getM(dt,i,j,m,n)==cp){
						cpl++;
					}else{
						System.out.println(cp + " " + cpl);
						cp = getM(dt,i,j,m,n);
						cpl=1;
					}
				}
			}
			System.out.println(cp + " " + cpl);
			System.out.println("0 0");
		}
		System.out.println("0");
		System.exit(0);
	}

	
	
	//取(x,y)点的编码结果
	public static int getM(int[][] dt, int x, int y, int m, int n) {
		int max = 0;
		for(int i=-1; i<2; i++){
			for(int j=-1; j<2; j++){
				if(i==0 && j==0){
					continue;
				}else if(x==0 && i==-1){
					continue;
				}else if(x==(m-1) && i==1){
					continue;
				}else if(y==0 && j==-1){
					continue;
				}else if(y==n-1 && j==1){
					continue;
				}else {
					if(max<Math.abs(dt[0][getPositionOfPoint(dt,x,y,n)]-dt[0][getPositionOfPoint(dt,x+i,y+j,n)])){
						max = Math.abs(dt[0][getPositionOfPoint(dt,x,y,n)]-dt[0][getPositionOfPoint(dt,x+i,y+j,n)]);
					}
				}
			}
		}
		
		return max;
	}

	//取(x,y)点映射到输入数组的位置,即dt数组中的位置,返回dt的二维下标
	private static int getPositionOfPoint(int[][] dt, int x, int y, int n) {
		int t = x*n + y + 1;
		int total = 0;
		int result = 0;
		if(total<t){
			total+=dt[0][result];
			result++;
		}
		return result-1;
	}

}


2、行内优化

通过上面的代码我们至少能够把这个问题给解出来,但它显然不能AC,因为题目的数据量太大。那么我们试着做一些优化。看下面这种情况


假如我们已经获得(2,0)点的编码结果,而且从(2,0)点到(2,2)这几点的周围9点的数值完全一样,那我们就不必去循环计算这些点,这样我们就可以把每一行里像这样的点的计算时间节省。具体代码如下:

package poj1009;

import java.util.Scanner;

import com.sun.org.apache.bcel.internal.generic.GETSTATIC;

public class Main2 {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int m, n, cp, cpl, index, mn;//m图像像素的行数,n列数,cp输出结果的编码,cpl对应cp的出现次数,mn总共有像素点的数
		int[][] dt;//用来装二维数组
		while (true) {
			n = cin.nextInt();
			if (n == 0) {
				break;
			}
			System.out.println(n);
			index = 0;
			dt = new int[2][10000];
			while (true) {
				dt[0][index] = cin.nextInt();
				dt[1][index] = cin.nextInt();
				if (dt[0][index] == 0 && dt[1][index] == 0) {
					break;
				}
				index++;
			}
			mn = 0;
			for (int i = 0; i < 10000; i++) {
				if (dt[1][i] == 0) {
					break;
				}
				mn += dt[1][i];
			}
			m = mn / n;
			cp = getM(dt, 0, 0, m, n);
			cpl = 0;
			int flag = 0;
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < n; j++) {
					if (getM(dt, i, j, m, n) == cp) {
						cpl++;
					} else {
						System.out.println(cp + " " + cpl);
						cp = getM(dt, i, j, m, n);
						cpl = 1;
					}

					if(getMinSameCnt(dt, i, j, m, n)>=3 && j+getMinSameCnt(dt, i, j, m, n)-1<n){
						if(getM(dt, i, j+1, m, n) == cp){
							cpl += getMinSameCnt(dt, i, j, m, n) - 1;
						}else {
							System.out.println(cp + " " + cpl);
							cp = getM(dt,i,j+1,m,n);
							cpl = getMinSameCnt(dt, i, j, m, n) -1;
						}
						j += getMinSameCnt(dt, i, j, m, n) - 1;
					}
				}
			}
			System.out.println(cp + " " + cpl);
			System.out.println("0 0");
		}
		System.out.println("0");
		System.exit(0);
	}

	// 取(x,y)点的编码结果
	public static int getM(int[][] dt, int x, int y, int m, int n) {
		int max = 0;
		for (int i = -1; i < 2; i++) {
			for (int j = -1; j < 2; j++) {
				if (i == 0 && j == 0) {
					continue;
				} else if (x == 0 && i == -1) {
					continue;
				} else if (x == (m - 1) && i == 1) {
					continue;
				} else if (y == 0 && j == -1) {
					continue;
				} else if (y == n - 1 && j == 1) {
					continue;
				} else {
					int a = dt[0][getPositionOfPoint(dt, x, y, n)];
					int b = dt[0][getPositionOfPoint(dt, x + i, y + j, n)];
					int temp = a - b;
					if (max < Math.abs(dt[0][getPositionOfPoint(dt, x, y, n)]
							- dt[0][getPositionOfPoint(dt, x + i, y + j, n)])) {
						max = Math
								.abs(dt[0][getPositionOfPoint(dt, x, y, n)]
										- dt[0][getPositionOfPoint(dt, x + i, y
												+ j, n)]);
					}
				}
			}
		}

		return max;
	}

	// 取(x,y)点映射到输入数组的位置,即dt数组中的位置,返回dt的二维下标
	private static int getPositionOfPoint(int[][] dt, int x, int y, int n) {
		int t = x * n + y + 1;
		int total = 0;
		int result = 0;
		while (total < t) {
			total += dt[1][result];
			result++;
		}
		return result - 1;
	}

	//或者x行在(x,y)点后值与(x,y)相等的点数
	private static int getTheSameVlaueCnt(int[][] dt, int x, int y, int n) {
		int t = x * n + y + 1;
		int total = 0;
		int temp = 0;
		while (t > total) {
			total += dt[1][temp];
			temp++;
		}
		return total - t;
	}
	
	
	//返回x行 x-1行 x+1行 三行里在各自行后面重复出现元素最小数量
	private static int getMinSameCnt(int[][] dt, int x, int y, int m, int n) {
		if (m == 1) {
			return getTheSameVlaueCnt(dt, x, y, n);
		} else if (m == 2 || x == 0) {
			return getMin(getTheSameVlaueCnt(dt, 0, y, n),
					getTheSameVlaueCnt(dt, 1, y, n));
		} else if (x == m - 1) {
			return getMin(getTheSameVlaueCnt(dt, m - 1, y, n),
					getTheSameVlaueCnt(dt, x - 2, y, n));
		} else {
			return getMin(
					getMin(getTheSameVlaueCnt(dt, x, y, n),
							getTheSameVlaueCnt(dt, x - 1, y, n)),
					getMin(getTheSameVlaueCnt(dt, x, y, n),
							getTheSameVlaueCnt(dt, x + 1, y, n)));
		}
	}

	private static int getMin(int a, int b) {
		if (a < b) {
			return a;
		}
		return b;
	}

}

3、行间优化

上面一段代码在行内做了优化,但是像下面这样的场景我们还可以在行之间做优化

     1010
10101010101010
10101010101010
10101010101010
10101010101010

假设我们求得了红色格的值,根据题目要求第三行和第四行的编码值应该都为0,这样就又节省了两行的计算时间。具体代码如下:

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner cin = new Scanner(new BufferedReader(new InputStreamReader(
				System.in)));
		int m, n, cp, cpl, index, mn;
		int[][] dt;
		while (true) {
			n = cin.nextInt();
			if (n == 0) {
				break;
			}
			System.out.println(n);
			index = 0;
			dt = new int[2][10000];
			while (true) {
				dt[0][index] = cin.nextInt();
				dt[1][index] = cin.nextInt();
				if (dt[0][index] == 0 && dt[1][index] == 0) {
					break;
				}
				index++;
			}
			mn = 0;
			for (int i = 0; i < 10000; i++) {
				if (dt[1][i] == 0) {
					break;
				}
				mn += dt[1][i];
			}
			m = mn / n;
			cp = getM(dt, 0, 0, m, n);
			cpl = 0;
			int flag = 0;
			for (int i = 0; i < m; i++) {
				if (dt[1][getPositionOfPoint(dt, i, 0, n)] - flag > 2 * n
						&& flag >= n) {
					int t = dt[1][getPositionOfPoint(dt, i, 0, n)] - flag
							- (dt[1][getPositionOfPoint(dt, i, 0, n)] - flag)
							% n - n;
					if(cp == 0){
						cpl += t;
					}else {
						System.out.println(cp + " " + cpl);
						cp = 0;
						cpl = t;
					}
					flag += t;
					i = i + t/n;
				}
				for (int j = 0; j < n; j++) {
					if (getM(dt, i, j, m, n) == cp) {
						cpl++;
					} else {
						System.out.println(cp + " " + cpl);
						cp = getM(dt, i, j, m, n);
						cpl = 1;
					}
					flag++;
					if (flag >= dt[1][getPositionOfPoint(dt, i, j, n)]) {
						flag = 0;
					}
					if (getMinSameCnt(dt, i, j, m, n) >= 3
							&& j + getMinSameCnt(dt, i, j, m, n) - 1 < n) {
						if (getM(dt, i, j+1, m, n) == cp) {
							cpl += getMinSameCnt(dt, i, j, m, n) - 1;
						} else {
							System.out.println(cp + " " + cpl);
							cp = getM(dt, i, j+1, m, n);
							cpl = getMinSameCnt(dt, i, j, m, n) - 1;
						}
						flag += getMinSameCnt(dt, i, j, m, n) - 1;
						j += getMinSameCnt(dt, i, j, m, n) - 1;
					}
				}
			}
			System.out.println(cp + " " + cpl);
			System.out.println("0 0");
		}
		System.out.println(0);
	}

	// 取(x,y)点的编码结果
	public static int getM(int[][] dt, int x, int y, int m, int n) {
		int max = 0;
		for (int i = -1; i < 2; i++) {
			for (int j = -1; j < 2; j++) {
				if (i == 0 && j == 0) {
					continue;
				} else if (x == 0 && i == -1) {
					continue;
				} else if (x == (m - 1) && i == 1) {
					continue;
				} else if (y == 0 && j == -1) {
					continue;
				} else if (y == n - 1 && j == 1) {
					continue;
				} else {
					int a = dt[0][getPositionOfPoint(dt, x, y, n)];
					int b = dt[0][getPositionOfPoint(dt, x + i, y + j, n)];
					int temp = a - b;
					if (max < Math.abs(dt[0][getPositionOfPoint(dt, x, y, n)]
							- dt[0][getPositionOfPoint(dt, x + i, y + j, n)])) {
						max = Math
								.abs(dt[0][getPositionOfPoint(dt, x, y, n)]
										- dt[0][getPositionOfPoint(dt, x + i, y
												+ j, n)]);
					}
				}
			}
		}

		return max;
	}
	

	// 取(x,y)点映射到输入数组的位置,即dt数组中的位置,返回dt的二维下标
	private static int getPositionOfPoint(int[][] dt, int x, int y, int n) {
		int t = x * n + y + 1;
		int total = 0;
		int result = 0;
		while (total < t) {
			total += dt[1][result];
			result++;
		}
		return result - 1;
		
	}

	private static int getTheSameVlaueCnt(int[][] dt, int x, int y, int n) {
		int t = x * n + y + 1;
		int total = 0;
		int temp = 0;
		while (t > total) {
			total += dt[1][temp];
			temp++;
		}
		return total - t;
	}

	// 返回x行 x-1行 x+1行 三行里在各自行后面重复出现元素最小数量
	/**
	 * 
	 */
	private static int getMinSameCnt(int[][] dt, int x, int y, int m, int n) {
		if (m == 1) {
			return getTheSameVlaueCnt(dt, x, y, n);
		} else if (m == 2 || x == 0) {
			return getMin(getTheSameVlaueCnt(dt, 0, y, n),
					getTheSameVlaueCnt(dt, 1, y, n));
		} else if (x == m - 1) {
			return getMin(getTheSameVlaueCnt(dt, m - 1, y, n),
					getTheSameVlaueCnt(dt, m - 2, y, n));
		} else {
			return getMin(
					getMin(getTheSameVlaueCnt(dt, x, y, n),
							getTheSameVlaueCnt(dt, x - 1, y, n)),
					getMin(getTheSameVlaueCnt(dt, x, y, n),
							getTheSameVlaueCnt(dt, x + 1, y, n)));
		}
	}

	private static int getMin(int a, int b) {
		if (a < b) {
			return a;
		}
		return b;
	}
	
	

}

总结:经过两次优化,最后的代码可以AC了。不过虽然能AC,在很多细节上还可以进一步优化。





EdgeDetectionUsingACOA:使用蚁群优化算法(Java)的图像边缘检测 使用ACOA进行边缘检测 使用蚁群优化算法(Java)的图像边缘检测 立即下载

相关推荐

poj1009 Edge Detection 可以直接AC的

poj1009 Edge Detection 可以直接AC的

POJ 1009 Edge Detection(模拟)

Edge Detection Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 17586   Accepted: 4020 Description IONU Satellite Imaging, Inc. records and stores very larg

风尘_浪子 1072

从零搭建ROS1导航小车(一):松灵SCOUT Mini底盘通讯配置与ROS包编译避坑指南

本文详细介绍了从零开始搭建ROS1导航小车的初始步骤,重点讲解松灵SCOUT Mini底盘的通讯配置与ROS包编译避坑指南。内容包括硬件连接、CAN通讯配置、ROS工作空间构建及编译优化等实用技巧,帮助开发者快速实现自主导航小车的通讯功能。

weixin_27014595的博客 196

北大oj1009——Edge Detection

Edge Detection | Time Limit: 1000MS | | Memory Limit: 10000K | Description IONU Satellite Imaging, Inc. records and stores very large images using run length encoding. You are to write a program tha...

m0_37609239的博客 301

springboot 启动方式 装配流程 自定义starter 文件加载顺序 常见设计模式

springboot 启动方式 装配流程 自定义starter 文件加载顺序 常见设计模式

sv 944

ABAP CDS HAVING 全解析:聚合之后的精准过滤、最佳实践与可运行示例

摘要: 本文针对具备ABAP与CDS基础的开发者,详解HAVING在ABAP CDS中的核心用法。HAVING专用于过滤GROUP BY后的聚合结果(如SUM、COUNT),与WHERE的分工明确:前者处理聚合值,后者过滤原始记录。通过销售额阈值、质量分析、财务对账三类典型场景,结合性能优化建议(如优先使用WHERE索引过滤),说明实际应用。文中提供经典CDS View与View Entity两种实现代码,并附Open SQL消费示例,帮助开发者快速落地。常见误区(如聚合条件误写至WHERE)与规避方法亦被

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 230

北大ACM 1009题—Edge Detection

Edge Detection Time Limit:1000MS Memory Limit:10000K Total Submissions:15307 Accepted:3445 Description IONU Satellite Imaging, Inc. records and stores very larg...

weixin_30258901的博客 258

6、Cocos2D游戏开发:精灵添加与角色实现

本文详细介绍了在Cocos2D游戏开发中如何添加背景精灵和玩家角色精灵。通过创建GameScene场景、组织项目资源、使用多分辨率图像适配不同设备,并深入讲解了将角色拆分为上下半身以实现更真实瞄准效果的原理。文章还解析了Cocos2D的图像搜索机制、锚点概念及其应用,以及如何通过父子节点关系管理复合角色。最终实现了猎人角色在场景中的正确显示与定位,为后续动画和交互功能打下基础。

e3f4g5的博客 104

POJ1009解题报告

题目: Edge Detection Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 12340   Accepted: 2694 Description IONU Satellite Imaging, Inc. records and stores very lar

卧龙居 2686

【STM32项目】基于STM32设计的震动马达超声波电机高频震动——高级定时器PWM互补输出带死区控制__资料编号3

实现高级定时器互补输出带死区控制,实现震动/超声波电机/马达,高频震动。使用 STM32F103 芯片输出两路互补 PWM,并带有死区和刹车控制功能。定时器 1 通道 1 及其互补通道输出PWM,且带死区控。当定时器 1 的刹车输入引脚被拉高时,产生刹车时间,即定时器 8 停止输出 PWM。当刹车输入引脚被拉高时,通道 1 和通道 2 将从有波形输入状态转换成无效电平状态。

嵌入式阿齐Archie 6748

自然语言处理NLP星空智能对话机器人系列:Gavin大咖 Transformer 101问答集 第一问

自然语言处理NLP星空智能对话机器人系列:Transformer 101问答 [让天下没有难学的Transformer] 你问我答系列之一 Gavin大咖第一问: Transformer中的可训练Queries、Keys和Values矩阵从哪儿来? 以上是智华解答,供同学们参考。 星空智能对话机器人系列博客 NLP星空智能对话机器人系列:第二次星空智能对话机器人Zoom线上演示安排 NLP星空智能对话机器人系列:StarSpace: Embed All The Things NLP星空智能对

大模型与Agent智能体 998

ACM —— 1009 Edge Detection

解题代码: import java.util.Arrays; import java.util.HashMap; import java.util.Scanner; public class Main { static int mWidth, mHight; static int[][] pairs = new int[1000][2]; static HashMap

WYYZ5的专栏 1062

基于R-CNN深度学习的生活垃圾检测与分类系统:数据集、模型和UI界面的完整实现

我们将使用一个公开的垃圾分类数据集来训练我们的模型。一个常见的数据集是TACO数据集(Trash Annotations in Context),该数据集包含多种垃圾类别,适用于垃圾分类任务。TACO数据集中的图像标注了垃圾的类别以及其在图像中的位置,适合用于目标检测任务。图片数据:每张图片中包含不同种类的垃圾。标签文件:每个图像有相应的标签文件,标注了图像中垃圾的类别、位置(通常为边界框坐标)等信息。dataset/images/image1.jpgimage2.jpg......其中,

YOLO 1107

poj 1009 java_POJ 1009 Edge Detection 解题报告 JAVA

Edge DetectionTime Limit:1000MSMemory Limit:10000KTotal Submissions:14821Accepted:3333DescriptionIONU Satellite Imaging, Inc. records and stores very large images using run length encoding. You ar...

weixin_33724759的博客 206

qcc514x-qcc304x调试笔记

qcc514x-qcc304x调试笔记-1-QCC514x系列 qcc514x-qcc304x调试笔记-2-开发环境搭建 qcc514x-qcc304x调试笔记-3-如何修改蓝牙名称 qcc514x-qcc304x调试笔记-4-如何修改蓝牙地址 qcc514x-qcc304x调试笔记-5-如何区分左右耳 qcc514x-qcc304x调试笔记-6-PIO相关操作 ...

leezs的博客 1247

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

POJ 1009 Edge Detection(一)

花了一晚上的时间才弄出来的程序居然 OutOfMemery 了,悲催。 应该是想法错了,此题不应该全局遍历的,耗时且对大数据量来说又不实际。 在问题的讨论区有人提到了一种思路,当添加一个数时会影响八个数。那么使用添加做驱动不断的修正数值是否会好些呢,又或者有其他的规律我没看到。今天就先到这,明天继续,灭了这题。 下面是今晚的成果,可惜是 WA 的: import java.util....

翔之骓 158

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

POJ_1009_EdgeDetection分析

题目是对RLE压缩的图像进行边缘检测。 RLE是游程编码的意思(Run length edcoding),比如555555根据游程编码可以编码成5 6。在代码中可以用控制符来区分编码字节和重复次数。 题目大意如下: 输入一张或多张游程编码的压缩图片,输出该图片的边缘检测的图片。其中,输入时0表示没有下一张图片,0 0表示本张图片输入结束。   算法思路: 1)输入的为RLE压缩图像,需...

domore 264

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

POJ1009-Edge Detection

全解题报告索引目录 -> 【北大ACM – POJ试题分类】 转载请注明出处:http://exp-blog.com ------------------------------------------------------------------------- 大致题意: 某种卫星使用一种叫做“run length encoding”的方式来储存大尺寸图片, 有一种...

ζёСяêτ - 小優YoU 1万+

POJ 1009 Edge Detection解题报告

解决该题的核心思想是:只计算包括变化点的9个点的值。设输入图像为(v0, r0), (v1, r1), ..., (vn, rn), 那么变化点为v0, v1, ..., vn。这些点的值计算出来后,后面的输出就好说。但这样的计算还是不够的,我只是找出了以下3种特殊情况,处理后就ACCEPTED了,但是我无法论证处理这几种特殊情况是结果正确的充分条件。希望有高手能论证吧。 特殊情况1和2,图中红

lzshlzsh的专栏 3516

边缘检测 (Edge-Detection) 论文、代码大汇总

边缘检测/边缘提取 论文、代码的大汇总。 Github上持续更新:https://github.com/MarkMoHR/Awesome-Edge-Detection-Papers 目录 基于深度学习的方法 一般的边缘检测 物体轮廓提取 语义边缘检测 (包含分类) 遮挡边缘检测 根据多帧进行边缘检测 传统方法 1. 基于深度学习的方法 1.1 一般的边缘检测 方法简称 论文 ...

MokHoYin的博客 3万+

poj1009 -- Edge Detection

Edge Detection Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 21730   Accepted: 5099 Description IONU Satellite Imaging, Inc. records and stores very larg

BestFSQ的博客 934

POJ 1009

Edge Detection Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 18826   Accepted: 4359 Description IONU Satellite Imaging, Inc. records and stores very large

bear_huangzhen的专栏 1726

[POJ][1009]Edge Detection

Description IONU Satellite Imaging, Inc. records and stores very large images using run length encoding. You are to write a program that reads a compressed image, finds the edges in the image, as d

软件工程学森 2796

贪心算法专题(1)--HDU1009

题目大意:fatmouse需要用自己手中的猫粮去跟猫交易javabean-就是咖啡豆,共有n个房间,每个房间与一只猫,第 i 个房间里面,fatmouse可以支付 F[i] 磅的猫粮去交换得到 J[i] 磅的javabean,注意的是:fatmouse 可以不遍历所有房间,也不用一次性在某一房间交易所有该房间猫所需的猫粮,支付了多少就能够按照比例得到多少,所以当然是优先选择性价比比较高的房间。

Kerwun的博客 886

POJ 1009 Edge Detection

Edge Detection Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 20798 Accepted: 4897 DescriptionIONU Satellite Imaging, Inc. records and stores very large images using run leng

sun%moon 486
tracy_junzi
博客等级 码龄16年 2粉丝 1原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值