CN115409701A - Real number domain high dynamic range blue noise sampling method and system based on error diffusion - Google Patents

Real number domain high dynamic range blue noise sampling method and system based on error diffusion Download PDF

Info

Publication number
CN115409701A
CN115409701A CN202210947433.2A CN202210947433A CN115409701A CN 115409701 A CN115409701 A CN 115409701A CN 202210947433 A CN202210947433 A CN 202210947433A CN 115409701 A CN115409701 A CN 115409701A
Authority
CN
China
Prior art keywords
signal
density
sampling
optimal
error diffusion
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
Application number
CN202210947433.2A
Other languages
Chinese (zh)
Inventor
周秉锋
韩健红
冯洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
Original Assignee
Peking University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Peking University filed Critical Peking University
Priority to CN202210947433.2A priority Critical patent/CN115409701A/en
Publication of CN115409701A publication Critical patent/CN115409701A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4023Scaling of whole images or parts thereof, e.g. expanding or contracting based on decimating pixels or lines of pixels; based on inserting pixels or lines of pixels
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/30Polynomial surface description

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Algebra (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Physics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a real number domain high dynamic range blue noise sampling method and system based on error diffusion, and belongs to the field of computer image processing. Firstly, calculating an optimal density dynamic range, an optimal error diffusion coefficient and a threshold modulation coefficient, and generating an optimal coefficient lookup table; normalizing the input signal, and then scaling the normalized input signal to the optimal density dynamic range to obtain the density of the signal to be sampled; calculating discretization parameters of the signal to be sampled according to the sampling target, and discretizing the signal to be sampled onto a grid to obtain a discretization signal; and scanning the discrete signals according to a certain sequence, accumulating the discrete signal value to be sampled at each grid position and the quantization error diffused by the sampled adjacent grid, generating a sampling point result of the current grid through quantization operation, and diffusing the quantization error of the output signal to the unprocessed grid in the neighborhood according to the optimal error diffusion coefficient. The invention generates continuous domain sampling results, and realizes blue noise sampling with controllable number of sampling points.

Description

Real number domain high dynamic range blue noise sampling method and system based on error diffusion
Technical Field
The invention provides a sampling method for an image, in particular to a blue noise sampling method based on floating point number operation continuous domain error diffusion, and belongs to the field of computer graphics and digital image processing.
Background
In the field of computer graphics and digital image processing, sampling is a fundamental building block used in many research and applications. In computer rendering and digital imaging, including rendering, halftoning, stippling, visualization, animation, etc., all rely on good sampling methods. In addition, sampling is also applied to digital geometric processing, and plays an important role in aspects such as point-based modeling, regridding, surface texture mapping, object distribution, motion planning and the like. In these applications, the nature of the distribution of sampling points will greatly affect the quality and accuracy of the results, and it becomes important how to efficiently generate a high quality distribution of sampling points.
Researchers have found that the best quality random sample point distribution generally has a blue noise property, namely: the low-frequency part of the frequency spectrum has low energy, no visible artificial texture exists, and the energy is radially symmetrical and has good isotropy. The distribution of the sampling points with blue noise properties can present a satisfactory visual effect and is suitable for a large number of practical applications. Over the last three decades, researchers have proposed many excellent blue noise sampling algorithms. From the original Poisson disc sampling method (reference: L. -Y.Wei. "Parallel Poisson disk sampling". ACM Transactions on Graphics,2008,27 (3): 20.
Figure BDA0003788087800000011
and o.deussen. "Capacity-constrained point distributions: a variant of Lloyd's method". ACM Transactions on Graphics,2009,28 (3): 1-8), to sample or rule based generation methods (references: A.G.Ahmed, T.Niese, H.Huang and O.Deussen. "An adaptive point sampler on a regular grid". ACM Transactions on Graphics,2017,36 (4): 1-13) and the like, and meet different application requirements with different advantages. However, some of these methods have good distribution of sampling points but low efficiency, and some methods have high generation speed but the distribution of sampling points is not uniform and isotropic, so that some distinguishable repetitive structures appear. In general, the prior art generally has the following disadvantages: low time efficiency, space generationThe price is high, or the number of sampling points and the frequency spectrum characteristic are not controllable, or the method is only suitable for a specific sampling data field, and the like.
In the field of digital halftoning, error diffusion (reference: B.Zhou and X.Fang. "Improving mid-tone quality of variable-coefficient error dispersion using threshold modulation". ACM Transactions on Graphics,2003,22 (3): 437-444) is a simple and efficient algorithm for sampling the significance of two-dimensional images, and is widely used in color quantization, spatial distribution, printing industry, and display systems. The basic principle of the algorithm is to compare pixel values of an image with a quantization threshold value one by one, then to diffuse quantization errors to adjacent pixels according to a proportional coefficient for compensation, so that the final binary output simulates gray level change of an original image. The key of the error diffusion algorithm is to find a proper scanning path and a set of optimized error diffusion coefficients, so that the generated sampling point set has blue noise characteristics. Because only points in a certain neighborhood need to be considered when sampling, the algorithm is very efficient.
However, the limitations of the conventional error diffusion method are shown in the following aspects: 1. the method is only suitable for image halftoning of 256 gray levels in the printing industry, namely, the sampling density range and the sampling precision are limited, which is the primary factor limiting the application of the method in mathematics and graphics; 2. in terms of blue noise quality, the conventional error diffusion method only shows excellent blue noise quality at a single density level; 3. the traditional error diffusion method is only suitable for two-dimensional discrete images, and the generated result is a two-dimensional image with the same resolution as the input image, so that the number of sampling points exceeding the resolution of the image cannot be generated, and the number of the sampling points cannot be accurately controlled; 4. in the traditional error diffusion method, integers are adopted in the input, output and intermediate processes of calculation, and the generated decimal part is discarded in the calculation process, so that the calculation result is not accurate.
Disclosure of Invention
The invention provides a real number domain high dynamic range blue noise sampling method and system based on error diffusion, which expand the error diffusion method from a discrete domain to a continuous domain, thereby rapidly generating the continuous domain sampling point distribution effect at lower calculation cost and simultaneously maintaining the blue noise characteristic.
The technical scheme provided by the invention is as follows:
a continuous domain error diffusion blue noise sampling method based on floating point number operation is characterized by comprising the following steps:
1) Calculating an optimal density dynamic range, an optimal error diffusion coefficient and a threshold modulation coefficient, and generating an optimal coefficient lookup table;
2) Normalizing the input signal, and then scaling the normalized input signal to the optimal density dynamic range to obtain the density of the signal to be sampled;
3) Calculating discretization parameters of the signal to be sampled according to the sampling target, and discretizing the signal to be sampled onto a grid to obtain a discretization signal;
4) And scanning the discrete signals according to a certain sequence, accumulating the discrete signal value to be sampled at each grid position and the quantization error diffused by the sampled adjacent grids, generating a sampling point result of the current grid through quantization operation, and diffusing the quantization error of the output signal to the unprocessed grid in the neighborhood according to the optimal error diffusion coefficient.
Further, the specific implementation method in the step 1) is as follows: selecting a certain lower density as an upper bound of the optimal density dynamic range to obtain the optimal density dynamic range; a group of key density levels are obtained at fixed intervals in the dynamic range of the optimal density, and an optimal error diffusion coefficient and threshold modulation coefficient lookup table is generated by optimally calculating Fourier transform spectrum performance of sampling results generated at each key density level, so that the optimal error diffusion coefficient and threshold modulation coefficient corresponding to the density can be quickly calculated by the lookup table when any signal density is given.
Further, the specific implementation method in the step 2) is as follows: dividing the input signal by the maximum value of the signal density to obtain the normalized signal density of a real number domain no matter the input signal is an integer value or a decimal value; and multiplying the normalized density by the upper bound of the optimal density dynamic range, and scaling the normalized density into the optimal density dynamic range.
Further, the specific implementation method in the step 3) is as follows:
3-1) calculating the discretization parameters: when an input continuous signal is converted into a discrete signal field with width w and height h, w = a · h when the aspect ratio is known as a; n is generated if the output target is to make the input signal take uniform maximum density 0 A sampling point, then
Figure BDA0003788087800000031
If the output target is that the number of the final output sampling points is N, then
Figure BDA0003788087800000032
Wherein d is 0 For the upper bound of the dynamic range of the optimal density,
Figure BDA0003788087800000033
is the average density of the signal to be sampled; further w = a · h can be calculated.
3-2) discretization signal: if the input signal to be sampled is a continuous two-dimensional density field, directly dividing the input signal to be sampled into w multiplied by h discrete grids, wherein the density of the discrete signal to be sampled on each discrete grid is an integral value of the density field in the grid area; if the input signal to be sampled is a discrete two-dimensional density field, the signal to be sampled is expressed into a two-dimensional image form, then the width and the height of the image are adjusted to w × h by adopting an image interpolation scaling method, and the pixel value of each new pixel after interpolation is the density of the discrete signal to be sampled of the corresponding discrete grid.
Further, the specific implementation method in the step 4) is as follows:
4-1) calculating the density value of the signal to be quantized: adding the discrete signal density d '(i, j) to be sampled at the current grid position (i, j) and the accumulated error of all sampled adjacent grids diffused to the position to obtain the signal density value p (i, j) = d' (i, j) + Σ to be quantized k,l C (k, l) · e (k, l), where (k, l) is the sampled neighboring grid of (i, j), C (k, l) is the optimal error diffusion coefficient from (k, l) to (i, j), e (k, l) is the quantization error generated on (k, l), both of which are calculated when scanning the preceding grid (k, l), the calculation method is the same as step 4-4);
4-2) calculating a quantization threshold: the nearest neighbor upper and lower critical density levels of the real signal density d' (i, j) are d u And d l Obtaining the corresponding optimal threshold modulation coefficient m (d) from the optimal coefficient lookup table in the step 1) u ) And m (d) l ) And calculating a real optimal threshold modulation coefficient m (d ' (i, j)) of the current signal density by adopting an interpolation method, thereby calculating a quantization threshold T (d ' (i, j)) =0.5+ rand (0,1) · m (d ' (i, j)), wherein rand (0,1) is a random number with a value between 0 and 1;
4-3) executing quantization operation to obtain a sampling output result: comparing p (i, j) with a modulation threshold T (d '(i, j)), and if p (i, j) > T (d' (i, j)), generating a sampling point in the grid (i, j), the spatial coordinate of the sampling point being
Figure BDA0003788087800000041
Wherein rand (0,1) is a random number having a value between 0 and 1; otherwise, no sampling point is generated; determining the output signal density value b (i, j) E ∈ {0,1} on the grid (i, j) according to whether the sampling point is generated: b (i, j) =1 if a sampling point is generated, otherwise b (i, j) =0;
4-4) calculating an optimal error diffusion coefficient and diffusing quantization errors: the nearest neighbor upper and lower key density levels of the real signal density d' (i, j) are d u And d l Obtaining the corresponding optimal error diffusion coefficient C (d) from the optimal coefficient lookup table in the step 1) u ) And C (d) l ) Calculating a real number optimal error diffusion coefficient C (d' (i, j)) of the current signal density by adopting an interpolation method; comparing b (i, j) with p (i, j), obtaining a quantization error e (i, j) = b (i, j) -p (i, j), and diffusing e (i, j) to grid positions which are not processed in the surrounding neighborhood according to an optimal error diffusion coefficient C (d' (i, j));
4-5) repeatedly executing the steps 4-1) to 4-4) according to a certain scanning sequence until all grids on the discrete signal field to be sampled are processed, namely, the sampling result of the error diffusion in the real number domain is generated.
Further, modulating the discrete signal of step 4), specifically:
5-1) if the number of the sampling points generated currently is less than the number of the target sampling points, modulating and increasing the input signal; on the contrary, if the number of the sampling points generated currently is larger than the number of the target sampling points, the modulation of the input signal is reduced;
5-2) re-performing real number domain error diffusion sampling based on the modulation result until the generated sampling point number is equal to the target sampling point number.
The invention also provides a continuous domain error diffusion blue noise sampling system based on floating point number operation, which is characterized by comprising a coefficient optimization module, a signal scaling module, a signal discretization module, a real number domain error diffusion sampling module and a signal modulation module; wherein:
the coefficient optimization module is used for calculating an optimal density dynamic range, an optimal error diffusion coefficient and a threshold modulation coefficient and generating an optimal coefficient lookup table;
the signal scaling module is used for normalizing a signal to be sampled and scaling the signal to an optimal density dynamic range;
the discretization module is used for calculating a discretization parameter w x h of the signal to be sampled and discretizing the signal to be sampled to obtain a discretization signal;
the real number domain error diffusion sampling module is used for scanning the discrete signal to obtain a final sampling point result;
and the signal modulation module is used for modulating the discrete signals and implementing accurate control on the number of sampling result points.
The input of the invention is not limited to the discrete data of limited integer density level any more, and the invention is suitable for the continuous input signal of continuous domain density range and continuous domain sampling precision, and the sampling result output is a continuous domain sampling point set rather than a discrete domain two-dimensional image; the blue noise property of the sampling result is measured through the power spectrum obtained by Fourier transform, the diffusion coefficient of the error is optimized, and high-quality blue noise sampling is realized.
The method firstly divides a continuous data domain into discrete grids which accord with an error diffusion standard, and then realizes real number domain error diffusion sampling based on floating point number operation on the grids, thereby replacing continuous domain sampling with complicated calculation. As the sparse point set distribution generated by the error diffusion algorithm on the Low-Tone (Low-Tone) signal has good blue noise characteristics, the method takes the density parameter with optimal distribution in the error diffusion algorithm as the upper bound of the optimal density dynamic range, and normalizes the density of the input signal into the optimal density dynamic range. Therefore, the data definition domain and the data type related in the invention are both continuous real numbers, and the real number operation process is described by using a computer floating point number type.
The difference between the floating-point number operation-based continuous domain error diffusion algorithm and the traditional error diffusion algorithm mainly comprises four points:
1. while the conventional error diffusion method only accepts two-dimensional images as input and generally requires integer pixel values, the real number domain error diffusion method of the present invention can accept all two-dimensional data input including discrete two-dimensional images and continuous two-dimensional density fields, which can be integer pixel values or decimal density values. Because no matter what data is input, the real number interval of [0,1] is normalized.
2. When the algorithm is operated, the traditional error diffusion method adopts integers when any intermediate result is recorded, and the decimal part of the diffusion error is directly discarded, so that systematic quantization error is generated. The method for diffusing the error in the real number domain based on floating-point number operation reserves all parameters and intermediate results as real numbers, and reduces the quantization error to a greater extent.
3. In the process of optimizing the diffusion parameters, the Fourier transform-based spectrum analysis is also adopted as an optimization cost function, but the traditional error diffusion method adopts two-dimensional discrete Fourier transform on the image, and the floating-point-operation-based real number domain error diffusion method adopts continuous Fourier transform on the basis of a real number point set so as to achieve more accurate spectrum analysis. Meanwhile, the invention adopts a new cost function for measuring the blue noise property, thereby being convenient for better ensuring the blue noise property of the sampling result.
4. In the generated sampling result, the traditional error diffusion method can only be used for generating the number of sampling points lower than the image resolution, but the method can generate any number of sampling points through re-discretization and signal density modulation of the input signal.
Compared with the prior art, the invention has the beneficial effects that:
the invention can generate continuous domain sampling results. In terms of the quality of the sampling result, the oscillation of the sampling result in a high-frequency region is kept at an extremely low level, which indicates that the probability of structural aliasing occurrence is extremely low, and means a better blue noise property. The number of sampling points can also be accurately controlled by modulating the input signal to a certain degree. In the aspect of time efficiency of sampling, the algorithm complexity of the invention is only related to the division number of the discrete grid and is not related to the number of sampling points to be obtained, and the time complexity of sampling is linear and very efficient. In terms of space efficiency of sampling, the invention only needs to store necessary data of two scanning sequences which need to perform diffusion when sampling, and the storage cost is extremely low. Thus, blue noise sampling with high quality, high efficiency and controllable sampling point quantity is realized. The invention can also be extended to three-dimensional volume data domains and three-dimensional point cloud data domains to realize efficient blue noise sampling of different data domains.
Drawings
Fig. 1 is a flow chart of a real number domain error diffusion-based blue noise sampling method.
Fig. 2 is a flow chart of an error diffusion sampling algorithm.
Fig. 3 shows the direction and coefficient of error diffusion.
Fig. 4 is a sampling result when the input is a uniform signal.
Fig. 5 is a non-uniform input signal.
Fig. 6 is a sampling result with fig. 5 as input, where (a) is an intermediate result and (b) is a final result.
Detailed Description
The invention will be further described by means of specific embodiments in the following with reference to the attached drawings, without limiting the scope of the invention in any way.
The invention provides a continuous domain error diffusion blue noise sampling method based on floating point number operation, which can obtain the result of a specified number of sampling points with high quality and high efficiency by carrying out coefficient optimization, signal scaling, signal discretization, real number domain error diffusion sampling and signal modulation on an input signal to be sampled. Fig. 1 shows a flow of the continuous domain error diffusion blue noise sampling method based on floating-point number operation according to the present invention. Taking two-dimensional image data as an example, the goal is to output a set of sample points in the continuous domain. The technical scheme is as follows:
inputting a signal to be sampled into a sampling system, and outputting a sampling point result of the signal to be sampled; the strength of a signal to be sampled is represented by density, the difference between two adjacent densities is density precision, and the difference between the maximum density and the minimum density is density dynamic range; wherein the sampling system comprises the following modules:
(A) A coefficient optimization module: the system is used for calculating the optimal density dynamic range, the optimal error diffusion coefficient and the threshold modulation coefficient and generating an optimal coefficient lookup table;
(B) A signal scaling module: normalizing the signal to be sampled and scaling the signal to the optimal density dynamic range;
(C) The signal discretization module is used for: the device comprises a signal processing module, a signal analyzing module and a signal analyzing module, wherein the signal processing module is used for calculating discretization parameters of a signal to be sampled and discretizing the signal to be sampled to obtain a discretization signal;
(D) A real number domain error diffusion sampling module: the device is used for scanning the discrete signals, executing quantization operation and error diffusion and generating a final sampling point result;
(E) The signal modulation module: the device is used for modulating the discrete signals and implementing accurate control on the number of sampling result points;
the functions and the concrete implementation method of each module are as follows:
the coefficient optimization module (A) is used for calculating the optimal density dynamic range, the optimal error diffusion coefficient and the threshold modulation coefficient of the continuous domain error diffusion method, and the realization method comprises the following steps: selecting a certain lower density as an upper bound of the optimal density dynamic range to obtain the optimal density dynamic range; a group of key density levels are obtained at fixed intervals in the dynamic range of the optimal density, and an optimal error diffusion coefficient and threshold modulation coefficient lookup table is generated by optimally calculating Fourier transform spectrum performance of sampling results generated at each key density level, so that the optimal error diffusion coefficient and threshold modulation coefficient corresponding to the density can be quickly calculated by the lookup table when any signal density is given. The method can comprise the following steps:
A1. and selecting the optimal density dynamic range. The sparse point set distribution that is typically generated on a Low-Tone (Low-Tone) signal on a conventional two-dimensional error diffusion method has good blue noise properties. Therefore, in order to generate a better blue noise sampling result, the invention adopts a section of density range with better blue noise property to dynamically scale the whole sampling density range. Selecting an integer density i with optimal sampling point distribution property based on discrete error diffusion sampling results of gray level images 0 E (0, 255) as the optimal sampling density. The optimum density dynamic range of the continuous domain error diffusion is bounded by
Figure BDA0003788087800000071
The optimal dynamic range of density is [0,d ] 0 ]. As a preferred scheme, the optimal sampling density i 0 Generally 16 or less is selected, in this example i 0 =8, the optimum density dynamic range is upper bound
Figure BDA0003788087800000072
The optimal density dynamic range is [0,0.03137255 ]];
A2. And optimizing the error diffusion coefficient and the threshold modulation coefficient. In the optimum density dynamic range [0,d 0 ]A group of key signal density levels are obtained at fixed intervals, and an optimal error diffusion coefficient and threshold modulation coefficient lookup table is generated by optimally calculating Fourier transform spectrum expression of sampling results generated at each key density level, so that the optimal error diffusion coefficient and threshold modulation coefficient corresponding to any given signal density can be quickly calculated by looking up the table. The fixed interval of key signal density levels in this example is taken to be
Figure BDA0003788087800000073
I.e., [0,d 0 ]Equally divided into 256 in the real field, thus taking the value
Figure BDA0003788087800000074
The time critical density level interval is
Figure BDA0003788087800000075
When quantization operation is performed on the signal d '(i, j) to be sampled, the threshold function thereof passes through the threshold modulation coefficient m (d' (i, j)) ∈ [0.0,1.0 ]]And a white noise random number generator rand (0,1) for performing the calculation, namely: t (d '(i, j)) =0.5+ rand (0,1) · m (d' (i, j)). When the quantization error is diffused, the example adopts a 3-neighborhood error diffusion direction and coefficients as shown in fig. 3, wherein the position of a symbol is the grid currently sampling, the quantization error is diffused to three adjacent grids (front, rear, lower and right lower) which are not processed along the signal scanning direction, and weights are distributed to corresponding errors, that is, the error diffusion coefficients are respectively marked as { C { 10 ,C -11 ,C 01 }. When calculating the optimal threshold modulation coefficient and the optimal error diffusion coefficient for the given key density level g, selecting an optimization method such as a simplex method or a simulated annealing method; the loss function can be a weighted sum of two spectral features of the sampling result to determine whether the sampling result has blue noise characteristics, that is: target (g) = w (1-Correlation) dir ) + (1-w). Low (g), wherein Correlation dir After point-based Fourier transform is performed on a sampling result, a correlation function of a radial average frequency spectrum is segmented in each direction, low (g) is a Low-frequency energy ratio of the Fourier frequency spectrum, w is a weight, and the value in the example is 0.9.
And the signal scaling module (B) is used for normalizing the input signal and scaling the input signal into an optimal density dynamic range to obtain the density d of the signal to be sampled. The realization method comprises the following steps: dividing the input signal by the maximum value to obtain the normalized density of a real number domain; and multiplying the normalized density by the upper limit of the optimal density dynamic range, and scaling into the optimal density dynamic range. The method can comprise the following steps:
B1. will input messageThe numbers are normalized to the real number domain. Given an input signal I (x, y), either an integer or a decimal value, this is divided by the maximum value of the signal density max { I (x, y) } to yield the normalized signal density in the real number domain
Figure BDA0003788087800000081
Figure BDA0003788087800000085
Where (x, y) are spatial coordinates. In this example, since the input is in the grayscale range of [0,255%]So that 0,255 is to be inputted]Normalized to [0,1]In the real number domain of (3);
B2. the normalized input signal is scaled into the optimal density dynamic range. Optimizing the dynamic range of the optimal density obtained in the module (A) according to the coefficient [0,d ] 0 ]And normalizing the input signal density D to obtain the signal density D = D.d to be sampled 0 ,d∈[0,d 0 ]。
The signal discretization module (C) calculates discretization parameters w × h required for the input signal to perform continuous domain error diffusion, i.e., the number of horizontal/vertical grids required for conversion into a discrete signal density field, according to a specified sampling output target, and it can be written that w = a · h, knowing that the aspect ratio is a. Discretizing the signal to be sampled calculated in the signal scaling module (B) according to discretization parameters to obtain a two-dimensional discretization signal density field with the width w and the height h, wherein the density of the discretization signal on each grid (i, j) is recorded as d' (i, j). The method can comprise the following steps:
C1. and calculating the discretization parameters. N is generated if the output target is to make the input signal take uniform maximum density 0 A sampling point, then
Figure BDA0003788087800000082
If the output target is that the number of the final output sampling points is N, then
Figure BDA0003788087800000083
Wherein d is 0 For the upper bound of the dynamic range of the optimal density,
Figure BDA0003788087800000084
is the average density of the signal to be sampled; further w = a · h can be calculated. In this embodiment, if the input signal is set to uniform maximum density, the output target is specified as the number of sampling points N 0 If =10000,a =1, h =565,w =565 would be required, the error diffusion method may use the optimal error diffusion coefficient and threshold modulation coefficient when i =8, and the final sampling result is shown in fig. 4; if the input signal is as shown in fig. 5 and the number of sampling points N =10000, which designates the final output as the output target, h =840, w =630 can be calculated.
C2. The signal is discretized. If the input signal to be sampled is a continuous two-dimensional density field, directly dividing the input signal to be sampled into w multiplied by h discrete grids, wherein the density of the discrete signal to be sampled on each discrete grid is an integral value of the density field in the grid area; if the input signal to be sampled is a discrete two-dimensional density field, the signal to be sampled is expressed into a two-dimensional image form, then the width and the height of the image are adjusted to w × h by adopting an image interpolation scaling method, and the pixel value of each new pixel after interpolation is the density of the discrete signal to be sampled of the corresponding discrete grid. As a preferred scheme, in this specific embodiment, an image bicubic interpolation method is used to change the image size, and an input signal is converted into a discrete signal to be sampled whose width is w and height is h.
And the real number domain error diffusion sampling module (D) executes a continuous domain error diffusion method based on floating point number operation on the discrete signal D' (i, j) generated in the signal discretization module (C) to generate a sampling result, wherein i belongs to [0,w-1] and j belongs to [0,h-1].
The flow is shown in fig. 2, and the specific implementation method may include the following steps:
D1. and calculating the density value of the signal to be quantized. Cumulatively adding the discrete signal density d '(i, j) to be sampled at the current grid position (i, j) and the error diffused to the position by all the previous sampled adjacent grids to obtain the signal density value p (i, j) = d' (i, j) + sigma to be quantized k,l C (k, l) · e (k, l). Wherein (k, l) is the sampled adjacent grid of (i, j), and C (k, l) is the optimal error diffusion system from (k, l) to (i, j)E (k, l) is the quantization error generated on (k, l), both are calculated when scanning the preamble grid (k, l), the calculation method is the same as the step D4;
D2. a quantization threshold is calculated. The nearest neighbor upper and lower critical density levels of the real signal density d' (i, j) are d u And d l Obtaining the corresponding optimal threshold modulation coefficient m (d) from the optimal coefficient lookup table of the module (A) u ) And m (d) l ) And calculating a real number optimal threshold modulation coefficient m (d ' (i, j)) of the current signal density by using an interpolation method, thereby calculating a quantization threshold T (d ' (i, j)) =0.5+ rand (0,1) · m (d ' (i, j)), wherein rand (0,1) is a white noise random number having a value between 0 and 1. As a preferable scheme, in the present specific embodiment, a one-dimensional linear interpolation is used to obtain a specific optimal threshold modulation coefficient, that is, m (d '(i, j)) = (d' (i, j) -d l )·(m(d u )-m(d l ))+m(d l );
D3. And performing quantization operation to obtain a sampling output result. Comparing p (i, j) with a modulation threshold T (d '(i, j)), and if p (i, j) > T (d' (i, j)), generating a sampling point in the grid (i, j), the spatial coordinate of the sampling point being
Figure BDA0003788087800000091
Wherein rand (0,1) is a random number with a value between 0 and 1; otherwise no sample points are generated. Determining the output signal density value b (i, j) E ∈ {0,1} on the grid (i, j) according to whether the sampling point is generated: b (i, j) =1 if a sampling point is generated, otherwise b (i, j) =0;
D4. and calculating an optimal error diffusion coefficient and diffusing the quantization error. The nearest neighbor upper and lower critical density levels of the real signal density d' (i, j) are d u And d l Obtaining the corresponding optimal error diffusion coefficient C (d) from the optimal coefficient lookup table generated by the module (A) u ) And C (d) l ) And calculating a real number optimal error diffusion coefficient C (d' (i, j)) of the current signal density by adopting interpolation; comparing b (i, j) with p (i, j), obtaining quantization error e (i, j) = b (i, j) -p (i, j), diffusing e (i, j) to the peripheral neighborhood which is not positioned according to the optimal error diffusion coefficient C (d' (i, j))Physical grid position. As a preferable solution, in the present specific embodiment, a one-dimensional linear interpolation is used to obtain a specific optimal error diffusion coefficient, i.e., C (d '(i, j)) = (d' (i, j) -d l )·(C(d u )-C(d l ))+C(d l ) (ii) a In this example, the 3-neighborhood error diffusion direction and coefficients shown in fig. 3 are used, where the position is the grid currently being sampled, and the quantization error will be represented by the error diffusion coefficient C (d' (x, y)) = { C = (C =) } C 10 ,C -11 ,C 01 The weights are diffused to three unprocessed adjacent grids (front, rear lower and right lower) along the signal scanning direction, so that the linear interpolation calculation of the optimal error diffusion coefficient is needed to be carried out at the three positions;
D5. and (4) repeatedly executing the steps D1 to D4 according to a certain scanning sequence until all grids on the discrete signal field to be sampled are processed, namely, a real number field error diffusion sampling result is generated. In this specific embodiment, the scanning order may adopt a serpentine scanning order shown in fig. 3, that is, when i is an even number, scanning is performed from left to right and performing diffusion error operation, and when i is an odd number, scanning is performed from right to left and performing diffusion error operation. The sampling result obtained for the input signal of fig. 5 is shown in fig. 6 (a), and the number of sampling points is 5408.
And the signal modulation module (E) implements accurate control on the number of sampling result points by modulating the discrete signal on the basis of the sampling result generated by the real number domain error diffusion sampling module (D) until the number of output sampling points meets the target condition. The specific implementation method comprises the following steps:
E1. if the number of the sampling points generated currently is less than the number of the target sampling points, modulating and increasing the input signal; otherwise, if the number of the currently generated sampling points is larger than the target number of the sampling points, the modulation of the input signal is reduced. As a preferable scheme, in the present embodiment, the input signal is modulated by using γ transform, that is, g (d ' (i, j)) = d ' (i, j) is performed on each grid signal d ' (i, j) in the two-dimensional density field γ . When solving the gamma satisfying the condition, preferably solving the numerical solution of the gamma by adopting a simplex method because the problem is difficult to find an analytic solution;
E2. re-executing the real number domain error diffusion sampling module (D) based on the modulation result of step E1 to generate a new sampling result, and E1 and D may be repeatedly executed until the number of generated sampling points is equal to the target number of sampling points. In this specific embodiment, the output result in fig. 6 (a) does not reach the expected number of sampling points, so that the input signal is modulated, and γ =0.857681 is obtained by using γ transform calculation, so as to obtain the final sampling result fig. 6 (b), where the total number of sampling points is 10000.
It is noted that the disclosed embodiments are intended to aid in further understanding of the invention, but those skilled in the art will appreciate that: various substitutions and modifications are possible without departing from the spirit and scope of the invention and appended claims. Therefore, the invention should not be limited to the embodiments disclosed, but the scope of the invention is defined by the appended claims.

Claims (8)

1. A continuous domain error diffusion blue noise sampling method based on floating point number operation is characterized by comprising the following steps:
1) Calculating an optimal density dynamic range, an optimal error diffusion coefficient and a threshold modulation coefficient, and generating an optimal coefficient lookup table;
2) Normalizing the input signal, and then scaling the normalized input signal to the optimal density dynamic range to obtain the density of the signal to be sampled;
3) Calculating discretization parameters of the signal to be sampled according to the sampling target, and discretizing the signal to be sampled onto a grid to obtain a discretization signal;
4) And scanning the discrete signals according to a certain sequence, accumulating the discrete signal value to be sampled at each grid position and the quantization error diffused by the sampled adjacent grids, generating a sampling point result of the current grid through quantization operation, and diffusing the quantization error of the output signal to the unprocessed grid in the neighborhood according to the optimal error diffusion coefficient.
2. The floating-point-operation-based continuous domain error diffusion blue noise sampling method of claim 1, wherein the specific implementation method in step 1) is as follows: selecting a certain lower density as an upper bound of the optimal density dynamic range to obtain the optimal density dynamic range; a group of key density levels are obtained at fixed intervals in the dynamic range of the optimal density, and an optimal error diffusion coefficient and threshold modulation coefficient lookup table is generated by optimally calculating Fourier transform spectrum performance of sampling results generated at each key density level, so that the optimal error diffusion coefficient and threshold modulation coefficient corresponding to the density can be quickly calculated by the lookup table when any signal density is given.
3. The floating-point-operation-based continuous-domain error diffusion blue noise sampling method of claim 1, wherein the step 2) is implemented by the following steps: dividing the input signal by the maximum value of the signal density to obtain the normalized signal density of a real number domain no matter the input signal is an integer value or a decimal value; and multiplying the normalized density by the upper bound of the optimal density dynamic range, and scaling the normalized density into the optimal density dynamic range.
4. The floating-point-operation-based continuous-domain error diffusion blue noise sampling method of claim 1, wherein the specific implementation method in step 3) is as follows:
3-1) calculating discretization parameters: when an input continuous signal is converted into a discrete signal field with width w and height h, the aspect ratio is known as a, and w = a · h; n is generated if the output target is to make the input signal take uniform maximum density 0 A sampling point, then
Figure FDA0003788087790000011
If the output target is that the number of the final output sampling points is N, then
Figure FDA0003788087790000012
Wherein d is 0 For the upper bound of the dynamic range of the optimal density,
Figure FDA0003788087790000013
for smoothing of the signal to be sampledThe average density;
3-2) discretization signal: if the input signal to be sampled is a continuous two-dimensional density field, directly dividing the input signal to be sampled into w multiplied by h discrete grids, wherein the density of the discrete signal to be sampled on each discrete grid is an integral value of the density field in the grid area; if the input signal to be sampled is a discrete two-dimensional density field, the signal to be sampled is expressed into a two-dimensional image form, then the width and the height of the image are adjusted to w × h by adopting an image interpolation scaling method, and the pixel value of each new pixel after interpolation is the density of the discrete signal to be sampled of the corresponding discrete grid.
5. The floating-point-operation-based continuous-domain error diffusion blue noise sampling method of claim 1, wherein the specific implementation method of step 4) is as follows:
4-1) calculating the density value of the signal to be quantized: adding the discrete signal density d '(i, j) to be sampled at the current grid position (i, j) and the accumulated error diffused to the position by all the sampled adjacent grids to obtain the signal density value p (i, j) = d' (i, j) + sigma to be quantized k,l C (k, l) · e (k, l), where (k, l) is a sampled neighboring grid of (i, j), C (k, l) is an optimal error diffusion coefficient from (k, l) to (i, j), and e (k, l) is a quantization error generated on (k, l), both of which are calculated while scanning the preamble grid (k, l), and the calculation method is the same as step 4-4);
4-2) calculating a quantization threshold: the nearest neighbor upper and lower critical density levels of the real signal density d' (i, j) are d u And d l Obtaining the corresponding optimal threshold modulation coefficient m (d) from the optimal coefficient lookup table in the step 1) u ) And m (d) l ) And calculating a real optimal threshold modulation coefficient m (d ' (i, j)) of the current signal density by adopting an interpolation method, thereby calculating a quantization threshold T (d ' (i, j)) =0.5+ rand (0,1) · m (d ' (i, j)), wherein rand (0,1) is a random number with a value between 0 and 1;
4-3) executing quantization operation to obtain a sampling output result: comparing p (i, j) with a modulation threshold T (d '(i, j)), and if p (k, j) > T (d' (i, j)), generating a sampling point in the grid (i, j), the spatial coordinates of the sampling pointIs marked as
Figure FDA0003788087790000021
Wherein rand (0,1) is a random number with a value between 0 and 1; otherwise, no sampling point is generated; determining the output signal density value b (i, j) E ∈ {0,1} on the grid (i, j) according to whether the sampling point is generated: b (i, j) =1 if a sampling point is generated, otherwise b (i, j) =0;
4-4) calculating an optimal error diffusion coefficient and diffusing quantization errors: the nearest neighbor upper and lower critical density levels of the real signal density d' (i, j) are d u And d l Obtaining the corresponding optimal error diffusion coefficient C (d) from the optimal coefficient lookup table in the step 1) u ) And C (d) l ) Calculating a real number optimal error diffusion coefficient C (d' (i, j)) of the current signal density by adopting an interpolation method; comparing b (i, j) with p (i, j), obtaining a quantization error e (i, j) = b (i, j) -p (i, j), and diffusing e (i, j) to grid positions which are not processed in the surrounding neighborhood according to an optimal error diffusion coefficient C (d' (i, j));
4-5) repeatedly executing the steps 4-1) to 4-4) according to a certain scanning sequence until all grids on the discrete signal field to be sampled are processed, namely, the sampling result of the error diffusion in the real number domain is generated.
6. The floating-point-operation-based continuous-domain error diffusion blue noise sampling method according to claim 1, wherein the discrete signal of step 4) is modulated, specifically: if the number of the sampling points generated currently is less than the target number of the sampling points, modulating and increasing the input signal; on the contrary, if the number of the sampling points generated currently is larger than the number of the target sampling points, the modulation of the input signal is reduced; the signal modulation and continuous domain error diffusion sampling are repeatedly performed until the number of generated sampling points is equal to the target number of sampling points.
7. The floating-point-operation-based continuous-domain error-diffusion blue-noise sampling method according to claim 4, wherein the scanning order of step 4) is a serpentine scanning order, i.e. scanning from left to right and performing error diffusion operation when i is even, and vice versa.
8. A continuous domain error diffusion blue noise sampling system based on floating point number operation is characterized by comprising a coefficient optimization module, a signal scaling module, a signal discretization module, a real number domain error diffusion sampling module and a signal modulation module; wherein:
the coefficient optimization module is used for calculating an error diffusion coefficient and a threshold modulation coefficient in an optimal density dynamic range;
the signal scaling module is used for normalizing the signal to be sampled and scaling the signal to the optimal density dynamic range;
the discretization module is used for calculating a discretization parameter w x h of the signal to be sampled and discretizing the signal to be sampled to obtain a discretization signal;
the real number domain error diffusion sampling module is used for scanning the discrete signal to obtain a final sampling point result;
and the signal modulation module is used for modulating the discrete signals and implementing accurate control on the number of sampling result points.
CN202210947433.2A 2022-08-09 2022-08-09 Real number domain high dynamic range blue noise sampling method and system based on error diffusion Pending CN115409701A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210947433.2A CN115409701A (en) 2022-08-09 2022-08-09 Real number domain high dynamic range blue noise sampling method and system based on error diffusion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210947433.2A CN115409701A (en) 2022-08-09 2022-08-09 Real number domain high dynamic range blue noise sampling method and system based on error diffusion

