CN1464744A - Method for automatic discriminating scanning compression ratio of scanner - Google Patents
Method for automatic discriminating scanning compression ratio of scanner Download PDFInfo
- Publication number
- CN1464744A CN1464744A CN 02124773 CN02124773A CN1464744A CN 1464744 A CN1464744 A CN 1464744A CN 02124773 CN02124773 CN 02124773 CN 02124773 A CN02124773 A CN 02124773A CN 1464744 A CN1464744 A CN 1464744A
- Authority
- CN
- China
- Prior art keywords
- pixels
- difference
- pixel
- standard value
- respect
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000007906 compression Methods 0.000 title claims abstract description 44
- 230000006835 compression Effects 0.000 title claims abstract description 43
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000005540 biological transmission Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 239000000463 material Substances 0.000 description 3
- 239000003086 colorant Substances 0.000 description 2
- 238000012850 discrimination method Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- YOBAEOGBNPPUQV-UHFFFAOYSA-N iron;trihydrate Chemical compound O.O.O.[Fe].[Fe] YOBAEOGBNPPUQV-UHFFFAOYSA-N 0.000 description 1
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本发明涉及一种扫描压缩比的判别方法,特别是一种扫描仪扫描压缩比自动判别的方法,本发明首先分析预扫完成所获得的影像资料,将此影像资料划分为数个区域,每一区域内相邻像素的图素值较为接近,接下来由每一区域相邻像素的图素值的差值决定每一区域的扫描压缩比,并决定每一区域的一标准值,最后将此每一区域的标准值完整地存入缓冲储存器(buffer)中,并将此每区域的标准值与该区域的各图素的差值存入缓冲储存器中,并指定一区域存放每相对应区块有无压缩的信息,以判别区块内的资料是否经过压缩。
The present invention relates to a method for judging the scanning compression ratio, in particular to a method for automatically judging the scanning compression ratio of a scanner. The present invention firstly analyzes the image data obtained after pre-scanning, and divides the image data into several regions, each The pixel values of adjacent pixels in the area are relatively close. Next, the scan compression ratio of each area is determined by the difference between the pixel values of adjacent pixels in each area, and a standard value for each area is determined. Finally, the The standard value of each area is completely stored in the buffer memory (buffer), and the difference between the standard value of each area and each pixel in this area is stored in the buffer memory, and an area is designated to store each phase Information about whether the corresponding block has compression is used to determine whether the data in the block is compressed.
Description
技术领域technical field
本发明涉及一种扫描压缩比的判别方法,特别是一种扫描仪扫描压缩比自动判别的方法,以减少资料量及数据传输的次数,并改善扫描的速度。The invention relates to a method for judging the scanning compression ratio, in particular to a method for automatically judging the scanning compression ratio of a scanner, so as to reduce the amount of data and the times of data transmission, and improve the scanning speed.
背景技术Background technique
对现今的信息使用者,尤其是个人计算机使用者而言,所接触计算机信息的模式已由较为单调的文字模式而进入到所谓的多媒体(Multi-Media)的时代,而多媒体意味着资料包含文字、影像、声音等内容,而为了使资料能以多媒体的形式呈现在观众的面前,现今已发展出多种可检索影像或是声音等的多媒体装置。因为多媒体资料包含较多的内容,因此处理多媒体资料所需要的内存的容量需较处理单调的文字模式为高,以使多媒体资料以更为顺畅的模式呈现出来。For today's information users, especially personal computer users, the mode of contacting computer information has entered the era of so-called multimedia (Multi-Media) from the relatively monotonous text mode, and multimedia means that the information includes text , video, audio and other content, and in order to present the data in front of the audience in the form of multimedia, a variety of multimedia devices that can retrieve video or audio have been developed. Because the multimedia data contains more content, the capacity of the memory required to process the multimedia data needs to be higher than the monotonous text mode, so that the multimedia data can be presented in a smoother mode.
对影像输入装置而言,扫描仪(scanner)与数字相机(digital camera)为目前较为常见的装置。数字照相机是利用数字化的信息来储存所拍摄得的影像,它利用一个可记录影像的磁盘片或是个人计算机内存卡国际协会(Personal Computer Memory Card International Association;PCMCIA)的内存卡,来储存静态影像。为了节省储存媒体所使用的记忆空间,通常数字相机所拍摄的影像都是以压缩档案来储存,常见的有静态影像压缩标准(Joint Photographic Experts Group;JPEG)档案格式。For image input devices, scanners and digital cameras are relatively common devices at present. A digital camera uses digital information to store captured images. It uses a disk that can record images or a memory card from the Personal Computer Memory Card International Association (PCMCIA) to store still images. . In order to save the memory space used by the storage media, the images captured by digital cameras are usually stored in compressed files, and the common one is the still image compression standard (Joint Photographic Experts Group; JPEG) file format.
而就扫描仪使用的种类而言,通常扫描仪可分为掌上型扫描仪(handly scanner)及桌上型扫描仪(desktop scanner或flat bed scanner)和馈纸式扫描仪(sheet-feed scanner)三种。扫描的清晰度是以每英时的点数(dot per inch;dpi)为单位,dpi越高的机器其品质越高,但是扫描时间也较长。在扫描彩色影像时,许多扫描仪必须要将RGB三原色分开扫描,因此扫描动作要重复三次,也使得扫描所花的时间加长。As far as the types of scanners are used, scanners can usually be divided into handy scanners, desktop scanners or flat bed scanners, and sheet-feed scanners. three kinds. The resolution of scanning is in dots per inch (dpi). The higher the dpi, the higher the quality of the machine, but the scanning time is also longer. When scanning color images, many scanners must scan the RGB three primary colors separately, so the scanning action has to be repeated three times, which also makes the scanning time longer.
桌上型扫描仪为一种较常用的扫描仪,其用以将一些待扫描文件,如穿透式文件(如投影片)或反射式文件(如照片或纸张)等经由扫描程序而转换成数字资料。一般而言,桌上型扫描仪所用的光电感应模块主要包括一光电感应组件,此光电感应组件可为:电荷耦合组件(charge coupled device;CCD)或是接触影像感应组件(contact imagesensor;CIS)。桌上型扫描仪用以将放置于玻璃平台上的待扫描文稿经扫描过程而转换成数字资料而输入至个人计算机内,以供进一步利用。A desktop scanner is a more commonly used scanner, which is used to convert some documents to be scanned, such as transmissive documents (such as transparencies) or reflective documents (such as photos or paper) into digital data. Generally speaking, the photoelectric sensor module used in desktop scanners mainly includes a photoelectric sensor component, which can be: a charge coupled device (CCD) or a contact image sensor (CIS). . The desktop scanner is used to convert the documents placed on the glass platform into digital data through the scanning process and input them into the personal computer for further use.
在扫描的过程中,待扫描影像将光源所发出的光给予反射或透射,此反射光或是透射光由光电感应模块所接收。之后,再经控制电路而连接至主机,比如个人计算机,而经由个人计算机进行影像处理。During the scanning process, the image to be scanned reflects or transmits the light emitted by the light source, and the reflected light or transmitted light is received by the photoelectric sensor module. After that, it is connected to a host, such as a personal computer, through a control circuit, and the image processing is performed through the personal computer.
如所知一般,将光的三原色-红色(R)、蓝色(B)及绿色(G)依不同比率组合可得到各种有色光。反过来说,各种有色光可视为R、G及B的组合。下面,各种以色光内所包含的R、G及B的成分简称为红(R)资料、绿(G)资料以及蓝(B)资料。As is generally known, various colored lights can be obtained by combining the three primary colors of light—red (R), blue (B) and green (G)—in different ratios. Conversely, various colored light can be regarded as a combination of R, G and B. Hereinafter, the components of R, G, and B included in various colored lights are simply referred to as red (R) materials, green (G) materials, and blue (B) materials.
在扫描的过程中,光电感应模块先检索待扫描影像资料某列中每一图素的R资料、G资料及B资料,并产生相对应的模拟信号。再将这些模拟信号送给模拟-数字信号转换器(analog-digital converter),以产生数字资料供下一单元处理。接着光电感应模块检索待扫描影像下一列中的R资料、G资料及B资料,作类似的动作。在此过程中,依其扫描、处理资料方式的不同而可约略分为两种类型:单频道扫描(one-channel scanning)及三频道扫描(three-channel scanning)。During the scanning process, the photoelectric sensing module first retrieves the R data, G data and B data of each pixel in a row of the image data to be scanned, and generates corresponding analog signals. These analog signals are then sent to an analog-digital converter to generate digital data for processing by the next unit. Then the photoelectric sensing module retrieves the R data, G data and B data in the next column of the image to be scanned, and performs similar actions. In this process, according to the different ways of scanning and processing data, it can be roughly divided into two types: one-channel scanning and three-channel scanning.
参照图1A与图1B所示,此两图为传统技术在送出影像资料的示意图。图1A绘示传统技术如何选择R、G与B的扫描起使位置以及扫描区域。在图1A中,每一方格均代表待扫描区域上的一个图素的一种颜色资料,而图素中的数字则代表此图素在待扫描区域上的位置。在本发明说明书中,图素的影像资料-图素值以符号P(x,y)表示的,其中x代表列坐标,而y则代表行坐标。例如:P(2n-1,1)即代表第2n-1(n为自然数)列中的第一个图素的图素值。Referring to FIG. 1A and FIG. 1B , these two figures are schematic diagrams of sending image data in conventional technology. FIG. 1A shows how to select the scanning starting positions and scanning areas of R, G and B in the conventional technology. In FIG. 1A , each grid represents a color data of a pixel on the area to be scanned, and the number in the pixel represents the position of the pixel on the area to be scanned. In the description of the present invention, the image data of a pixel-the pixel value is represented by the symbol P(x, y), wherein x represents a column coordinate, and y represents a row coordinate. For example: P(2n-1, 1) represents the pixel value of the first pixel in the 2n-1 (n is a natural number) column.
在传统技术中,在扫描第2n-1列时,R、G与B的扫描起使位置皆在待扫描区域的第一个图素,且其扫描区域为一完整的一列。也就是其分辨率为完整。In the conventional technology, when scanning the 2n-1th column, the scanning start positions of R, G, and B are all located at the first pixel of the area to be scanned, and the scanning area is a complete column. That is, its resolution is full.
而图1B绘示对应于各个图素所产生相对应的R、G与B资料的情形。在图1B中,R(x,y)、G(x,y)与B(x,y)分别代表图素值P(x,y)所包括的颜色资料。倘若每个图素的R、G与B资料均分别以8位(bit)表示,则每个图素所产生的资料量为3*8=24位。And FIG. 1B shows the corresponding R, G and B data generated corresponding to each pixel. In FIG. 1B , R(x, y), G(x, y) and B(x, y) respectively represent the color data included in the pixel value P(x, y). If the R, G, and B data of each pixel are represented by 8 bits, the amount of data generated by each pixel is 3*8=24 bits.
由图1A与图1B可看出,传统扫描仪在传送影像资料至个人计算机时,把每个图素的R、G与B资料全部传送出去。而所要传出的资料会先储存在扫描仪上的缓冲储存器(buffer)上,当缓冲储存器到达其储存的上限时或是缓冲储存器收到一扫描终止信号时,缓冲储存器将会将其内所储存的资料传送至主机上进行处理。一般来说,图素所占的内存空间是相当大的,因此若未经处理就将每个图素的R、G与B资料通通储存在缓冲储存器上,缓冲储存器将会常常达到其资料储存的上限而必须将其内部所储存的数据传输出去。当资料量较大时,缓冲储存器满载的情况也较多,传输资料的次数也随的增加,因此扫描的速度将会减缓,并会缩短缓冲储存器的寿命。It can be seen from FIG. 1A and FIG. 1B that when a conventional scanner transmits image data to a personal computer, all R, G and B data of each pixel are sent out. The data to be transmitted will first be stored in the buffer memory (buffer) on the scanner. When the buffer memory reaches the upper limit of its storage or the buffer memory receives a scan termination signal, the buffer memory will Send the data stored in it to the host for processing. Generally speaking, the memory space occupied by pixels is quite large, so if the R, G, and B data of each pixel are all stored in the buffer memory without processing, the buffer memory will often reach its limit. The upper limit of data storage and the data stored in it must be transmitted out. When the amount of data is large, the buffer memory will be full, and the number of data transmissions will also increase accordingly, so the scanning speed will slow down and the life of the buffer memory will be shortened.
传统的扫描装置的速度的瓶颈,经常发生在扫描装置将资料往主机传送时,因资料量过大而导致资料必须分批传输至主机而降低扫描的速度。因此为了加快扫描速度,减少往主机传的资料量将是最有效的方式。The bottleneck of the speed of the traditional scanning device often occurs when the scanning device transmits data to the host. Due to the large amount of data, the data must be transmitted to the host in batches and the scanning speed is reduced. Therefore, in order to speed up the scanning speed, reducing the amount of data transmitted to the host will be the most effective way.
发明内容Contents of the invention
本发明的主要目的在于克服现有技术的不足与缺陷,提供一种方法,利用扫描仪扫描压缩比自动判别方法将影像资料先行压缩,以减少所需传输的资料量。The main purpose of the present invention is to overcome the deficiencies and defects of the prior art, and provide a method to compress the image data in advance by using the scanning compression ratio automatic judgment method of the scanner to reduce the amount of data to be transmitted.
本发明的第二个目的为利用扫描仪扫描压缩比自动判别方法将影像资料先行压缩,以减少资料由缓冲存储器传输至主机的次数。The second object of the present invention is to compress the image data in advance by using the automatic determination method of the scanning compression ratio of the scanner, so as to reduce the number of data transmission from the buffer memory to the host computer.
本发明的第三个目的为利用扫描仪扫描压缩比自动判别方法将影像资料先行压缩,以加速扫描的速度。The third object of the present invention is to compress the image data in advance by using the automatic determination method of the scanning compression ratio of the scanner to speed up the scanning speed.
本发明的第四个目的为利用扫描仪扫描压缩比自动判别方法将影像资料先行压缩,以减少缓冲存储器满载的次数。The fourth object of the present invention is to compress the image data in advance by using the automatic determination method of the scanning compression ratio of the scanner, so as to reduce the number of times when the buffer memory is full.
本发明的再一个目的为利用扫描仪扫描压缩比自动判别方法将影像资料先行压缩,以延长缓冲记忆的使用寿命。Another object of the present invention is to compress the image data in advance by using the automatic determination method of the scanning compression ratio of the scanner, so as to prolong the service life of the buffer memory.
根据以上所述的目的,本发明提供了一种方法,利用扫描仪扫描压缩比自动判别方法将影像资料先行压缩,以减少资料量。本发明首先分析预扫完成所获得的影像资料,将此影像资料划分为数个区域,每一区域内相邻像素的图素值较为接近。接下来由每一区域相邻像素的图素值的差值决定每一区域的扫描压缩比,并决定每一区域的一标准值。此标准值可为该区域所有像素的图素值的平均值,或是该区域所有像素的最小图素值。最后将此每区域的标准值完整地存入缓冲储存器(buffer)中,并将此每区域的标准值与该区域的各图素的差值存入缓冲储存器中,并指定一区域存放每相对应区块有无压缩的信息,据以判别区块内的资料是否经过压缩。According to the above-mentioned purpose, the present invention provides a method for compressing the image data in advance by using the automatic identification method of the scanning compression ratio of the scanner to reduce the amount of data. The present invention firstly analyzes the image data obtained after pre-scanning, and divides the image data into several areas, and the pixel values of adjacent pixels in each area are relatively close. Next, the scan compression ratio of each area is determined according to the pixel value difference of adjacent pixels in each area, and a standard value for each area is determined. The standard value can be the average pixel value of all pixels in the area, or the minimum pixel value of all pixels in the area. Finally, the standard value of each area is completely stored in the buffer memory (buffer), and the difference between the standard value of each area and each pixel in the area is stored in the buffer memory, and an area is designated for storage Whether each corresponding block has compressed information is used to determine whether the data in the block is compressed.
为达上述目的,本发明提供一种扫描压缩比自动判别的方法,包含:预扫一文件或一图案以获得一影像资料,该影像资料包含一第一像素、一第二像素及一第三像素,该第二像素相邻于该第一像素与该第三像素;分析该第一像素相对于该第二像素的一第一差值与该第二像素相对于该第三像素的一第二差值并得到一标准值;完整储存该标准值于一内存内;储存该第一像素相对于该标准值的一第三差值、该第二像素相对于该标准值的一第四差值与该第三像素相对于该标准值的一第五差值于该内存内;传输该内存内的一资料至一主机上;及组合该资料为该影像资料。In order to achieve the above object, the present invention provides a method for automatically judging the scanning compression ratio, comprising: pre-scanning a document or a pattern to obtain an image data, the image data includes a first pixel, a second pixel and a third pixel pixel, the second pixel is adjacent to the first pixel and the third pixel; analyzing a first difference between the first pixel and the second pixel and a first difference between the second pixel and the third pixel Two difference values and obtain a standard value; completely store the standard value in a memory; store a third difference value of the first pixel relative to the standard value, a fourth difference of the second pixel relative to the standard value value and a fifth difference between the third pixel and the standard value in the memory; transmit a data in the memory to a host; and combine the data into the image data.
所述的标准值可以为该第一像素、该第二像素与该第三像素的一平均值。The standard value may be an average value of the first pixel, the second pixel and the third pixel.
所述的标准值也可以为该第一像素、该第二像素与该第三像素的最小值。The standard value may also be the minimum value of the first pixel, the second pixel and the third pixel.
本发明还提供一种扫描压缩比自动判别的方法,包含:预扫一文件或一图案以获得一影像资料,该影像资料包含多个第一图素、多个第二图素、多个第三图素、多个第四图素、多个第五图素与多个第六图素,该多个第一图素相邻于该多个第二图素,该多个第二图素相邻于该多个第三图素,该多个第三图素相邻于该多个第四图素,该多个第四图素相邻于该多个第五图素,该多个第五图素相邻于该多个第六图素;分析该多个第一图素相对于该多个第二图素的多个第一差值、该多个第二图素相对于该多个第三图素的多个第二差值、该多个第三图素相对于该多个第四图素的多个第三差值、该多个第四图素相对于该多个第五图素的多个第四差值与该多个第五图素相对于该多个第六图素的多个第五差值的大小,若第一差值相对于第二差值值的一差异较小,第四差值相对于第五差值的一差异较小,第三差值相对于第二差值与第四差值的一差异较大,则将该影像资料分割为一第一区块与一第二区块并在该第一区块与第二区块内取一第一标准值与一第二标准值,该第一区块包含该多个第一图素、该多个第二图素与该多个第三图素,该第二区块包含该多个第四图素、该多个第五图素与该多个第六图素;完整储存该第一标准值与该第二标准值于一内存内;储存该多个第一图素相对于该第一标准值的一第六差值、该多个第二图素相对于该第一标准值的一第七差值与该多个第三图素相对于该第一标准值的一第八差值于该内存内,并储存该多个第四图素相对于该第二标准值的一第九差值、该多个第五图素相对于该第二标准值的一第十差值与该多个第六图素相对于该第二标准值的一第十一差值于该内存内;传输该内存内的一资料至一主机上;及组合该资料为该影像资料。The present invention also provides a method for automatically judging the scanning compression ratio, which includes: pre-scanning a file or a pattern to obtain an image data, the image data includes a plurality of first pixels, a plurality of second pixels, a plurality of second pixels Three pixels, a plurality of fourth pixels, a plurality of fifth pixels and a plurality of sixth pixels, the plurality of first pixels are adjacent to the plurality of second pixels, the plurality of second pixels adjacent to the plurality of third pixels, the plurality of third pixels adjacent to the plurality of fourth pixels, the plurality of fourth pixels adjacent to the plurality of fifth pixels, the plurality of The fifth pixel is adjacent to the plurality of sixth pixels; analyzing the plurality of first difference values of the plurality of first pixels relative to the plurality of second pixels, the plurality of second pixels relative to the plurality of A plurality of second difference values of the plurality of third pixels, a plurality of third difference values of the plurality of third pixels relative to the plurality of fourth pixels, and a plurality of third difference values of the plurality of fourth pixels relative to the plurality of A plurality of fourth difference values of the fifth pixel and a plurality of fifth difference values of the plurality of fifth pixels relative to the plurality of sixth pixels, if the first difference is relative to the second difference value The difference between the first difference and the fifth difference is small, the difference between the fourth difference and the fifth difference is small, and the difference between the third difference and the second difference is relatively large, then the image data is divided into a first block and a second block and take a first standard value and a second standard value in the first block and the second block, the first block includes the plurality of first pixels , the plurality of second pixels and the plurality of third pixels, the second block includes the plurality of fourth pixels, the plurality of fifth pixels and the plurality of sixth pixels; completely store the The first standard value and the second standard value are stored in a memory; storing a sixth difference value of the plurality of first pixels relative to the first standard value, and storing the plurality of second pixels relative to the first standard A seventh difference value of the value and an eighth difference value of the plurality of third pixels relative to the first standard value are stored in the memory, and the values of the plurality of fourth pixels relative to the second standard value are stored A ninth difference value, a tenth difference value of the plurality of fifth pixels relative to the second standard value, and an eleventh difference value of the plurality of sixth pixels relative to the second standard value are in the in memory; transmitting a data in the memory to a host; and combining the data into the image data.
所述的第一标准值可以为该多个第一图素、该多个第二图素与该多个第三图素的一平均值。The first standard value may be an average value of the plurality of first pixels, the plurality of second pixels, and the plurality of third pixels.
所述的第一标准值也可以为该多个第一图素、该多个第二图素与该多个第三图素的最小值。The first standard value may also be the minimum value of the plurality of first pixels, the plurality of second pixels and the plurality of third pixels.
所述的第二标准值可以为该多个第四图素、该多个第五图素与该多个第六图素的一平均值。The second standard value may be an average value of the plurality of fourth pixels, the plurality of fifth pixels, and the plurality of sixth pixels.
所述的第二标准值也可以为该多个第四图素、该多个第五图素与该多个第六图素的最小值。The second standard value may also be a minimum value of the plurality of fourth pixels, the plurality of fifth pixels, and the plurality of sixth pixels.
本发明再提供一种扫描压缩比自动判别的方法,包含:预扫一文件或一图案以获得一影像资料,该影像资料包含多个第一图素、多个第二图素、多个第三图素、多个第四图素、多个第五图素与多个第六图素,该多个第一图素相邻于该多个第二图素与该多个第四图素,该第二图素相邻于该多个第三图素与该多个第五图素,该多个第三图素相邻于该多个第六图素,该多个第四图素相邻于该多个第五图素,该多个第五图素相邻于该多个第六图素;分析该多个第一图素相对于该多个第二图素与该多个第四图素的多个第一差值与多个第二差值、该多个第二图素相对于该多个第三图素与该多个第五图素的多个第三差值与多个第四差值、该多个第三图素相对于该多个第六图素的多个第五差值、该多个第四图素相对于该多个第五图素的多个第六差值与该多个第五图素相对于该多个第六图素的多个第七差值的大小,若第一差值相对于第三差值值的一差异较小,第六差值相对于第七差值的一差异较小,第二差值、第四差值与第五差值均大于一第一标准值,则将该影像资料分割为一第一区块与一第二区块并在该第一区块与第二区块内取一第二标准值与一第三标准值,该第一区块包含该多个第一图素、该多个第二图素与该多个第三图素,该第二区块包含该多个第四图素、该多个第五图素与该多个第六图素;完整储存该第二标准值与该第三标准值于一内存内;储存该多个第一图素相对于该第二标准值的一第八差值、该多个第二图素相对于该第二标准值的一第九差值与该多个第三图素相对于该第二标准值的一第十差值于该内存内,并储存该多个第四图素相对于该第三标准值的一第十一差值、该多个第五图素相对于该第三标准值的一第十二差值与该多个第六图素相对于该第三标准值的一第十三差值于该内存内;传输该内存内的一资料至一主机上;及组合该资料为该影像资料。The present invention further provides a method for automatically judging the scanning compression ratio, which includes: pre-scanning a document or a pattern to obtain an image data, the image data includes a plurality of first pixels, a plurality of second pixels, a plurality of second pixels Three pixels, a plurality of fourth pixels, a plurality of fifth pixels and a plurality of sixth pixels, the plurality of first pixels are adjacent to the plurality of second pixels and the plurality of fourth pixels , the second pixel is adjacent to the plurality of third pixels and the plurality of fifth pixels, the plurality of third pixels is adjacent to the plurality of sixth pixels, and the plurality of fourth pixels Adjacent to the plurality of fifth pixels, the plurality of fifth pixels adjacent to the plurality of sixth pixels; analyzing the plurality of first pixels relative to the plurality of second pixels and the plurality of A plurality of first difference values and a plurality of second difference values of the fourth pixel, a plurality of third difference values of the plurality of second pixels relative to the plurality of third pixels and the plurality of fifth pixels and the plurality of fourth difference values, the plurality of fifth difference values of the plurality of third pixels relative to the plurality of sixth pixels, the multiplicity of the plurality of fourth pixels relative to the plurality of fifth pixels The size of the sixth difference value and the plurality of seventh difference values of the plurality of fifth pixels relative to the plurality of sixth pixels, if the difference between the first difference value and the third difference value is small, If the difference between the sixth difference and the seventh difference is small, and the second difference, the fourth difference and the fifth difference are all greater than a first standard value, then the image data is divided into a first block and a second block and take a second standard value and a third standard value in the first block and the second block, the first block includes the plurality of first pixels, the plurality of first pixels Two pixels and the plurality of third pixels, the second block includes the plurality of fourth pixels, the plurality of fifth pixels and the plurality of sixth pixels; completely store the second standard value and the plurality of sixth pixels; The third standard value is stored in a memory; an eighth difference value of the plurality of first pixels relative to the second standard value, a ninth difference value of the plurality of second pixels relative to the second standard value are stored The difference and a tenth difference of the plurality of third pixels relative to the second standard value are stored in the memory, and an eleventh difference of the plurality of fourth pixels relative to the third standard value is stored value, a twelfth difference value of the plurality of fifth pixels relative to the third standard value and a thirteenth difference value of the plurality of sixth pixels relative to the third standard value in the memory; Transmitting a data in the memory to a host; and combining the data into the image data.
所述的第二标准值为该多个第一图素、该多个第二图素与该多个第三图素的一平均值。The second standard value is an average value of the plurality of first pixels, the plurality of second pixels and the plurality of third pixels.
附图说明Description of drawings
图1A为传统技术如何选择R、G与B的扫描起始位置以及扫描区域;FIG. 1A shows how the traditional technology selects the scanning starting positions and scanning areas of R, G and B;
图1B为对应于各个图素所产生相对应的R、G与B资料的情形;FIG. 1B is a situation of corresponding R, G and B data generated corresponding to each pixel;
图2A为将预扫完成所获得的影像资料分割为多个区块的示意图;2A is a schematic diagram of dividing the image data obtained by pre-scanning into multiple blocks;
图2B为其中一个区块内各图素资料的排列方式;FIG. 2B is an arrangement of pixel data in one of the blocks;
图3为利用本发明的方法在缓冲储存器上储存其中一区块的示意图;及FIG. 3 is a schematic diagram of storing one of the blocks on the buffer memory using the method of the present invention; and
图4为本发明的扫描仪扫描压缩比自动判别法的流程图。FIG. 4 is a flow chart of the scanner scanning compression ratio automatic discrimination method of the present invention.
图中主要符号说明:Explanation of main symbols in the figure:
R(x,y) 红色图素的影像资料-图素值R(x, y) Image data of red pixel - pixel value
G(x,y) 绿色图素的影像资料-图素值G(x, y) Image data of green pixel - pixel value
B(x,y) 蓝色图素的影像资料-图素值B(x, y) Image data of blue pixel - pixel value
x 列坐标x column coordinates
y 行坐标y row coordinate
k 区块内所能容纳的图素数目k The number of pixels that can be accommodated in the block
q 标准值q standard value
q1 红色图素的标准值The standard value of q 1 red pixel
q2 绿色图素的标准值The standard value of q 2 green pixels
q3 蓝色图素的标准值The standard value of q 3 blue pixels
具体实施方式Detailed ways
下面结合附图和实施例详细说明本发明的具体实施方式。The specific implementation manner of the present invention will be described in detail below in conjunction with the accompanying drawings and examples.
一般目前扫描时,所采用将影像数据压缩的方法,均为采用一固定压缩比的方式将影像数据压缩,以减少所需传输的资料量。然而当压缩比固定后,影像各部位难以与压缩比取得一最佳的平衡点。当采用的压缩比较高时,则影像部分的处将较容易失真。当要维持影像的真实度并不欲得到失真的影像时,所采用的压缩比较低,但是所储存的资料量就会变得较为庞大,因而丧失压缩资料的目的。因此必须随着影像各部位像素的不同,采用不同的压缩比进行扫描的工作,以期使影像资料在经过有效率的压缩过程后,而能保持其原有的真实度。Generally, the methods for compressing image data during scanning currently adopt a fixed compression ratio to compress image data, so as to reduce the amount of data to be transmitted. However, when the compression ratio is fixed, it is difficult to achieve an optimal balance between each part of the image and the compression ratio. When the compression ratio is high, the part of the image will be easily distorted. When it is necessary to maintain the authenticity of the image and not obtain a distorted image, the compression used is relatively low, but the amount of stored data will become relatively large, thus losing the purpose of compressing the data. Therefore, it is necessary to use different compression ratios for scanning according to the different pixels of each part of the image, so that the image data can maintain its original authenticity after the efficient compression process.
本发明提供扫描仪扫描压缩比自动判别方法将影像资料先行压缩,以减少资料量。本发明首先分析预扫完成所获得的影像资料,将此影像资料划分为数个区域,每一区域内相邻像素的图素值较为接近。为使每一区域内相邻像素的图素值较为接近,因此本发明可预先设定一标准值。当相邻两图素的差值大于此标准值时,则此相邻两图素必须被划分在两个区域内。接下来由每一区域相邻像素的图素值的差值决定每一区域的扫描压缩比,并决定每一区域的一标准值。此标准值可为该区域所有像素的图素值的平均值,或是该区域所有像素的最小图素值。最后将此每区域的标准值完整地存入缓冲储存器(buffer)中,并将此每区域的标准值与该区域的各图素的差值存入缓冲储存器中,并指定一区域存放每相对应区块有无压缩的信息,以判别区块内的资料是否经过压缩。The invention provides a method for automatically judging the scanning compression ratio of a scanner to compress the image data in advance to reduce the amount of data. The present invention firstly analyzes the image data obtained after pre-scanning, and divides the image data into several areas, and the pixel values of adjacent pixels in each area are relatively close. In order to make the pixel values of adjacent pixels in each region closer, a standard value can be preset in the present invention. When the difference between two adjacent pixels is greater than the standard value, the two adjacent pixels must be divided into two regions. Next, the scan compression ratio of each area is determined according to the pixel value difference of adjacent pixels in each area, and a standard value for each area is determined. The standard value can be the average pixel value of all pixels in the area, or the minimum pixel value of all pixels in the area. Finally, the standard value of each area is completely stored in the buffer memory (buffer), and the difference between the standard value of each area and each pixel in the area is stored in the buffer memory, and an area is designated for storage Whether each corresponding block has compressed information to determine whether the data in the block is compressed.
本发明首先分析扫描仪经过预扫后所获得的影像资料,并将此影像资料分割为多个区块(参照图2A所示)。为确保每一区块内相邻两像素的图素值较为接近,因此本发明可预先设定一标准值。当相邻两图素的差值大于此标准值时,则此相邻两图素必须被划分在两个不同区块内。当相邻两图素的差值小于此标准值时,则此相邻两图素必须被划分在同一区块内。此多个区块的大小并不相同,依区块内各相邻的像素的图素值的差值而决定。若影像资料相邻各像素的图素值的差值均很小时,即不对影像资料进行分割的步骤,将影像资料视为一区块。本实施例所介绍的方法,为将影像资料分割为数个区块,但并不限制本发明的保护范围。分割而成的区块,其区块内的像素的图素值的差值均相当的小。所分割而成的区块可为一条线的形式存在,或是在一条线内分割成多个区域,或是在区块内包含多条线。所谓一条线的定义是指计算机控制显示器所能扫描的一条线的范围。因为一个平面通常是由很多条线所构成的,因此在扫描的过程中,扫描仪的计算机控制显示器也是将欲扫描的文件分成许多条线的资料来储存,最后传输至主机上再将线组合成此文件。此一条线的资料通常为一列资料。The present invention firstly analyzes the image data obtained by the scanner after pre-scanning, and divides the image data into multiple blocks (refer to FIG. 2A). In order to ensure that the pixel values of two adjacent pixels in each block are relatively close, a standard value can be preset in the present invention. When the difference between two adjacent pixels is larger than the standard value, the two adjacent pixels must be divided into two different blocks. When the difference between two adjacent pixels is smaller than the standard value, the two adjacent pixels must be divided into the same block. The sizes of the multiple blocks are not the same, and are determined according to the difference between the pixel values of adjacent pixels in the block. If the difference between the pixel values of adjacent pixels of the image data is small, that is, the step of not dividing the image data is performed, and the image data is regarded as a block. The method introduced in this embodiment is to divide the image data into several blocks, but it does not limit the protection scope of the present invention. For the divided blocks, the difference between the pixel values of the pixels in the block is quite small. The divided block may exist in the form of one line, or be divided into multiple areas within one line, or contain multiple lines within the block. The so-called definition of a line refers to the range of a line that can be scanned by a computer-controlled display. Because a plane is usually composed of many lines, during the scanning process, the computer-controlled display of the scanner also divides the document to be scanned into many lines for storage, and finally transmits the data to the host computer and then combines the lines. into this file. The data of this line is usually a column of data.
参照图2B所示,此为其中一个区块内各图素资料的排列方式,但并不限制本发明的保护范围。其中图素的影像资料-图素值以符号P(x,y)表示的,且x代表列坐标,而y则代表行坐标。例如:P(2n-1,1)即代表第2n-1(n为自然数)列中的第一个图素的图素值。R(x,y)、G(x,y)与B(x,y)分别代表图素值P(x,y)所包括的颜色资料。此区块内各像素的图素值的差异较小,且此区块包含k个图素。Referring to FIG. 2B , this is the arrangement of pixel data in one block, but it does not limit the protection scope of the present invention. The pixel image data-pixel value is represented by the symbol P(x, y), and x represents the column coordinate, and y represents the row coordinate. For example: P(2n-1, 1) represents the pixel value of the first pixel in the 2n-1 (n is a natural number) column. R(x, y), G(x, y) and B(x, y) respectively represent the color data contained in the pixel value P(x, y). The pixel value difference of each pixel in the block is small, and the block includes k pixels.
接下来取一标准值作为此区块各像素的图素值的标准值,并将此标准值完整储存入缓冲储存器内。此标准值可为各像素的图素值的平均值,也可为各像素的图素值的最小值。接下来求取各像素的图素值与此标准值的差值,并将此些差值储存于缓冲储存器内。Next, a standard value is taken as the standard value of the pixel value of each pixel in the block, and the standard value is completely stored in the buffer memory. The standard value can be the average value of the pixel values of each pixel, or the minimum value of the pixel values of each pixel. Next, calculate the difference between the pixel value of each pixel and the standard value, and store the difference in the buffer memory.
参照图3所示,此为利用本发明的方法在缓冲储存器上储存其中一区块的示意图。当求出各区块内的标准值q并将此标准值q完整储存入缓冲储存器后,随即求取各像素的图素值与此标准值q的差值。其中q1代表红色图素资料的标准值,q2代表绿色资料的标准值,q3代表蓝色资料的标准值。当计算出第一像素的图素值与标准值q的第一差值后,随即将此第一差值储存在缓冲储存器内。当计算出第二像素的图素值与标准值q的第二差值后,随即将此第二差值储存在缓冲储存器内。若此区块有k个图素,则当计算出第k像素的图素值与标准值q的第k差值后,随即将此第k差值储存在缓冲储存器内。当像素的图素值与标准值q相同时,则将此差值记录为零。Referring to FIG. 3 , it is a schematic diagram of storing one of the blocks in the buffer memory by using the method of the present invention. After calculating the standard value q in each block and completely storing the standard value q in the buffer memory, then calculating the difference between the pixel value of each pixel and the standard value q. Among them, q 1 represents the standard value of red pixel data, q 2 represents the standard value of green data, and q 3 represents the standard value of blue data. After the first difference between the pixel value of the first pixel and the standard value q is calculated, the first difference is then stored in the buffer memory. After calculating the second difference between the pixel value of the second pixel and the standard value q, the second difference is then stored in the buffer memory. If the block has k pixels, after calculating the kth difference between the pixel value of the kth pixel and the standard value q, the kth difference is then stored in the buffer memory. When the pixel's texel value is the same as the standard value q, this difference is recorded as zero.
当将各区块内的标准值完整存入缓冲存储器内,并将各区块的各像素的图素值与各标准值的差值存入缓冲存储器内后,随即将缓冲存储器内所储存的资料往主机传输,并在主机内进行影像结合的步骤,使得影像在主机上完整地还原。本发明所采用的方法并不限制各区块的范围大小,因此各区块的压缩比随着各区块内相邻像素的图素值的差异而改变,因此可在影像不失真与压缩比的比例上取得一最佳平衡,影像资料可经由此一适当的压缩方法将影像资料适度地压缩,以减少数据传输的时间,并延长缓冲储存器的寿命。When the standard value in each block is completely stored in the buffer memory, and the difference between the pixel value of each pixel of each block and each standard value is stored in the buffer memory, the data stored in the buffer memory is then transferred to the buffer memory. Host transmission, and the step of combining images in the host, so that the images can be completely restored on the host. The method adopted in the present invention does not limit the range size of each block, so the compression ratio of each block changes with the difference of the pixel values of adjacent pixels in each block, so the ratio of image distortion and compression ratio can be adjusted To achieve an optimal balance, the image data can be appropriately compressed through this appropriate compression method, so as to reduce the time of data transmission and prolong the life of the buffer memory.
图4为本发明的扫描仪扫描压缩比自动判别法的流程图。首先将扫描仪预扫过后所得到的影像资料经由分析相邻像素的图素值之间的差值而分割为多个区块,各区块内相邻像素的图素值间的差值均小于一设定值40。接下来在各区块内求取一标准值,并将此标准值完整存入缓冲储存器内41。接下来计算各区块的第一图素与各区块的标准值的第一差值,并将此第一差值存入缓冲储存器内42。接下来计算各区块的第二图素与各区块的标准值的第二差值,并将此第二差值存入缓冲储存器内43。接下来计算各区块的第n图素与各区块的标准值的第k差值,并将此第k差值存入缓冲储存器内44。最后将缓冲储存器内的数据传输至主机上进行影像结合的步骤45。FIG. 4 is a flow chart of the scanner scanning compression ratio automatic discrimination method of the present invention. Firstly, the image data obtained after pre-scanning by the scanner is divided into multiple blocks by analyzing the difference between the pixel values of adjacent pixels, and the difference between the pixel values of adjacent pixels in each block is less than A set value of 40. Next, a standard value is obtained in each block, and the standard value is completely stored in the
综合上述,本发明提供了一种方法,利用扫描仪扫描压缩比自动判别方法将影像资料先行压缩,以减少资料量。本发明首先分析预扫完成所获得的影像资料,将此影像资料划分为数个区域,每一区域内相邻像素的图素值较为接近。接下来由每一区域相邻像素的图素值的差值决定每一区域的扫描压缩比,并决定每一区域的一标准值。此标准值可为该区域所有像素的图素值的平均值,或是该区域所有像素的最小图素值。最后将此每区域的标准值完整地存入缓冲储存器(buffer)中,并将此每区域的标准值与该区域的各图素的差值存入缓冲储存器中,并指定一区域存放每相对应区块有无压缩的信息,用以判别区块内的资料是否经过压缩。Based on the above, the present invention provides a method for compressing the image data in advance by using the automatic identification method of the scanning compression ratio of the scanner to reduce the amount of data. The present invention firstly analyzes the image data obtained after pre-scanning, and divides the image data into several areas, and the pixel values of adjacent pixels in each area are relatively close. Next, the scan compression ratio of each area is determined according to the pixel value difference of adjacent pixels in each area, and a standard value for each area is determined. The standard value can be the average pixel value of all pixels in the area, or the minimum pixel value of all pixels in the area. Finally, the standard value of each area is completely stored in the buffer memory (buffer), and the difference between the standard value of each area and each pixel in the area is stored in the buffer memory, and an area is designated for storage Whether each corresponding block has compressed information is used to determine whether the data in the block is compressed.
以上所述仅为本发明的较佳实施例,此实施例仅用来说明而非用以限定本发明的保护范围。在不脱离本发明的实质内容的范畴内仍可予以变化而加以实施,此等变化应仍属本发明的范围。因此,本发明的范畴由权利要求书的范围所界定。The above description is only a preferred embodiment of the present invention, and this embodiment is only used for illustration rather than limiting the protection scope of the present invention. Changes can still be made and implemented within the scope of not departing from the essence of the present invention, and these changes should still belong to the scope of the present invention. Therefore, the scope of the present invention is defined by the scope of the claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 02124773 CN1464744A (en) | 2002-06-25 | 2002-06-25 | Method for automatic discriminating scanning compression ratio of scanner |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 02124773 CN1464744A (en) | 2002-06-25 | 2002-06-25 | Method for automatic discriminating scanning compression ratio of scanner |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN1464744A true CN1464744A (en) | 2003-12-31 |
Family
ID=29743907
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN 02124773 Pending CN1464744A (en) | 2002-06-25 | 2002-06-25 | Method for automatic discriminating scanning compression ratio of scanner |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN1464744A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101202809B (en) * | 2007-12-13 | 2011-02-16 | 北京中星微电子有限公司 | Compression method for row buffer |
| CN101536493B (en) * | 2006-11-08 | 2011-10-19 | 索尼爱立信移动通讯股份有限公司 | Camera and method for determing set in a camera |
| CN113194315A (en) * | 2021-04-01 | 2021-07-30 | Tcl华星光电技术有限公司 | Image compression method and compression device |
-
2002
- 2002-06-25 CN CN 02124773 patent/CN1464744A/en active Pending
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101536493B (en) * | 2006-11-08 | 2011-10-19 | 索尼爱立信移动通讯股份有限公司 | Camera and method for determing set in a camera |
| CN101202809B (en) * | 2007-12-13 | 2011-02-16 | 北京中星微电子有限公司 | Compression method for row buffer |
| CN113194315A (en) * | 2021-04-01 | 2021-07-30 | Tcl华星光电技术有限公司 | Image compression method and compression device |
| CN113194315B (en) * | 2021-04-01 | 2022-05-31 | Tcl华星光电技术有限公司 | Image compression method and compression device |
| WO2022205603A1 (en) * | 2021-04-01 | 2022-10-06 | Tcl华星光电技术有限公司 | Image compression method and compression apparatus |
| US11997295B2 (en) | 2021-04-01 | 2024-05-28 | Tcl China Star Optoelectronics Technology Co., Ltd. | Image compression method and compression device capable of improving compression rate |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN1208943C (en) | Method and apparatus for increasing digital image quality | |
| CN1054953C (en) | Document image processor with defect detection | |
| CN1655578A (en) | Systems and methods for adjusting image data to form highly compressible image planes | |
| CN100379250C (en) | Image processing apparatus and image processing method for performing color image data conversion | |
| CN1210953C (en) | Digital image signal processing, digital image recording device and method | |
| WO2004015984A1 (en) | Image data processing device, image data processing method, program, recording medium, and image reading device | |
| JP4089905B2 (en) | Image processing apparatus, image processing method, program, and information recording medium | |
| CN101064816A (en) | Image processing apparatus and method for preventing degradation of image quality when bit format of image is converted | |
| CN1464744A (en) | Method for automatic discriminating scanning compression ratio of scanner | |
| US6970596B2 (en) | Method for compressing an image by classifying colors | |
| CN101547293B (en) | Image processing apparatus and image forming apparatus | |
| CN1232100C (en) | Image coding equipment and decoding equipment | |
| US7298894B2 (en) | Color image conversion method and system for reducing color image data size | |
| JP2008124819A (en) | Image processing apparatus and image processing method | |
| JP4787776B2 (en) | Image processing apparatus, image forming apparatus including the same, and image processing method | |
| CN1251139C (en) | Multi-mode image processing method and system thereof | |
| CN1324877C (en) | Image processing apparatus and method | |
| JP4097146B2 (en) | Image processing apparatus, image processing method, program, and information recording medium | |
| US20070058218A1 (en) | Image processing apparatus, method for controlling image processing apparatus | |
| JP4766586B2 (en) | Image processing apparatus, image processing method, program, and information recording medium | |
| CN100338934C (en) | Dual Function Light Sensing Element | |
| TW556435B (en) | Method for comprising an image in real time | |
| CN1604614A (en) | Image processing apparatus | |
| US20030081839A1 (en) | Method for comprising an image in real time | |
| TW569616B (en) | Method for compressing an image in real time and shading compressing an images |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
| WD01 | Invention patent application deemed withdrawn after publication |