2 shunfurh shunfurh 于 2017.09.12 23:34 提问

Noise Effect

Cheap small industrial scanners can only acquire images on gray scale, which are images where the pixels have intensity values in the integer range [0..255]. A company that builds automatic vending machines wants to use these small scanners to validate the tokens used in its machines. Tokens are small square chips of metal with holes strategically pierced. Tokens with different holes are used for different values.

A scanner will produce an image of the token introduced by the client and a computer program will validate it. In the scanner image, metal appears as dark pixels (values near 0) and holes appear as light pixels (values near 255). There are two problems that must be solved in the validation process. The first problem is that, since the token is square, a client can introduce it in the machine slot in several possible ways. The second problem is due to the poor quality of the image generated by those cheap scanners, which will contain 'noise' (errors). To validate the token, the machine will compare the scanner output to a 'standard image' of the token, previously produced using a high quality scanner.

You must write a program which, given the standard image of a token and an image produced by the machine scanner, determines the confidence degree that the token introduced is a valid one. The confidence degree is the percentage of pixels in the scanner image whose intensity value differ by 100 or less from corresponding pixels in the standard image. As the token may have been introduced in several ways, we are interested in the highest possible confidence degree, considering all possible token positions.

Input

Your program should process several test cases. Each test case specifies the size of the token image and the pixel values for the standard and scanned images. The first line of a test case contains an integer L that indicates the size, in pixels, of the image (1 <= L <= 400). The next L lines will contain L integers each, representing the pixel values for the rows of the standard image. Following that, the next L lines will contain the pixel values for the rows of the scanned image.

The end of input is indicated by L = 0.

Output

For each test case your program should output a single line containing the confidence degree for the corresponding image. The confidence degree must be printed as a real number with two-digit precision, and the last decimal digit must be rounded. The input will not contain test cases where differences in rounding are significant.

Sample Input

4
250 251 249 250
251 120 245 248
248 5 190 247
5 5 180 246
0 1 240 240
250 2 250 254
244 251 255 253
230 250 250 252
3
250 250 250
150 0 150
250 2 250
253 150 253
0 2 248
251 150 250
5
255 255 255 255 255
255 0 255 0 0
255 0 0 255 255
255 255 0 255 255
255 255 255 255 0
255 0 255 255 0
255 0 255 255 255
255 255 0 0 255
255 0 0 255 255
154 154 255 255 255
0

Sample Output

93.75
100.00
92.00

1个回答

caozhy
caozhy   Ds   Rxr 2017.09.28 23:54
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
ADC and DAC Glossary
ADC and DAC Glossary Jul 22, 2002 Abstract: This document collects and defines technical terms commonly used with analog-to-digital converters (ADCs) and digital-to-analog converters (
Unity3D图像后处理特效——Noise image effect
Noise is an image postprocessing effect that can simulate both TV and VCR noise. 添加噪声是一种模拟TV和VCR噪声的图像特效。   As with the other image effects, this effect is only available in Unity Pro and you m
shader 图形学中 噪音 noise的讲解
转载自: http://blog.csdn.net/candycat1992/article/details/50346469 只贴链接,博主规定不可转载原文
Android 4.1回声消除(AcousticEchoCanceler)和噪声抑制 (NoiseSuppressor)Demo
Android4.1提供了开源项目WebRTC中噪音抑制,回声消除、静音 检测、自动增益控制模块的实现。但是Android手机中有很多不支 持这些功能,所以最好还是使用WebRTC中的C/C++代码进行编译。 本例简单测试了下噪音抑制和回声消除功能,效果还不错。
A Survey of Common-Mode Noise
Noise generators are pervasive in today’s high tech world. Knowing the characteristics and understanding the behavior of noise sources is valuable to designers and users of electronic circuits. The first part of this report defines some fundamental concepts of noise; the latter portion demonstrates the effect of the noise induced on cables of different lengths.
POJ 1296 Noise Effect 笔记
L*L的图像,给出标准图像和生成图像。求像素点的最大置信度。
【RNNoise】用深度学习抑制噪声
This demo presents the RNNoise project, showing how deep learning can be applied to noise suppression. The main idea is to combine classic signal processing with deep learning to create a real-time noise suppression algorithm that's small and fast. No expe
mel、pyton、c++ maya一个noise效果的实现的时间比较
看一本书,里面讲到脚本和api的执行效率,并举了个例子,是给一个20*20的polygon球体做noise运算,作者也奉献了python和mel的脚本,自己又用C++编译了一个command,分别测试了下,三者的运行效率很了然。 mel /* Apply noise to the supplied geometry object using the supplied max displacem
系统噪声NoiseFigure(NF)测量的实现方法
系统噪声的概要介绍,系统噪声的测量方式,公式分析等等
利用perlin noise 生成 wood texture
%%% Perlin Noise %%% Wood_texture clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); Image=imread('9.jpg'); Image=double(Image); [row,col,layer]=size(Image