以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 计算机考研交流 』   (http://bbs.xml.org.cn/list.asp?boardid=67)
----  c  语言编程[求助]  (http://bbs.xml.org.cn/dispbbs.asp?boardid=67&rootid=&id=29940)


--  作者:hhyan
--  发布时间:4/4/2006 6:14:00 PM

--  c  语言编程[求助]
各位大师,这个问题帮我解决一下
--  作者:Logician
--  发布时间:4/4/2006 8:06:00 PM

--  
你的问题在哪儿?
--  作者:elfstone
--  发布时间:4/4/2006 8:32:00 PM

--  

楼主倒是贴问题呀。。。

PS:又是编码错误。。。汗一个!


--  作者:hhyan
--  发布时间:4/5/2006 5:44:00 PM

--  
不好意思 一时疏忽
题目:C语言编程
Image Deskew

A good OCR (Optical Character Recognition) software would rely on a good number of algorithms. One of the crucial parts is to deskew the given text before it is recognized. The input image is mostly probably from a scanner where the operator does not always ensure that the text is in the correct direction. You will need to devise an algorithm to detect the skew angle of the given image.

To be more realistic for the time frame given to work on the solution, a series of constraints are guaranteed:
Ø The original image is at least 512 pixels in width and height.
Ø Each pixel is either black or white (black for the text and white for the background).
Ø The image would contain at least 15 lines of text, in either English or Chinese. The image will have enough information in order for the skew angle to be calculated.
Ø The skew angle will be from -45 degrees to 45 degrees (inclusive).

Input Description

Standard input will contain multiple test cases. The first line of the input is a single integer T (1 <= T <= 10) which is the number of test cases. T test cases follow, each preceded by a single blank line.

The first line contains two integers separated by a single space W and H (512 <= W, H <= 1,024), which are the width and height of the input image (in pixels). The following H lines contain W / 4 characters each, which are the hex representation of the image data. The left most pixel is the most significant bit of the hex string. It is guaranteed that W will be a multiple of 4.

Output Description

Results should be directed to standard output. Start each case with “Case #:” on a single line, where # is the case number starting from 1. Two consecutive cases should be separated by a single blank line. No blank line should be produced after the last test case.

For each case, output in a line a single integer from in range of -45 to 45, which is the skew angle. Judge’s test cases are carefully designed to have integer outputs only, so you do not have to worry about rounding errors.

Sample Input

Samples (input and respective images) are included as attachments.

Sample Output

Case 1:
-45

Case 2:
45


--  作者:hhyan
--  发布时间:4/5/2006 5:44:00 PM

--  
不好意思 一时疏忽
题目:C语言编程
Image Deskew

A good OCR (Optical Character Recognition) software would rely on a good number of algorithms. One of the crucial parts is to deskew the given text before it is recognized. The input image is mostly probably from a scanner where the operator does not always ensure that the text is in the correct direction. You will need to devise an algorithm to detect the skew angle of the given image.

To be more realistic for the time frame given to work on the solution, a series of constraints are guaranteed:
&Oslash; The original image is at least 512 pixels in width and height.
&Oslash; Each pixel is either black or white (black for the text and white for the background).
&Oslash; The image would contain at least 15 lines of text, in either English or Chinese. The image will have enough information in order for the skew angle to be calculated.
&Oslash; The skew angle will be from -45 degrees to 45 degrees (inclusive).

Input Description

Standard input will contain multiple test cases. The first line of the input is a single integer T (1 <= T <= 10) which is the number of test cases. T test cases follow, each preceded by a single blank line.

The first line contains two integers separated by a single space W and H (512 <= W, H <= 1,024), which are the width and height of the input image (in pixels). The following H lines contain W / 4 characters each, which are the hex representation of the image data. The left most pixel is the most significant bit of the hex string. It is guaranteed that W will be a multiple of 4.

Output Description

Results should be directed to standard output. Start each case with “Case #:” on a single line, where # is the case number starting from 1. Two consecutive cases should be separated by a single blank line. No blank line should be produced after the last test case.

For each case, output in a line a single integer from in range of -45 to 45, which is the skew angle. Judge’s test cases are carefully designed to have integer outputs only, so you do not have to worry about rounding errors.

Sample Input

Samples (input and respective images) are included as attachments.

Sample Output

Case 1:
-45

Case 2:
45


--  作者:pkuyake
--  发布时间:4/6/2006 6:04:00 PM

--  
顶一个.但我不会做.
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
8,910.034ms