Publications (1)

Publication Number Publication Date
CN115409701A true CN115409701A (en) 2022-11-29

Family

ID=84158973

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210947433.2A Pending CN115409701A (en) 2022-08-09 2022-08-09 Real number domain high dynamic range blue noise sampling method and system based on error diffusion

Country Status (1)

Country Link
CN (1) CN115409701A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116839509A (en) * 2023-09-01 2023-10-03 南京信息工程大学 Three-dimensional measurement method combining binary coding with error diffusion algorithm

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116839509A (en) * 2023-09-01 2023-10-03 南京信息工程大学 Three-dimensional measurement method combining binary coding with error diffusion algorithm

Similar Documents

Publication Publication Date Title
CN102682446B (en) Adaptive combined two-sided filter is used to generate equipment and the method for dense depth map
CN106127688B (en) A kind of super-resolution image reconstruction method and its system
CN102156961A (en) Image processing apparatus, image processing method, and program
US8401340B2 (en) Image processing apparatus and coefficient learning apparatus
CN115409701A (en) Real number domain high dynamic range blue noise sampling method and system based on error diffusion
Fu et al. An improved algorithm based on CLAHE for ultrasonic well logging image enhancement
US8433145B2 (en) Coefficient learning apparatus and method, image processing apparatus and method, program, and recording medium
CN108322749A (en) The coefficient optimization method of RDOQ, the accelerating method and device of RDOQ
Xiao et al. Gradient-guided DCNN for inverse halftoning and image expanding
JP5316385B2 (en) Image processing apparatus and image processing program
US6633411B1 (en) Method and apparatus for repurposing binary images
US8164593B2 (en) Systems and methods for graphical rendering
JP5767516B2 (en) Image processing apparatus, image processing method, and program
US20220405881A1 (en) Method and apparatus for efficient non-integer scaling in neural network accelerators
JP2014222442A (en) Space and gradation super-resolution device and program
CN105335978A (en) Image edge detection method and system
CN112598588B (en) Curvature weighted guide-based transformer substation three-dimensional point cloud model denoising method
CN112967208B (en) Image processing method and device, electronic equipment and storage medium
Bakshi et al. Halftoning algorithm using pull-based error diffusion technique
CN109711376B (en) Multi-scale sparse blue noise sampling method based on optimal transmission theory
CN113838057A (en) High-resolution SAR image segmentation calculation performance and precision optimization method
de Leeuw et al. Bm3d: motion estimation in time dependent volume data
JPH08214159A (en) Image processing method and image processing unit
CN103793892A (en) Image processing apparatus and image processing method
Ray et al. A method of deviation for drawing implicit curves

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination