TWI851470B - System, method and computer readable medium for restoring binary image - Google Patents
System, method and computer readable medium for restoring binary image Download PDFInfo
- Publication number
- TWI851470B TWI851470B TW112142681A TW112142681A TWI851470B TW I851470 B TWI851470 B TW I851470B TW 112142681 A TW112142681 A TW 112142681A TW 112142681 A TW112142681 A TW 112142681A TW I851470 B TWI851470 B TW I851470B
- Authority
- TW
- Taiwan
- Prior art keywords
- points
- dimensional
- spectrum
- discrete fourier
- fourier transform
- Prior art date
Links
Images
Landscapes
- Facsimile Image Signal Circuits (AREA)
- Image Processing (AREA)
Abstract
Description
本發明係關於一種二元影像還原技術,特別是指一種從二維離散傅立葉轉換係數還原二元影像之系統、方法及電腦可讀媒介。 The present invention relates to a binary image restoration technology, and more particularly to a system, method and computer-readable medium for restoring a binary image from two-dimensional discrete Fourier transform coefficients.
目前在二元影像(如黑白影像)之取得上,常常因為設備(如手機)或操作(如手震)之原因,只能獲得一些模糊之影像。這種現象從二元影像之頻譜上來看,就是只能取得二元影像之頻譜之一部分而非全部或全貌。 At present, when obtaining binary images (such as black and white images), often due to equipment (such as mobile phones) or operation (such as hand shaking), only some blurred images can be obtained. From the perspective of the spectrum of binary images, this phenomenon means that only a part of the spectrum of binary images can be obtained instead of the whole or complete picture.
例如,在電腦斷層掃描之二元影像上,可以透過量測方式直接得到某個方向之投影之傅立葉轉換係數,然後透過不同方向之投影來還原原始圖片之二元影像。 For example, in a binary image of a computer tomography scan, the Fourier transform coefficient of a projection in a certain direction can be directly obtained through measurement, and then the binary image of the original image can be restored through projection in different directions.
又例如,在使用者以手機掃描快速響應碼(QR code)時,由於使用者之手震關係,導致使用者所取得之快速響應碼(QR code)可能是模糊之影像,此相當於傅立葉轉換係數遭到破壞。 For example, when a user scans a QR code with a mobile phone, the QR code obtained by the user may be a blurred image due to the user's hand shaking, which is equivalent to the Fourier transform coefficient being destroyed.
目前習知技術之作法,通常是透過影像強化來進行影像之前處理,其中,影像強化是假設影像為灰階連續信號,再將灰階連續信號作銳 利化。 The current known technology usually uses image enhancement to process the image beforehand, where image enhancement assumes that the image is a grayscale continuous signal and then sharpens the grayscale continuous signal.
然而,習知技術在例如19乘19(即19*19)之二元影像之還原過程需要大約90秒之還原時間(運算時間),故二元影像之還原時間相當冗長且耗費成本。 However, the conventional technology requires about 90 seconds of restoration time (computation time) to restore a binary image of, for example, 19 by 19 (i.e., 19*19), so the restoration time of the binary image is quite lengthy and costly.
因此,如何提供一種創新之二元影像還原技術,以解決上述之任一問題並提供相關之系統或方法,已成為本領域技術人員之一大研究課題。 Therefore, how to provide an innovative binary image restoration technology to solve any of the above problems and provide a related system or method has become a major research topic for technical personnel in this field.
本發明所述之一種還原二元影像之系統包括:一傳送裝置,係將所輸入之二元影像進行二維離散傅立葉轉換以得到包括N*N個點之二維離散傅立葉轉換係數之頻譜,再由傳送裝置對包括N*N個點之二維離散傅立葉轉換係數之頻譜進行取樣以得到包括N+2個點之二維離散傅立葉轉換係數之取樣頻譜,俾由傳送裝置傳送包括N+2個點之二維離散傅立葉轉換係數之取樣頻譜,其中,N係質數;以及一具有還原模組之接收裝置,係通訊連結傳送裝置,以由接收裝置接收傳送裝置所傳送之包括N+2個點之二維離散傅立葉轉換係數之取樣頻譜,再由接收裝置之還原模組依據包括N+2個點之二維離散傅立葉轉換係數之取樣頻譜還原出傳送裝置所輸入之二元影像;其中,還原模組對取樣頻譜中包括N個點之二維離散傅立葉轉換係數之頻譜進行一維離散傅立葉反轉換以得到包括N個點之一維係數之一維頻譜,以於一維頻譜之N個點之任一者之一維係數為非0時,由還原模組對為非0之一維係數執行一維信號還原作業以還原出二元影像,而於一 維頻譜之N個點之任一者之一維係數為0時,由還原模組對為0之一維係數執行等候再還原作業以還原出二元影像。 The system for restoring a binary image described in the present invention includes: a transmission device, which performs a two-dimensional discrete Fourier transform on an input binary image to obtain a spectrum of two-dimensional discrete Fourier transform coefficients including N*N points, and then the transmission device samples the spectrum of two-dimensional discrete Fourier transform coefficients including N*N points to obtain a sampled spectrum of two-dimensional discrete Fourier transform coefficients including N+2 points, so that the transmission device transmits the sampled spectrum of two-dimensional discrete Fourier transform coefficients including N+2 points, wherein N is a prime number; and a receiving device with a restoration module, which is communicatively connected to the transmission device, so that the receiving device receives the two-dimensional discrete Fourier transform coefficients including N+2 points transmitted by the transmission device. The sampling spectrum of the N+2 points of the two-dimensional discrete Fourier transform coefficients is then restored by the restoration module of the receiving device to restore the binary image input by the transmitting device; wherein the restoration module performs a one-dimensional discrete Fourier inverse transform on the spectrum of the two-dimensional discrete Fourier transform coefficients of the N points in the sampling spectrum to obtain a one-dimensional coefficient of the N points. One-dimensional spectrum, when any one-dimensional coefficient of the N points of the one-dimensional spectrum is non-zero, the restoration module performs a one-dimensional signal restoration operation on the non-zero one-dimensional coefficient to restore a binary image, and when any one-dimensional coefficient of the N points of the one-dimensional spectrum is zero, the restoration module performs a waiting and restoring operation on the zero one-dimensional coefficient to restore a binary image.
本發明所述之一種還原二元影像之方法包括:由一傳送裝置將所輸入之二元影像進行二維離散傅立葉轉換以得到包括N*N個點之二維離散傅立葉轉換係數之頻譜,再由傳送裝置對包括N*N個點之二維離散傅立葉轉換係數之頻譜進行取樣以得到包括N+2個點之二維離散傅立葉轉換係數之取樣頻譜,其中,N係質數;以及由傳送裝置傳送包括N+2個點之二維離散傅立葉轉換係數之取樣頻譜至一具有還原模組之接收裝置,再由接收裝置之還原模組依據包括N+2個點之二維離散傅立葉轉換係數之取樣頻譜還原出傳送裝置所輸入之二元影像;其中,還原模組對取樣頻譜中包括N個點之二維離散傅立葉轉換係數之頻譜進行一維離散傅立葉反轉換以得到包括N個點之一維係數之一維頻譜,以於一維頻譜之N個點之任一者之一維係數為非0時,由還原模組對為非0之一維係數執行一維信號還原作業以還原出二元影像,而於一維頻譜之N個點之任一者之一維係數為0時,由還原模組對為0之一維係數執行等候再還原作業以還原出二元影像。 The present invention discloses a method for restoring a binary image, comprising: performing a two-dimensional discrete Fourier transform on an input binary image by a transmission device to obtain a spectrum of two-dimensional discrete Fourier transform coefficients including N*N points, and then sampling the spectrum of two-dimensional discrete Fourier transform coefficients including N*N points by the transmission device to obtain a sampled spectrum of two-dimensional discrete Fourier transform coefficients including N+2 points, wherein N is a prime number; and transmitting the sampled spectrum of two-dimensional discrete Fourier transform coefficients including N+2 points to a receiving device having a restoration module by the transmission device, and then the restoration module of the receiving device performs a restoration on the spectrum of two-dimensional discrete Fourier transform coefficients including N+2 points. The sampling spectrum of the two-dimensional discrete Fourier transform coefficient of the sampling spectrum is used to restore the binary image input by the transmission device; wherein the restoration module performs a one-dimensional discrete Fourier inverse transform on the spectrum of the two-dimensional discrete Fourier transform coefficients of N points in the sampling spectrum to obtain a one-dimensional spectrum including one-dimensional coefficients of N points, so that when the one-dimensional coefficient of any one of the N points of the one-dimensional spectrum is non-zero, the restoration module performs a one-dimensional signal restoration operation on the non-zero one-dimensional coefficient to restore the binary image, and when the one-dimensional coefficient of any one of the N points of the one-dimensional spectrum is zero, the restoration module performs a waiting and then restoration operation on the zero one-dimensional coefficient to restore the binary image.
本發明之電腦可讀媒介應用於計算裝置或電腦中,係儲存有指令,以執行上述之還原二元影像之方法。 The computer-readable medium of the present invention is applied to a computing device or a computer, and stores instructions to execute the above-mentioned method of restoring a binary image.
因此,本發明提供一種創新之還原二元影像之系統、方法及電腦可讀媒介,係能在已知影像為二元影像之情況下,傳送裝置只需從二元影像之頻譜中選取N+2個點或以上(大約或最少6%)之二維離散傅立葉轉換係數以傳送至接收裝置,俾利接收裝置之還原模組能迅速地還原出傳送裝置所輸入之二元影像而完全不會失真。 Therefore, the present invention provides an innovative system, method and computer-readable medium for restoring binary images. When it is known that the image is a binary image, the transmitting device only needs to select N+2 points or more (approximately or at least 6%) of two-dimensional discrete Fourier transform coefficients from the spectrum of the binary image to transmit to the receiving device, so that the restoration module of the receiving device can quickly restore the binary image input by the transmitting device without any distortion.
換言之,本發明能在二元影像之頻譜遭到嚴重破壞之情況下,接收裝置之還原模組(還原方法)只需使用二元影像之頻譜中N+2個點或以上(大約或最少6%)之二維離散傅立葉轉換係數(如頻譜係數或頻譜資訊),即能迅速地還原出二元影像。亦即,本發明對於一個具有N*N個點之二元影像,只需從二元影像之頻譜中抽取N+2個點或以上(大約或最少6%)之二維離散傅立葉轉換係數,即能迅速地無損還原出二元影像。 In other words, the present invention can restore the binary image quickly when the spectrum of the binary image is severely damaged, by using only two-dimensional discrete Fourier transform coefficients (such as spectrum coefficients or spectrum information) of N+2 points or more (approximately or at least 6%) in the spectrum of the binary image. That is, for a binary image with N*N points, the present invention only needs to extract two-dimensional discrete Fourier transform coefficients of N+2 points or more (approximately or at least 6%) from the spectrum of the binary image, and can restore the binary image quickly and losslessly.
為使本發明之上述特徵與優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明。在以下描述內容中將部分闡述本發明之額外特徵及優點,且此等特徵及優點將部分自所述描述內容可得而知,或可藉由對本發明之實踐習得。應理解,前文一般描述與以下詳細描述二者均為例示性及解釋性的,且不欲約束本發明所欲主張之範圍。 In order to make the above features and advantages of the present invention more clearly understandable, the following examples are given and detailed descriptions are provided in conjunction with the attached drawings. The following description will partially explain the additional features and advantages of the present invention, and these features and advantages will be partially known from the description or can be learned through the practice of the present invention. It should be understood that both the general description above and the detailed description below are exemplary and explanatory, and are not intended to limit the scope of the present invention.
1:系統 1: System
10:傳送裝置 10: Transmission device
11:頻譜轉換模組 11: Spectrum conversion module
12:二維離散傅立葉轉換法 12: Two-dimensional discrete Fourier transform method
13:取樣模組 13: Sampling module
14:取樣法 14: Sampling method
15:頻譜傳送模組 15: Spectrum transmission module
20:接收裝置 20: Receiving device
21:頻譜接收模組 21: Spectrum receiving module
22:還原模組 22: Restore module
23:還原方法 23: Restoration method
24:一維離散傅立葉反轉換法 24: One-dimensional discrete Fourier inverse transform method
25:一維信號還原作業 25: One-dimensional signal restoration operation
26:等候再還原作業 26: Wait and restore the operation
27:查表法 27: Table lookup method
28:窮舉法 28: Poor Manners
A:原始信號 A: Original signal
B:二維離散傅立葉轉換係數 B: Two-dimensional discrete Fourier transform coefficient
S11至S14,S21至S22,S31至S36:步驟 S11 to S14, S21 to S22, S31 to S36: Steps
X:二元影像 X: binary image
Y:頻譜 Y: spectrum
y:一維頻譜 y: one-dimensional spectrum
y(n):一維係數 y(n): one-dimensional coefficient
Z:取樣頻譜 Z: sampling spectrum
z:頻譜 z: spectrum
圖1為本發明所述之一種還原二元影像之系統之架構示意圖。 Figure 1 is a schematic diagram of the structure of a system for restoring binary images described in the present invention.
圖2為本發明所述之一種還原二元影像之方法之流程示意圖。 Figure 2 is a schematic diagram of the process of a method for restoring a binary image described in the present invention.
圖3為本發明所述之一種還原二元影像之方法中,有關圖1與圖2所示還原模組或其還原方法之實施流程示意圖。 FIG3 is a schematic diagram of the implementation process of the restoration module or the restoration method shown in FIG1 and FIG2 in a method for restoring a binary image described in the present invention.
以下藉由特定的具體實施形態說明本發明之實施方式,熟悉此技術之人士可由本說明書所揭示之內容瞭解本發明之其他優點與功效,亦可因而藉由其他不同具體等同實施形態加以施行或運用。 The following describes the implementation of the present invention through a specific concrete implementation form. People familiar with this technology can understand other advantages and effects of the present invention from the content disclosed in this manual, and can also implement or use it through other different specific equivalent implementation forms.
圖1為本發明所述之一種還原二元影像之系統1之架構示意圖,圖2為本發明所述之一種還原二元影像之方法之流程示意圖。
FIG1 is a schematic diagram of the structure of a
如圖1所示,該還原二元影像之系統1係從二維離散傅立葉轉換係數還原二元影像之系統,其主要包括互相通訊連結之一傳送裝置10與一接收裝置20。傳送裝置10可具有頻譜轉換模組11、取樣模組13與頻譜傳送模組15,頻譜轉換模組11可具有二維離散傅立葉轉換法12,且取樣模組13可具有取樣法14。接收裝置20可具有頻譜接收模組21與還原模組22,還原模組22可具有還原方法(如還原演算法)23,且還原模組22或還原方法23亦可包括一維離散傅立葉反轉換法24、一維信號還原作業25、等候再還原作業26、查表法27及/或窮舉法28等。
As shown in FIG1 , the binary
在一實施例中,傳送裝置10可為傳送端或影像傳送裝置,亦可為具有傳送功能之電子裝置。接收裝置20可為接收端、影像接收裝置、還原端或影像還原裝置,亦可為具有接收/還原功能之電子裝置。電子裝置可為電腦、智慧型手機、智慧型手錶、通訊器、通訊裝置、伺服器等,電腦可為個人電腦、平板電腦、筆記型電腦、桌上型電腦等,且伺服器可為通用伺服器、網路伺服器、雲端伺服器、遠端伺服器等。
In one embodiment, the
在一實施例中,傳送裝置10之頻譜轉換模組11可為頻譜轉換器(晶片/電路)、頻譜轉換軟體(程式)等,取樣模組13可為取樣器(晶片/電路)、取樣軟體(程式)等,頻譜傳送模組15可為頻譜傳送器(晶片/電路)、頻譜傳送軟體(程式)等。接收裝置20之頻譜接收模組21可為頻譜接收器(晶片/電路)、頻譜接收軟體(程式)等,還原模組22可為還原器(晶片/電路)、還原軟體(程式)等。
In one embodiment, the
在一實施例中,本發明所述「二元」可用1與0代表之,二元影像X可為二種顏色所構成之影像、圖像、圖案、圖片、照片、編碼等,例如二元影像X可為黑白影像、電腦斷層掃描影像、快速響應碼(QR code)等。取樣頻譜Z可為二維頻譜,一維頻譜y亦可稱為中介頻譜或中介向量等。一維信號還原作業15可為一維信號還原法、一維信號還原功能、一維信號還原程序等,且等候再還原作業可為等候再還原法、等候再還原功能、等候再還原程序。
In one embodiment, the "binary" described in the present invention can be represented by 1 and 0, and the binary image X can be an image, picture, pattern, picture, photo, code, etc. composed of two colors. For example, the binary image X can be a black and white image, a computer tomography image, a quick response code (QR code), etc. The sampling spectrum Z can be a two-dimensional spectrum, and the one-dimensional spectrum y can also be called an intermediate spectrum or an intermediate vector, etc. The one-dimensional
在一實施例中,本發明所述「至少一」代表一個以上(如一、二或三個以上),「複數」代表二個以上(如二、三、四、十或百個以上),「通訊連結」代表透過資料、訊號、電性、有線方式(如有線網路)或無線方式(如無線網路)等各種方式互相通訊或連結。但是,本發明並不以各實施例所提及者為限。 In one embodiment, the "at least one" mentioned in the present invention represents more than one (such as one, two or three), "plurality" represents more than two (such as two, three, four, ten or one hundred), and "communication connection" represents communication or connection through various methods such as data, signal, electrical, wired mode (such as wired network) or wireless mode (such as wireless network). However, the present invention is not limited to those mentioned in each embodiment.
要特別說明者,本發明之實施例皆將縱向稱為「行」,並將橫向稱為「列」,以避免混淆。但其它實施例中,亦可改將縱向稱為「列」,並將橫向改稱為「行」。例如,本發明之實施例中「第一行」代表「縱向之第一行」,但其它實施例中第一行亦可代表「橫向之第一行」。因此,本發明所述「行」可為縱向與橫向之一者,且「列」可為縱向與橫向之另一者。 It should be noted that the embodiments of the present invention all refer to the longitudinal direction as "row" and the transverse direction as "column" to avoid confusion. However, in other embodiments, the longitudinal direction may be referred to as "column" and the transverse direction may be referred to as "row". For example, in the embodiments of the present invention, "the first row" represents "the first row in the longitudinal direction", but in other embodiments, the first row may also represent "the first row in the transverse direction". Therefore, the "row" described in the present invention may be one of the longitudinal and transverse directions, and the "column" may be the other of the longitudinal and transverse directions.
本發明所述之還原二元影像之系統1及方法為一種適用於二元影像X之還原技術,能在已知影像為二元影像X(如1與0或者黑與白之二元影像)之情況下,只需對傳送裝置10所輸入之二元影像X通過二維離散傅立葉轉換法12所得到之頻譜Y選取適當之樣本(稱為取樣頻譜Z)以傳輸至接收裝置20即可,且接收裝置20之還原模組22可透過還原方法23對
取樣頻譜Z(即對頻譜Y之取樣結果)還原出二元影像X而完全不會失真。
The
亦即,本發明所述之還原二元影像之系統1及方法為一種適用於二元影像X之還原技術,能在二元影像X之長與寬皆為相同質數N(如質數=2,3,5,7,11,13,17,19,23,29,31,37,41,43,47...)時,只需要N+2個點或以上(如至少N+2個點且皆為非0)之二維離散傅立葉轉換係數B,便能迅速地還原二元影像X。
That is, the
例如,本發明在N=19之情況下,能採用21個點(即至少N+2個點且皆為非0)之二維離散傅立葉轉換係數B以迅速地還原二元影像X,相當於只使用21/361=5.8%(大約6%)之二維離散傅立葉轉換係數B(如頻譜係數),且能在2秒內還原二元影像X。 For example, when N=19, the present invention can use 21 points (i.e., at least N+2 points and all non-zero) of two-dimensional discrete Fourier transform coefficients B to quickly restore the binary image X, which is equivalent to using only 21/361=5.8% (approximately 6%) of the two-dimensional discrete Fourier transform coefficients B (such as spectrum coefficients), and can restore the binary image X within 2 seconds.
本發明對於一個具有N*N個點之二元影像X,只需從二元影像X之頻譜Y中抽取N+2個點或以上(即6%)之二維離散傅立葉轉換係數B,即能迅速地無損還原出二元影像X。例如,在19乘19(即19*19)之二元影像X之還原時間(運算時間)上,習知技術需要90秒之還原時間,但本發明只需要不到2秒之還原時間,故本發明只需花費習知技術之1/45的還原時間。 For a binary image X with N*N points, the present invention only needs to extract N+2 points or more (i.e. 6%) of two-dimensional discrete Fourier transform coefficients B from the spectrum Y of the binary image X, and can quickly and losslessly restore the binary image X. For example, in the restoration time (computation time) of a 19x19 (i.e. 19*19) binary image X, the known technology requires 90 seconds of restoration time, but the present invention only requires less than 2 seconds of restoration time, so the present invention only needs 1/45 of the restoration time of the known technology.
本發明對於具有長與寬之邊長皆為質數N之倍數個點(如mN*mN=38*38)之二元影像X之情況,其中m為倍數(如m=2)且N為質數(如N=19),能採用平移取樣技術以取樣(N+2)m2(如21*22=84)個二維離散傅立葉轉換係數B即可還原二元影像X,且二元影像X之頻譜Y之二維離散傅立葉轉換係數B之取樣率同樣只需大約6%(即84/382=5.8%≒6%)。 For a binary image X with both length and width being multiples of prime number N (e.g., mN*mN=38*38), where m is a multiple (e.g., m=2) and N is a prime number (e.g., N=19), the present invention can use translation sampling technology to sample (N+2)m 2 (e.g., 21*2 2 =84) two-dimensional discrete Fourier transform coefficients B to restore the binary image X, and the sampling rate of the two-dimensional discrete Fourier transform coefficient B of the spectrum Y of the binary image X only needs to be about 6% (i.e., 84/38 2 =5.8%≒6%).
本發明之使用情境:在例如電腦斷層掃描之二元影像X上, 可以透過量測方式直接得到某個方向之投影之二維離散傅立葉轉換係數B,然後透過不同方向之投影來還原原始圖片之二元影像X。對此,本發明只需要使用N+2個點或以上(大約或最少6%)之二維離散傅立葉轉換係數B即能還原二元影像X,以利減少電腦斷層掃描之量測次數。 The use scenario of the present invention: For example, on a binary image X of a computer tomography scan, the two-dimensional discrete Fourier transform coefficient B of a projection in a certain direction can be directly obtained by measurement, and then the binary image X of the original image can be restored by projection in different directions. In this regard, the present invention only needs to use two-dimensional discrete Fourier transform coefficients B of N+2 points or more (approximately or at least 6%) to restore the binary image X, so as to reduce the number of measurements of computer tomography scans.
又例如,在使用者以手機掃描快速響應碼(QR code)時,由於使用者之手震關係,導致使用者所取得之快速響應碼(QR code)可能是模糊之影像,此相當於傅立葉轉換係數遭到破壞。目前習知技術之作法,通常是透過影像強化進行影像之前處理,其中,影像強化是假設影像為灰階連續信號,再將灰階連續信號作銳利化。本發明不同之處在於利用例如快速響應碼(QR code)是二元影像X之特性,以利減少傳送裝置10之取樣模組13(取樣法14)對二元影像X取樣所需之二維離散傅立葉轉換係數B之個數,且即便二元影像X遭到嚴重破壞,接收裝置20之還原模組22(還原方法23)亦能迅速地還原此二元影像X。
For example, when a user scans a QR code with a mobile phone, the QR code obtained by the user may be a blurred image due to the user's hand shaking, which is equivalent to the Fourier transform coefficient being destroyed. The current known technology usually performs image pre-processing through image enhancement, wherein image enhancement assumes that the image is a grayscale continuous signal and then sharpens the grayscale continuous signal. The difference of the present invention is that it utilizes the characteristics of the binary image X, such as the quick response code (QR code), to reduce the number of two-dimensional discrete Fourier transform coefficients B required by the sampling module 13 (sampling method 14) of the
具體而言,如圖1與圖2所示,本發明所述之還原二元影像之系統1及方法可包括下列步驟S11至步驟S14與步驟S21至步驟S22之技術內容。
Specifically, as shown in FIG. 1 and FIG. 2 , the
[1]圖2之步驟S11:由傳送裝置10輸入包括原始信號A之二元影像X。在本實施例中,採取具有長(如橫向)與寬(如縱向)皆為N=5個點之二元影像X,亦即包括N乘N個點(如N*N=5*5=25個點)之原始信號A之二元影像X。例如,下述二元影像X之第一列至第五列之原始信號A分別為(1 0 0 1 0)、(1 1 1 1 1)、(0 1 0 0 0)、(1 1 0 0 1)、(0 0 0 0 0)。
[1] Step S11 of FIG. 2: A binary image X including an original signal A is inputted from the
包括原始信號A之二元影像X: Binary image X including original signal A:
本發明亦可用X(n1,n2)表示二元影像X之N個點(如5個點)之任一者之原始信號A,例如:n1為二元影像X之N個點(如5個點)之任一者之列位置,n2為二元影像X之N個點(如5個點)之任一者之行位置,且n1與n2皆為0至N-1其中一者之值(即0,1,2,3,...,N-1),在本實施例中,n1與n2皆為0,1,2,3,4。例如,在上述二元影像X之第一列(如橫向第一列)中,X(0,0)=1、X(0,1)=0、X(0,2)=0、X(0,3)=1、X(0,4)=0;在二元影像X之第二列(如橫向第二列)中,X(1,0)=X(1,1)=X(1,2)=X(1,3)=X(1,4)=1,以此類推。 The present invention may also use X(n1, n2) to represent the original signal A of any one of the N points (e.g., 5 points) of the binary image X. For example, n1 is the column position of any one of the N points (e.g., 5 points) of the binary image X, n2 is the row position of any one of the N points (e.g., 5 points) of the binary image X, and n1 and n2 are both values from 0 to N-1 (i.e., 0, 1, 2, 3, ..., N-1). In this embodiment, n1 and n2 are both 0, 1, 2, 3, 4. For example, in the first row (such as the first row in the horizontal direction) of the binary image X, X(0,0)=1, X(0,1)=0, X(0,2)=0, X(0,3)=1, X(0,4)=0; in the second row (such as the second row in the horizontal direction) of the binary image X, X(1,0)=X(1,1)=X(1,2)=X(1,3)=X(1,4)=1, and so on.
[2]圖2之步驟S12:由傳送裝置10之頻譜轉換模組11透過下列二維離散傅立葉轉換法12將二元影像X進行二維離散傅立葉轉換(Two-Dimensional Discrete Fourier Transform;2DDFT),以得到包括N乘N個點(如N*N=5*5=25個點)之二維離散傅立葉轉換係數B之頻譜Y。
[2] Step S12 of FIG. 2: The
二維離散傅立葉轉換法12: Two-dimensional discrete Fourier transform method12:
上述二維離散傅立葉轉換法12中,Y為頻譜,N為質數。n1為二元影像X之N個點(如5個點)之任一者之列位置,n2為二元影像X之N個點(如5個點)之任一者之行位置。n1、n2、k1與k2皆為0至N-1其中一者之值(即0,1,2,3,...,N-1),在本實施例中,n1、n2、k1與k2皆為0,
1,2,3,4。WN=e2πi/N,e為自然對數,π為圓周率,i為根號負1。
In the above two-dimensional discrete
例如,頻譜轉換模組11可透過二維離散傅立葉轉換法12將二元影像X進行二維離散傅立葉轉換(2DDFT),以得到下列包括N乘N個點(如N*N=5*5=25個點)之二維離散傅立葉轉換係數B之頻譜Y。在本實施例中,二維離散傅立葉轉換係數B可包括11、0.309-3.5797i、-0.809-4.8410i、-0.809-4.8410i、0.309+3.5797i、2.118-0.3633i、-1.9271+2.1266i...等,共25個點,其中i為虛數(即根號負1)。
For example, the
包括N乘N個點之二維離散傅立葉轉換係數B之頻譜Y: The spectrum Y of the two-dimensional discrete Fourier transform coefficient B consisting of N times N points:
[3]圖2之步驟S13:由傳送裝置10之取樣模組13利用取樣法14對包括N*N個點之二維離散傅立葉轉換係數B之頻譜Y進行取樣,以得到包括N+2個點(如5+2=7個點)之二維離散傅立葉轉換係數B與N*N-(N+2)個點(如5*5-(5+2)=18個點)之0(零)之取樣頻譜Z(即對頻譜Y之取樣結果)。
[3] Step S13 of Figure 2: The sampling
例如,取樣模組13之取樣法14可對頻譜Y之第一行取樣第一個點之二維離散傅立葉轉換係數B(如11)與第二個點至第N個點之一者(如第二個點)之二維離散傅立葉轉換係數B(如0.309-3.5797i),並對頻譜Y之第二行至第N行之一者(如第二行)取樣全部N個點(如5個點)之二維離散傅立葉轉換係數B(如2.118-0.3633i、-1.9271+2.1266i、1.6910-0.9511i、
-0.118+1.5388i、-0.809+0.5878i),其中i為虛數(即根號負1)。亦即,取樣模組13之取樣法14可對頻譜Y總共取樣N+2個點(如5+2=7個點)之二維離散傅立葉轉換係數B。
For example, the
同時,在取樣模組13之取樣法14對頻譜Y取樣第一行之第一個點與第二個點至第N個點之一者(如第二個點)以及第二行至第N行之一者(如第二行)之全部N個點之二維離散傅立葉轉換係數B後,對於頻譜Y之第一行之第一個點與第二個點至第N個點之一者(如第二個點)以外的點(如第三個點至第N個點)以及第二行至第N行之一者以外(如第三行至第五行)的點,皆毋須取樣二維離散傅立葉轉換係數B而改用0(零)取代之。
At the same time, after the
在本實施例中,傳送裝置10之取樣模組13之取樣法14對頻譜Y之取樣結果,可為下列包括N+2個點(如5+2=7個點)之二維離散傅立葉轉換係數B與N*N-(N+2)個點(如5*5-(5+2)=18個點)之0(零)之取樣頻譜Z。
In this embodiment, the sampling result of the
包括N+2個點之二維離散傅立葉轉換係數B與N*N-(N+2)個點之0(零)之取樣頻譜Z: Including the two-dimensional discrete Fourier transform coefficients B of N+2 points and the sampling spectrum Z of 0 (zero) of N*N-(N+2) points:
[4]圖2之步驟S14:由傳送裝置10之頻譜傳送模組15傳送上述包括N+2個點之二維離散傅立葉轉換係數B與N*N-(N+2)個點之0(零)之取樣頻譜Z。
[4] Step S14 of Figure 2: The
[5]圖2之步驟S21:由接收裝置20之頻譜接收模組21接收傳送裝置10之頻譜傳送模組15所傳送之包括N+2個點之二維離散傅立葉轉換係數B與N*N-(N+2)個點之0(零)之取樣頻譜Z。
[5] Step S21 of Figure 2: The
[6]圖2之步驟S22:由接收裝置20之還原模組22之還原方法23依據包括N+2個點之二維離散傅立葉轉換係數B之取樣頻譜Z還原出傳送裝置10所輸入之二元影像X。
[6] Step S22 of Figure 2: The
圖3為本發明所述之一種還原二元影像之系統1及方法中,有關圖1與圖2(如步驟S22)所示還原模組22或其還原方法23之實施流程示意圖。同時,在圖3中,還原模組22或其還原方法23之細部實施流程可包括下列步驟S31至步驟S36。
FIG3 is a schematic diagram of the implementation process of the
[1]如圖3之步驟S31所示,當接收裝置20之頻譜接收模組21接收到包括N+2個點之二維離散傅立葉轉換係數B與N*N-(N+2)個點之0(零)之取樣頻譜Z時,由接收裝置20之還原模組22之還原方法23從取樣頻譜Z之第二行至第N行之一者(如第二行)中取得包括N個點之二維離散傅立葉轉換係數B之頻譜z。
[1] As shown in step S31 of FIG. 3 , when the
例如,接收裝置20之還原模組22之還原方法23可從取樣頻譜Z之第二行至第N行之一者(如第二行)中取得包括N個點(如5個點)之二維離散傅立葉轉換係數B以作為頻譜z,亦即頻譜z可包括N個點(如5個點)之二維離散傅立葉轉換係數B。在本實施例中,還原模組22之還原方法23從取樣頻譜Z之第二行至第N行之一者(如第二行)中所取得之頻譜z之二維離散傅立葉轉換係數B可包括2.118-0.3633i、-1.9271+2.2166i、1.6910-0.9511i、-0.118+1.5388i、-0.809+0.5878i,如下所示。
For example, the
從取樣頻譜Z之第二行至第N行之一者(如第二行)所取得之頻譜z:包括N個點(如5個點)之二維離散傅立葉轉換係數B。 The spectrum z obtained from the second row to one of the Nth rows (such as the second row) of the sampling spectrum Z: includes two-dimensional discrete Fourier transform coefficients B of N points (such as 5 points).
[2]如圖3之步驟S32所示,接收裝置20之還原模組22可將從取樣頻譜Z之第二行至第N行之一者(如第二行)中所取得之頻譜z視為一維(因只有一行),故還原模組22可利用下列一維離散傅立葉反轉換法24對包括N個點(如5個點)之二維離散傅立葉轉換係數B之頻譜z進行一維離散傅立葉反轉換,以得到包括N個點(如5個點)之一維係數y(n)之一維頻譜y(如中介頻譜或中介向量)。
[2] As shown in step S32 of FIG. 3 , the
一維離散傅立葉反轉換法24: One-dimensional discrete Fourier inverse transform method24:
上述一維離散傅立葉反轉換法24中,y為一維頻譜(如中介頻譜或中介向量),N為質數,k與n皆為0至N-1之任一者之值(即0,1,2,3,...,N-1)。z為取樣頻譜Z之第二行至第N行之一者(如第二行)之頻譜並包括N個點(如5個點)之二維離散傅立葉轉換係數B。WN=e2πi/N,e為自然對數,π為圓周率,i為根號負1。
In the above one-dimensional discrete Fourier
因此,在本實施例中,還原模組22可利用一維離散傅立葉反轉換法24以得到下列包括N個點(如5個點)之一維係數y(n)之一維頻譜y(如中介頻譜或中介向量)。例如,一維頻譜y之N個點之一維係數y(n)可
包括0.19+0.5878i、0、0.3090-0.9511i、1.6180-0.0000i、0。
Therefore, in this embodiment, the
包括N個點之一維係數y(n)之一維頻譜y: A one-dimensional spectrum y including N points and one-dimensional coefficients y(n):
[3]如圖3之步驟S33至步驟S36所示,接收裝置20之還原模組22(還原方法23)可判斷一維頻譜y(如中介頻譜或中介向量)之N個點(如5個點)之任一者之一維係數y(n)為非0(非零)或為0(零),亦即y(n)≠0或y(n)=0?
[3] As shown in steps S33 to S36 of FIG. 3 , the restoration module 22 (restoration method 23) of the receiving
當接收裝置20之還原模組22(還原方法23)判斷出一維頻譜y之N個點之任一者(如第一個點/第三個點/第四個點)之一維係數y(n)為非0(即y(n)≠0)時,還原模組22(還原方法23)可對為非0之一維係數y(n)執行如步驟S34所示一維信號還原作業25,以得到如步驟S36所示二元影像X之原始信號A之還原結果。反之,當還原模組22(還原方法23)判斷出一維頻譜之N個點之任一者(如第二個點/第五個點)之一維係數y(n)為0(即y(n)=0)時,還原模組22(還原方法23)可對為0之一維係數y(n)執行如步驟S35所示等候再還原作業26,以得到如步驟S36所示二元影像X之原始信號A之還原結果。例如,上述y(n)可為下列之y(1)、y(2)、y(3)、y(4)或y(5),但不以此為限。
When the restoration module 22 (restoration method 23) of the receiving
再者,當接收裝置20之還原模組22判斷出一維頻譜y之N個點之任一者(如第一個點/第三個點/第四個點)之一維係數y(n)為非0(非零)
時,還原模組22可利用查表法27對一維頻譜y之N個點之任一者(如第一個點/第三個點/第四個點)中為非0之一維係數y(n)執行一維信號還原作業25,以從一維頻譜y之N個點之任一者(如第一個點/第三個點/第四個點)中為非0之一維係數y(n)對應推得或還原出二元影像X之任一列(如第一列/第三列/第四列)之原始信號A。又,當接收裝置20之還原模組22判斷出一維頻譜y之N個點之任一者(如第二個點/第五個點)之一維係數y(n)為0(零)時,還原模組22(還原方法23)可對一維頻譜y之N個點之任一者(如第二個點/第五個點)中為0之一維係數y(2)執行等候再還原作業26,以對應推得或還原出二元影像X之任一列(如第二列/第五列)之原始信號A。對此,茲舉例說明如下列[3-1]至[3-5]所述之技術內容。
Furthermore, when the
[3-1]上述包括N個點之一維係數y(n)之一維頻譜y中,第一個點之一維係數y(1)=0.1910+0.5878i。由於一維頻譜y之第一個點之一維係數y(1)為非0(非零),故還原模組22可於步驟S34中對一維頻譜y之第一個點之一維係數y(1)執行一維信號還原作業25,以從一維頻譜y之第一個點之一維係數y(1)中對應推得或還原出二元影像X之第一列之原始信號A。例如,還原模組22可利用查表法27依據下列表1之內容對一維頻譜y之第一個點之一維係數y(1)執行一維信號還原作業25,以利用查表法27從一維頻譜y之第一個點之一維係數y(1)中成功地對應推得或還原出二元影像X之第一列之原始信號A為(1 0 0 1 0)。
[3-1] In the one-dimensional spectrum y including the one-dimensional coefficients y(n) of N points, the one-dimensional coefficient y(1) of the first point is 0.1910+0.5878i. Since the one-dimensional coefficient y(1) of the first point of the one-dimensional spectrum y is non-zero, the
表1:用於查表法27之對應表。例如,當N=5時,二元影像X之原始信號A與一維離散傅立葉反轉換法24之一維係數y(n)所組成之對應表。
[3-2]上述包括N個點之一維係數y(n)之一維頻譜y中,第二個點之一維係數y(2)=0。由於一維頻譜y之第二個點之一維係數y(2)為0(零),故還原模組22(還原方法23)可於步驟S35中對一維頻譜y之第二個點之一維係數y(2)執行後續之等候再還原作業26。
[3-2] In the one-dimensional spectrum y including the one-dimensional coefficients y(n) of N points, the one-dimensional coefficient y(2) of the second point is 0. Since the one-dimensional coefficient y(2) of the second point of the one-dimensional spectrum y is 0 (zero), the restoration module 22 (restoration method 23) can perform the subsequent waiting and restoring
[3-3]上述包括N個點之一維係數y(n)之一維頻譜y中,第三個點之一維係數y(3)=0.3090-0.9511i。由於一維頻譜y之第三個點之一維係數y(3)為非0(非零),故還原模組22可於步驟S34中對一維頻譜y之第三個點之一維係數y(3)執行一維信號還原作業25,以從一維頻譜y之第三個點之一維係數y(3)中對應推得或還原出二元影像X之第三列之原始信號A。例如,還原模組22可利用查表法27依據上述表1之內容對一維頻譜y之第三個點之一維係數y(3)執行一維信號還原作業25,以利用查表法27從一維頻譜y之第三個點之一維係數y(3)中成功地對應推得或還原出二元
影像X之第三列之原始信號A為(0 1 0 0 0)。
[3-3] In the one-dimensional spectrum y including the one-dimensional coefficients y(n) of N points, the one-dimensional coefficient y(3) of the third point is 0.3090-0.9511i. Since the one-dimensional coefficient y(3) of the third point of the one-dimensional spectrum y is non-zero, the
[3-4]上述包括N個點之一維係數y(n)之一維頻譜y中,第四個點之一維係數y(4)=1.6180-0.0000i(即1.6180)。由於一維頻譜y之第四個點之一維係數y(4)為非0(非零),故還原模組22可於步驟S34中對一維頻譜y之第四個點之一維係數y(4)執行一維信號還原作業25,以從一維頻譜y之第四個點之一維係數y(4)中對應推得或還原出二元影像X之第四列之原始信號A。例如,還原模組22可利用查表法27依據上述表1之內容對一維頻譜y之第四個點之一維係數y(4)執行一維信號還原作業25,以利用查表法27從一維頻譜y之第四個點之一維係數y(4)中成功地對應推得或還原出二元影像X之第四列之原始信號A為(1 1 0 0 1)。
[3-4] In the one-dimensional spectrum y including the one-dimensional coefficients y(n) of N points, the one-dimensional coefficient y(4) of the fourth point is 1.6180-0.0000i (i.e., 1.6180). Since the one-dimensional coefficient y(4) of the fourth point of the one-dimensional spectrum y is non-zero, the
[3-5]上述包括N個點之一維係數y(n)之一維頻譜y中,第五個點之一維係數y(5)=0。由於一維頻譜y之第五個點之一維係數y(5)為0(零),故還原模組22(還原方法23)可於步驟S35中對一維頻譜y之第五個點之一維係數y(5)執行後續之等候再還原作業26。
[3-5] In the one-dimensional spectrum y including the one-dimensional coefficients y(n) of N points, the one-dimensional coefficient y(5) of the fifth point is 0. Since the one-dimensional coefficient y(5) of the fifth point of the one-dimensional spectrum y is 0 (zero), the restoration module 22 (restoration method 23) can perform the subsequent waiting and restoring
然後,由於上述包括N個點之一維係數y(n)之一維頻譜y只有5個點,已經沒有下一個點了。因此,還原模組22毋須再等候,並立即開始對上述一維頻譜y之第二個點之一維係數y(2)與第五個點之一維係數y(5)執行等候再還原作業26。
Then, since the one-dimensional spectrum y including the one-dimensional coefficients y(n) of N points has only 5 points, there is no next point. Therefore, the
舉例而言,如圖3之步驟S35所示等候再還原作業26,還原模組22(還原方法23)可對例如y(2)=0與y(5)=0執行下列等候再還原作業26之還原程序P1至還原程序P3。
For example, as shown in step S35 of FIG. 3 , the recovery module 22 (recovery method 23) can execute the following recovery procedures P1 to P3 of the waiting
還原程序P1:還原模組22(還原方法23)可將已還原之二元 影像X之各列之原始信號A(如第一列之原始信號A為(1 0 0 1 0)、第三列之原始信號A為(0 1 0 0 0)、第四列之原始信號A為(1 1 0 0 1))先分別進行橫向加總,以得到已還原之二元影像X之各列(如第一列、第三列、第四列)之橫向加總結果(如2、1、3)。同時,還原模組22(還原方法23)可將未還原之二元影像X之各列(如第二列、第五列)之部分(如未還原之信號)皆以變數(如v2、v5)取代。因此,還原模組22(還原方法23)可得到下列之一維信號V(因只有一行)。 Restoration procedure P1: The restoration module 22 (restoration method 23) can perform horizontal summation on the original signal A of each column of the restored binary image X (such as the original signal A of the first column is (1 0 0 1 0), the original signal A of the third column is (0 1 0 0 0), and the original signal A of the fourth column is (1 1 0 0 1)) to obtain the horizontal summation results (such as 2, 1, 3) of each column (such as the first column, the third column, and the fourth column) of the restored binary image X. At the same time, the restoration module 22 (restoration method 23) can replace the part (such as the unrestored signal) of each column (such as the second column and the fifth column) of the unrestored binary image X with variables (such as v2, v5). Therefore, the restoration module 22 (restoration method 23) can obtain the following one-dimensional signal V (because there is only one row).
一維信號V: One-dimensional signal V:
還原程序P2:由上述y(2)=y(5)=0與表1所載用於查表法27之對應表之內容可得知,二元影像X之第二列或第五列之原始信號A一定是(0 0 0 0 0)或(1 1 1 1 1),且一維信號V之變數v2或變數v5於橫向加總後之值必定為0與5其中一者。因此,一維信號V之變數v2與變數v5總共只有四種可能性,亦即:(1)第一種可能性為v2=0與v5=0,(2)第二種可能性為v2=5與v5=0,(3)第三種可能性為v2=0與v5=5,(4)第四種可能性為v2=5與v5=5。
Restoration procedure P2: From the above y(2)=y(5)=0 and the contents of the corresponding table for
還原程序P3:由取樣頻譜Z之二維離散傅立葉轉換係數B之性質可得知,一維信號V之變數v2與變數v5之二個一維離散傅立葉轉換係數即是取樣頻譜Z之第一行之二個二維離散傅立葉轉換係數B,故還原
模組22可利用窮舉法28逐一檢查下列四種可能性。
Restoration procedure P3: From the properties of the two-dimensional discrete Fourier transform coefficient B of the sampling spectrum Z, it can be known that the two one-dimensional discrete Fourier transform coefficients of the variable v2 and the variable v5 of the one-dimensional signal V are the two two-dimensional discrete Fourier transform coefficients B of the first row of the sampling spectrum Z, so the
(1)第一種可能性:還原模組22可利用窮舉法28檢查一維信號V之v2=0與v5=0,亦即一維信號V如下:
(1) The first possibility: The
例如,還原模組22利用窮舉法28檢查於一維信號V之v2=0與v5=0時,可以得到一維信號V之二個一維離散傅立葉轉換係數分別為6.0000+0i與-1.2361+1.1756i,故還原模組22可進一步比對出一維信號V之二個一維離散傅立葉轉換係數與上述取樣頻譜Z之第一行之二個二維離散傅立葉轉換係數B(如11與0.309-3.5797i)不符合。
For example, the
(2)第二種可能性:還原模組22可利用窮舉法28檢查一維信號V之v2=5與v5=0,亦即一維信號V如下:
(2) The second possibility: The
例如,還原模組22利用窮舉法28檢查於一維信號V之v2=5與v5=0時,可以得到一維信號V之二個一維離散傅立葉轉換係數分別為11.0000+0i(即11)與0.3090-3.5797i,故還原模組22可進一步比對出一維信號V之二個一維離散傅立葉轉換係數與上述取樣頻譜Z之第一行之二個二維離散傅立葉轉換係數B(如11與0.309-3.5797i)相符合。
For example, the
因此,一維信號V之二個一維離散傅立葉轉換係數分別為
11.0000+0i(即11)與0.3090-3.5797i,此與上述取樣頻譜Z之第一行之二個二維離散傅立葉轉換係數B(如11與0.309-3.5797i)相符合,故還原模組22利用窮舉法28所得到之答案為v2=5與v5=0。換言之,二元影像X之第二列之原始信號A是由5個1構成(1 1 1 1 1),且二元影像X之第五列之原始信號是由5個0構成(0 0 0 0 0)。
Therefore, the two one-dimensional discrete Fourier transform coefficients of the one-dimensional signal V are respectively
11.0000+0i (i.e. 11) and 0.3090-3.5797i, which are consistent with the two two-dimensional discrete Fourier transform coefficients B (i.e. 11 and 0.309-3.5797i) of the first row of the above-mentioned sampling spectrum Z, so the answer obtained by the
(3)第三種可能性與(4)第四種可能性:由於還原模組22已利用窮舉法28得到答案為v2=5與v5=0,故還原模組22可以不必再進一步檢查第三種可能性與第四種可能性。
(3) The third possibility and (4) the fourth possibility: Since the
至此,還原模組22已經完全還原了二元影像X,如下所示。
At this point, the
已還原之二元影像X: The restored binary image X:
本發明之實施例中,係以具有長與寬之邊長皆為質數N個點(如N=5,共N*N=5*5=25個點)之二元影像X作例子。但對於具有長與寬之邊長皆為質數N之倍數個點(如mN=2*5=10,倍數m=2,質數N=5,共mN*mN=10*10=100個點)之二元影像X,本發明亦可採取平移取樣技術加以推廣並據以實施。 In the embodiment of the present invention, a binary image X with both length and width being prime number N points (such as N=5, a total of N*N=5*5=25 points) is used as an example. However, for a binary image X with both length and width being multiples of prime number N points (such as mN=2*5=10, multiple m=2, prime number N=5, a total of mN*mN=10*10=100 points), the present invention can also be extended and implemented by using translation sampling technology.
舉例而言,對於具有長與寬之邊長皆為質數N之倍數個點(如mN=2*5=10,共mN*mN=10*10=100個點)之二元影像X,傳送裝置10之取樣模組13可採取平移取樣技術以對具有長與寬之邊長皆為質數N之倍數
個點(如mN*mN=10*10個點)之二元影像X進行取樣。例如,在二元影像X中,S代表取樣(Sample),H代表不取樣(Hide)。
For example, for a binary image X with a length and width that are both multiples of prime number N (e.g., mN=2*5=10, a total of mN*mN=10*10=100 points), the
平移取樣技術:對具有長與寬之邊長皆為質數N之倍數個點之二元影像X之取樣。 Translational sampling technique: sampling of a binary image X with points whose length and width are both multiples of the prime number N.
從傳送裝置10之取樣模組13採取平移取樣技術以對具有長與寬之邊長皆為質數N之倍數個點(如mN*mN=10*10個點)之二元影像X之取樣中,可以發現具有長與寬之邊長皆為質數N之倍數個點(如mN*mN=10*10個點)之二元影像X中左上角、右上角、左下角與右下角共四組之N*N個點(如5*5個點),均與上方取樣模組13之取樣法14對於具有長與寬之邊長皆為質數N個點(如5*5個點)之二元影像X一致。因此,接收裝置20之還原模組22可採取平移取樣技術,以將具有長與寬之邊長皆為質數N之倍數個點(如mN*mN=10*10個點)之二元影像X之還原方式(還原問題)轉變成多組具有長與寬之邊長皆為質數N個點(如4組具有5*5個點)之二元影像X之還原方式(還原問題)。
From the
這種將具有長與寬之邊長皆為質數N之倍數個點(如mN* mN=10*10個點)之二元影像X之還原方式(還原問題)轉變成多組具有長與寬之邊長皆為質數N個點(如4組具有5*5個點)之二元影像X之還原方式(還原問題)之原理如下。例如,以一維mN個點(如mN=2*5=10個點)之原始序列(頻譜)轉變成二組N個點(如5個點)之序列(頻譜)來說明,而二維影像X則可採用相同或相似方式獲得。 The principle of this method of converting the restoration method (restoration problem) of a binary image X with both length and width points that are multiples of prime number N (such as mN* mN=10*10 points) into the restoration method (restoration problem) of multiple sets of binary images X with both length and width points that are prime number N (such as 4 sets of 5*5 points) is as follows. For example, the original sequence (spectrum) of one-dimensional mN points (such as mN=2*5=10 points) is converted into a sequence (spectrum) of two sets of N points (such as 5 points), and the two-dimensional image X can be obtained by the same or similar method.
[1]原始序列:假設傳送裝置10具有一維mN個點(如倍數m=2,質數N=5,mN=2*5=10個點)之原始序列並表示為x(n),其中n=0,1,2,3,4,5,6,7,8,9。
[1] Original sequence: Assume that the
[2]分割序列:接收裝置20之還原模組22(還原方法23)可將傳送裝置10之一維mN個點(如m*N=2*5=10個點)之原始序列分成二組N個點(如5個點)之序列,且二組N個點(如N=5個點)之序列分別稱為序列x1(n)與序列x2(n)。例如,x1(n)=x(0),x(2),x(4),x(6),x(8),且x2(n)=x(1),x(3),x(5),x(7),x(9)。
[2] Sequence segmentation: The restoration module 22 (restoration method 23) of the receiving
[3]計算一維係數:還原模組22(還原方法23)可分別計算二組N個點(如5個點)之序列x1(n)與x2(n)之一維係數,例如一維係數為一維離散傅立葉轉換係數(簡稱DFT)。假設二組N個點(如5個點)之序列x1(n)與序列x2(n)之一維係數(如DFT)之計算結果分別為y1(k)與y2(k),y1(k)=DFT(x1(n)),y2(k)=DFT(x2(n)),且k=0,1,2,3,4。 [3] Calculation of one-dimensional coefficients: The reduction module 22 (reduction method 23) can calculate the one-dimensional coefficients of two sets of N points (e.g., 5 points) of sequences x1(n) and x2(n), for example, the one-dimensional coefficients are one-dimensional discrete Fourier transform coefficients (abbreviated as DFT). Assume that the calculation results of the one-dimensional coefficients (e.g., DFT) of the two sets of N points (e.g., 5 points) of sequences x1(n) and x2(n) are y1(k) and y2(k), y1(k)=DFT(x1(n)), y2(k)=DFT(x2(n)), and k=0,1,2,3,4.
[4]組合結果:還原模組22(還原方法23)可將二組N個點(如5個點)之序列x1(n)與序列x2(n)之一維係數(如DFT)之計算結果組合成10個點之一維係數(如DFT),這可以通過下列方式完成。 [4] Combination results: The reduction module 22 (reduction method 23) can combine the calculation results of the one-dimensional coefficients (such as DFT) of two sets of N points (such as 5 points) sequence x1(n) and sequence x2(n) into a one-dimensional coefficient (such as DFT) of 10 points. This can be achieved in the following way.
例如,對於k=0,1,2,3,4而言,二個計算公式分別為y(k) =y1(k)+WN k y2(k)與y(k+5)=y1(k)-WN k y2(k),y就是x之mN個點(如2*5=10個點)之一維係數(如DFT)。反之,如果已經有了y(k)與y(k+5),則可以利用二個計算公式y(k)=y1(k)+WN k y2(k)與y(k+5)=y1(k)-WN k y2(k),反向求得y1(k)與y2(k)。 For example, for k=0,1,2,3,4, the two calculation formulas are y(k)=y1(k)+W N k y2(k) and y(k+5)=y1(k)-W N k y2(k), where y is the one-dimensional coefficient (such as DFT) of mN points (such as 2*5=10 points) of x. On the contrary, if y(k) and y(k+5) are already available, the two calculation formulas y(k)=y1(k)+W N k y2(k) and y(k+5)=y1(k)-W N k y2(k) can be used to reversely obtain y1(k) and y2(k).
因此,上述[1]至[4]之內容,即為利用一維mN個點(如mN=2*5=10個點)之原始序列(頻譜)轉變成二組N個點(如5個點)之序列(頻譜)之方法。 Therefore, the contents of [1] to [4] above are methods for converting an original sequence (spectrum) of one-dimensional mN points (e.g. mN=2*5=10 points) into a sequence (spectrum) of two groups of N points (e.g. 5 points).
此外,本發明還提供針對一種還原二元影像之方法之電腦可讀媒介,係應用於具有處理器與記憶體之計算裝置或電腦中,且電腦可讀媒介儲存有指令,並可利用計算裝置或電腦透過處理器與記憶體執行電腦可讀媒介,以於執行電腦可讀媒介時執行上述內容。在一實施例中,該還原二元影像之方法係從二維離散傅立葉轉換係數還原二元影像之方法。在另一實施例中,該電腦可讀媒介係非暫時性(non-transitory)的電腦可讀儲存媒介。 In addition, the present invention also provides a computer-readable medium for a method of restoring a binary image, which is applied to a computing device or a computer having a processor and a memory, and the computer-readable medium stores instructions, and the computing device or the computer can execute the computer-readable medium through the processor and the memory to execute the above content when executing the computer-readable medium. In one embodiment, the method of restoring a binary image is a method of restoring a binary image from a two-dimensional discrete Fourier transform coefficient. In another embodiment, the computer-readable medium is a non-transitory computer-readable storage medium.
在一實施例中,處理器可為中央處理器(CPU)、圖形處理器(GPU)、微處理器(MPU)、微控制器(MCU)等,記憶體可為隨機存取記憶體(RAM)、唯讀記憶體(ROM)、快閃(Flash)記憶體、記憶卡、硬碟(如雲端/網路/外接式硬碟)、光碟、隨身碟、資料庫等,且計算裝置或電腦可為計算機、智慧型手機、平板電腦、個人電腦、筆記型電腦、桌上型電腦、伺服器(如雲端/遠端/網路伺服器)等。 In one embodiment, the processor may be a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MPU), a microcontroller (MCU), etc., the memory may be a random access memory (RAM), a read-only memory (ROM), a flash memory, a memory card, a hard drive (such as a cloud/network/external hard drive), an optical disk, a flash drive, a database, etc., and the computing device or computer may be a computer, a smartphone, a tablet computer, a personal computer, a laptop, a desktop computer, a server (such as a cloud/remote/network server), etc.
綜上,本發明所述之還原二元影像之系統、方法及電腦可讀媒介係至少具有下列特色、優點或技術功效。 In summary, the system, method and computer-readable medium for restoring binary images described in the present invention have at least the following characteristics, advantages or technical effects.
一、本發明能在已知影像為二元影像之情況下,傳送裝置只 需從二元影像之頻譜中選取N+2個點或以上(大約或最少6%)之二維離散傅立葉轉換係數以傳送至接收裝置,俾利接收裝置之還原模組(還原方法)能迅速地還原出傳送裝置所輸入之二元影像而完全不會失真。 1. The present invention enables, when it is known that the image is a binary image, the transmitting device only needs to select N+2 points or more (approximately or at least 6%) of two-dimensional discrete Fourier transform coefficients from the spectrum of the binary image to transmit to the receiving device, so that the restoration module (restoration method) of the receiving device can quickly restore the binary image input by the transmitting device without any distortion.
二、本發明能在二元影像之頻譜遭到嚴重破壞之情況下,接收裝置之還原模組(還原方法)只需使用二元影像之頻譜中N+2個點或以上(大約或最少6%)之二維離散傅立葉轉換係數(如頻譜係數或頻譜資訊),即能迅速地還原出二元影像。 2. The present invention can restore the binary image quickly when the spectrum of the binary image is severely damaged. The restoration module (restoration method) of the receiving device only needs to use the two-dimensional discrete Fourier transform coefficients (such as spectrum coefficients or spectrum information) of N+2 points or more (approximately or at least 6%) in the spectrum of the binary image.
三、本發明對於一個具有N*N個點之二元影像,只需從二元影像之頻譜中抽取N+2個點或以上(大約或最少6%)之二維離散傅立葉轉換係數,即能迅速地無損還原出二元影像。例如,在19乘19(即19*19)之二元影像之還原時間(運算時間)上,習知技術需要90秒之還原時間,但本發明只需要不到2秒之還原時間,故本發明只需花費習知技術之1/45的還原時間。 3. For a binary image with N*N points, the present invention only needs to extract N+2 points or more (approximately or at least 6%) of two-dimensional discrete Fourier transform coefficients from the spectrum of the binary image to quickly and losslessly restore the binary image. For example, the restoration time (computation time) of a 19x19 (i.e. 19*19) binary image requires 90 seconds of restoration time according to the known technology, but the present invention only requires less than 2 seconds of restoration time, so the present invention only needs 1/45 of the restoration time of the known technology.
四、本發明之接收裝置之還原模組能在幾秒內(如2秒內)之還原時間還原出傳送裝置所輸入之二元影像,明顯優於習知技術需要90秒之還原時間。 4. The restoration module of the receiving device of the present invention can restore the binary image input by the transmitting device within a few seconds (e.g., within 2 seconds), which is significantly better than the restoration time of 90 seconds required by the conventional technology.
五、本發明對於具有長與寬之邊長皆為質數N之倍數個點(如mN*mN=38*38)之二元影像之情況,其中m為倍數(如m=2)且N為質數(如N=19),能採用平移取樣技術以取樣(N+2)m2(如21*22=84)個二維離散傅立葉轉換係數即可還原二元影像,且二元影像之頻譜之二維離散傅立葉轉換係數之取樣率同樣只需大約6%。 5. For a binary image with both long and wide sides being multiples of a prime number N (e.g., mN*mN=38*38), where m is a multiple (e.g., m=2) and N is a prime number (e.g., N=19), the present invention can use a translation sampling technique to sample (N+2)m 2 (e.g., 21*2 2 =84) two-dimensional discrete Fourier transform coefficients to restore the binary image, and the sampling rate of the two-dimensional discrete Fourier transform coefficients of the frequency spectrum of the binary image only needs to be about 6%.
六、本發明在例如電腦斷層掃描之二元影像上,只需要使用 N+2個點或以上(大約或最少6%)之二維離散傅立葉轉換係數即能還原二元影像,以利減少電腦斷層掃描之量測次數。 6. The present invention can restore the binary image by using only N+2 points or more (approximately or at least 6%) of two-dimensional discrete Fourier transform coefficients on binary images such as computer tomography scans, thereby reducing the number of measurements of computer tomography scans.
七、本發明能利用例如快速響應碼(QR code)是二元影像之特性,以利減少傳送裝置之取樣模組(取樣法)對二元影像取樣所需之二維離散傅立葉轉換係數之個數,且即便二元影像遭到嚴重破壞,接收裝置之還原模組(還原方法)亦能迅速地還原此二元影像。 7. The present invention can utilize the characteristics of a quick response code (QR code) being a binary image to reduce the number of two-dimensional discrete Fourier transform coefficients required by the sampling module (sampling method) of the transmitting device to sample the binary image, and even if the binary image is severely damaged, the restoration module (restoration method) of the receiving device can quickly restore the binary image.
八、本發明可能應用之產業為例如醫療業、手機之相機晶片模組等,且可能應用之產品為例如斷層掃描儀、有關快速響應碼(QR code)之掃描模組等,但不以此為限。 8. The present invention may be applied to industries such as the medical industry, camera chip modules for mobile phones, etc., and may be applied to products such as tomography scanners, scanning modules for quick response codes (QR codes), etc., but is not limited to these.
上述實施形態僅例示性說明本發明之原理、特點及其功效,並非用以限制本發明之可實施範疇,任何熟習此項技藝之人士均能在不違背本發明之精神及範疇下,對上述實施形態進行修飾與改變。任何使用本發明所揭示內容而完成之等效改變及修飾,均仍應為申請專利範圍所涵蓋。因此,本發明之權利保護範圍應如申請專利範圍所列。 The above implementation forms are only illustrative of the principles, features and effects of the present invention, and are not intended to limit the scope of implementation of the present invention. Anyone familiar with this technology can modify and change the above implementation forms without violating the spirit and scope of the present invention. Any equivalent changes and modifications completed using the content disclosed by the present invention should still be covered by the scope of the patent application. Therefore, the scope of protection of the present invention should be as listed in the scope of the patent application.
1:系統 1: System
10:傳送裝置 10: Transmission device
11:頻譜轉換模組 11: Spectrum conversion module
12:二維離散傅立葉轉換法 12: Two-dimensional discrete Fourier transform method
13:取樣模組 13: Sampling module
14:取樣法 14: Sampling method
15:頻譜傳送模組 15: Spectrum transmission module
20:接收裝置 20: Receiving device
21:頻譜接收模組 21: Spectrum receiving module
22:還原模組 22: Restore module
23:還原方法 23: Restoration method
24:一維離散傅立葉反轉換法 24: One-dimensional discrete Fourier inverse transform method
25:一維信號還原作業 25: One-dimensional signal restoration operation
26:等候再還原作業 26: Wait and restore the operation
27:查表法 27: Table lookup method
28:窮舉法 28: Poor Manners
A:原始信號 A: Original signal
B:二維離散傅立葉轉換係數 B: Two-dimensional discrete Fourier transform coefficient
X:二元影像 X: binary image
Y:頻譜 Y: spectrum
y:一維頻譜 y: one-dimensional spectrum
y(n):一維係數 y(n): one-dimensional coefficient
Z:取樣頻譜 Z: sampling spectrum
z:頻譜 z: spectrum
Claims (15)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW112142681A TWI851470B (en) | 2023-11-06 | 2023-11-06 | System, method and computer readable medium for restoring binary image |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW112142681A TWI851470B (en) | 2023-11-06 | 2023-11-06 | System, method and computer readable medium for restoring binary image |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TWI851470B true TWI851470B (en) | 2024-08-01 |
| TW202520199A TW202520199A (en) | 2025-05-16 |
Family
ID=93283828
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW112142681A TWI851470B (en) | 2023-11-06 | 2023-11-06 | System, method and computer readable medium for restoring binary image |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI851470B (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2010117573A2 (en) * | 2009-04-07 | 2010-10-14 | Virginia Commonwealth University | Automated measurement of brain injury indices using brain ct images, injury data, and machine learning |
| TWI425184B (en) * | 2008-11-26 | 2014-02-01 | Zygo Corp | System, method and apparatus for scan error correction in low coherence scanning interferometry, and process using the same |
| CN109962872A (en) * | 2017-12-14 | 2019-07-02 | 中国舰船研究设计中心 | Phase Noise Suppression Method Based on Iterative Algorithm in DFT-S OFDM System |
| TWI776163B (en) * | 2019-06-07 | 2022-09-01 | 德商卡爾蔡司Smt有限公司 | Method, computer program product, semiconductor inspection device of obtaining a 3d volume image of an integrated semiconductor sample |
-
2023
- 2023-11-06 TW TW112142681A patent/TWI851470B/en active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI425184B (en) * | 2008-11-26 | 2014-02-01 | Zygo Corp | System, method and apparatus for scan error correction in low coherence scanning interferometry, and process using the same |
| WO2010117573A2 (en) * | 2009-04-07 | 2010-10-14 | Virginia Commonwealth University | Automated measurement of brain injury indices using brain ct images, injury data, and machine learning |
| CN109962872A (en) * | 2017-12-14 | 2019-07-02 | 中国舰船研究设计中心 | Phase Noise Suppression Method Based on Iterative Algorithm in DFT-S OFDM System |
| TWI776163B (en) * | 2019-06-07 | 2022-09-01 | 德商卡爾蔡司Smt有限公司 | Method, computer program product, semiconductor inspection device of obtaining a 3d volume image of an integrated semiconductor sample |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202520199A (en) | 2025-05-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11373275B2 (en) | Method for generating high-resolution picture, computer device, and storage medium | |
| Du et al. | Fully convolutional measurement network for compressive sensing image reconstruction | |
| CN112991180B (en) | Image splicing method, device, equipment and storage medium | |
| US20220245764A1 (en) | Method for image super-resolution, device and storage medium | |
| WO2022105638A1 (en) | Image degradation processing method and apparatus, and storage medium and electronic device | |
| WO2018223994A1 (en) | Method and device for synthesizing chinese printed character image | |
| CN114626967B (en) | Digital watermark embedding and extracting method, device, equipment and storage medium | |
| CN108364270B (en) | Color reduction method and device for color cast image | |
| Chen et al. | Naturalization module in neural networks for screen content image quality assessment | |
| US9697584B1 (en) | Multi-stage image super-resolution with reference merging using personalized dictionaries | |
| US11481927B2 (en) | Method and apparatus for determining text color | |
| KR20210116922A (en) | Method and Device for Fast Adaptation through Meta-learning of Super Resolution Model | |
| CN110766153A (en) | Neural network model training method and device and terminal equipment | |
| CN115034967B (en) | Image processing method, device, electronic device and computer readable storage medium | |
| CN111354058A (en) | An image coloring method, device, image acquisition device and readable storage medium | |
| WO2020006962A1 (en) | Method and device for processing picture | |
| CN107220934B (en) | Image reconstruction method and device | |
| TWI851470B (en) | System, method and computer readable medium for restoring binary image | |
| CN115188000B (en) | Text recognition method, device, storage medium and electronic device based on OCR | |
| CN112801879A (en) | Image super-resolution reconstruction method and device, electronic equipment and storage medium | |
| CN111047618A (en) | Multi-scale-based non-reference screen content image quality evaluation method | |
| CN111402276B (en) | A binary image generation method, device, electronic equipment and readable storage medium | |
| CN109685839B (en) | Image alignment method, mobile terminal and computer storage medium | |
| CN114842485B (en) | Subtitle removing method and device and electronic equipment | |
| CN112887726B (en) | Image processing method and apparatus, storage medium, and electronic device |













