Data processing module for identifying quantiles in a dataset.

By calculating the sum of weights associated with reference data and comparing it with the threshold, quickly judging the quantiles in the data set, solving the problem of quantile determination complexity and surface area limitation in the prior art, and achieving efficient quantiles Number judgment.

CN114651250BActive Publication Date: 2024-11-26SAFRAN ELECTRONICS & DEFENSE (FR)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080077481.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-10-08
Filing Date
2020-10-08
Publication Date
2024-11-26
Estimated Expiration
2040-10-08

AI Technical Summary

Technical Problem

The minimum search operation for determining quantiles in a data set in the prior art is complex, resulting in prolonged processing time and difficult to implement in components with very small surface areas.

Method used

By calculating the sum of weights associated with the reference data and comparing it with the preset threshold, it is determined whether the reference data belongs to the quantiles in the predetermined quantile subset, and a comparator and adder arranged in parallel are used for quick judgment.

Benefits of technology

It realizes the rapid determination of the quantiles of the data set on a very small surface area, reducing processing time and improving efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114651250B_ABST
    Figure CN114651250B_ABST
Patent Text Reader

Abstract

A module for processing a set of n input data, the input data including reference data, the processing module being configured to perform the following steps: a) calculating the sum of weights associated only with input data other than the reference data, the values ​​of the input data other than the reference data being strictly smaller than the value of the reference data; b) comparing the sum calculated in step a) with a first threshold; c) calculating the sum of weights associated only with input data other than the reference data, the values ​​of the input data other than the reference data being strictly larger than the value of the reference data, d) comparing the sum calculated in step c) with a second threshold; e) generating output data only when the following two conditions are met: the sum calculated in step a) is strictly or not strictly smaller than the first threshold, and the sum calculated in step c) is strictly or not strictly smaller than the second threshold, wherein the output data indicates whether the reference data is a quantile of the set included in a predetermined quantile subset.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of methods and apparatus for identifying quantiles (eg, medians) in a data set that belong to a predetermined subset of quantiles. Background Art

[0002] A screening device for screening a set of n input data to generate an output value is known from US 2012 / 076432. The output value is the median of the corresponding values ​​of the n input data. The median is a specific quantile that divides the set of n data (once sorted) into two groups of data of equal size.

[0003] The apparatus comprises a plurality of processing units including a determination unit that performs a minimum search to determine a median.

[0004] A disadvantage of the device is that the minimum search implemented is a relatively complex operation. This has two consequences: this minimum search prolongs the processing time of the device and cannot be implemented in components with very small surface areas. Summary of the invention

[0005] It is an object of the present invention to determine the quantiles of a data set more quickly and / or in a manner that can be implemented on a very small surface area.

[0006] For the above purpose, according to a first aspect, there is provided a module for processing a set of n input data, wherein the n input data include reference data, each input data has a value, and each input data is associated with a weight, wherein the processing module is configured to perform the following steps:

[0007] a) calculating the sum of weights associated only with input data other than said reference data, the input data other than said reference data having values ​​strictly smaller than the value of said reference data,

[0008] b) comparing the sum calculated in step a) with a first threshold value,

[0009] c) calculating the sum of weights associated only with input data other than said reference data, the input data other than said reference data having a value strictly greater than the value of said reference data,

[0010] d) comparing the sum calculated in step c) with a second threshold value,

[0011] e) generating output data only when the following two conditions are met: the sum calculated in step a) is strictly or not strictly less than the first threshold, and the sum calculated in step c) is strictly or not strictly less than the second threshold, the output data indicating whether the reference data is a quantile of the set included in a predetermined quantile subset.

[0012] The modules according to the first aspect are used alone or in combination with each other when technically feasible, and the modules include the following features.

[0013] Preferably, the output data is a Boolean value.

[0014] Preferably, the processing module comprises:

[0015] - a plurality of first comparators arranged in parallel, each first comparator being configured to generate a comparison result between a value of the reference data and a value of another input data in the set,

[0016] - a first adder configured to perform step a) based on the result generated by said first comparator.

[0017] Preferably, the processing module comprises:

[0018] - a plurality of second comparators arranged in parallel, each second comparator being configured to generate a comparison result between a value of the reference data and a value of another input data in the set,

[0019] - a second adder configured to perform step c) based on the result generated by said second comparator.

[0020] Preferably, the processing module comprises: two comparators, configured to respectively generate two comparison results between the value of the reference data and the value of another input data in the set, wherein one of the two comparators is configured to only detect the equality between the value of the reference data and the value of another input data in the set, and the other of the two comparators is configured to only detect the sequential relationship between the value of the reference data and the value of another input data in the set, and the processing module (1, 2, 3) is also configured to cross the two results to determine whether the weight of the other value is included in the sum calculated in step a) or in the sum calculated in step c).

[0021] Preferably, the sum of the first threshold and the second threshold is equal to s+p, where s is the sum of the weights of n input data, and where, p is a function for determining whether the sum calculated in step a) must be strictly smaller than the first threshold value and whether the sum calculated in step b) must be strictly smaller than the second threshold value.

[0022] Preferably, the predetermined set of quantiles comprises a single quantile.

[0023] Preferably, the predetermined quantile set includes the median of the set of n input data.

[0024] Preferably, the n weights are all equal to 1.

[0025] Preferably, the set of n input data is a pixel neighborhood in an image.

[0026] Preferably, the step a) comprises:

[0027] a1) initializing a first counter to a sum calculated in the process of the previous execution of step a), wherein in the process of the previous execution of step a), the processing module processes a previous data set including the same reference data, the set of n input data further includes at least one new data not present in the previous data set, and the previous data set includes at least one old data not present in the set of n input data,

[0028] a2) for each new data, incrementing the first counter by a weight associated with the new data only when a predetermined relationship between the value of the new data and the value of the reference data is verified,

[0029] a3) For each old data, only when a predetermined relationship between the value of the old data and the value of the reference data is verified, decrementing the first counter by the weight associated with the old data.

[0030] Preferably, step c) comprises:

[0031] c1) initializing the second counter to the sum calculated in the process of the previous execution of step c), wherein in the process of the previous execution of step c), the processing module processes a previous data set including the same reference data, the set of n input data further includes at least one new data not present in the previous data set, and the previous data set includes at least one old data not present in the set of n input data,

[0032] c2) for each new data, incrementing the second counter by a weight associated with the new data only when a predetermined relationship between the value of the new data and the value of the reference data is verified,

[0033] c3) For each old data, only when a predetermined relationship between the value of the old data and the value of the reference data is verified, decrementing the second counter by the weight associated with the old data.

[0034] Preferably, the predetermined relationship is a strict sequential relationship.

[0035] Preferably, the set of n input data and the previous set of data are overlapping pixel neighborhoods in the image.

[0036] Preferably, the processing module is further configured to:

[0037] - b') comparing the sum calculated in step a) with a third threshold value,

[0038] -d') comparing the sum calculated in step c) with a fourth threshold value,

[0039] -e') generates output data only when the following two conditions are met: the sum calculated in step a) is strictly or not strictly less than a third threshold, and the sum calculated in step c) is strictly or not strictly less than a fourth threshold, the output data indicating whether the reference data is a quantile of the set included in a second predetermined quantile subset, the second predetermined quantile subset being different from the subset in step e).

[0040] According to a second aspect, there is also provided a device for screening a set of n data, for generating quantiles of the set included in a predetermined quantile subset, each input data having a value, and each input data being associated with a weight, the screening device comprising:

[0041] - a plurality of processing modules according to the first aspect arranged in parallel, each processing module (1, 2, 3) itself being associated with one of the n input data and being configured to process the input data associated with itself in the set as reference data,

[0042] - a quantile generation module (6), configured to generate quantiles based on the output data respectively generated by the plurality of processing modules.

[0043] The screening device according to the second aspect may include the following features when used alone or in combination with each other, if technically feasible.

[0044] Preferably, the quantile generation module is configured as follows:

[0045] f) for each output data generated by a processing module, applying bitwise type operations and logical operations on the output data generated by said processing module and on the value of the input data associated with said processing module itself to generate a result,

[0046] g) applying a bitwise type operation or a logical operation to the result of step f).

[0047] Preferably, the screening device comprises a comparator configured to generate a comparison result between a value of the first data in the set and a value of the second data in the set, and wherein the plurality of processing modules comprises:

[0048] - a first processing module configured to process the first data in the set as reference data, the first processing module configured to perform one of step a) and step c) based on the result generated by the comparator,

[0049] - a second processing module configured to process second data of the set into reference data, said second processing module being configured to perform one of step a) and step c) based on a result generated by said comparator.

[0050] Preferably, the set of n input data includes two input data shared with a previous data set previously processed by the screening device, and one of the processing modules is configured to perform step a) or step c) based on a comparison result between the two shared input data previously generated by the processing module to process the previous data set.

[0051] Preferably, step a) performed by the processing module comprises:

[0052] a1) initializing a first counter to the sum calculated in the process of the previous execution of step a) to filter a previous data set, wherein the set of n input data includes at least one new data not present in the previous data set and includes the same input data as the previous data set, and the previous data set includes at least one old data not present in the set of n input data,

[0053] a2) for each new data, incrementing a first counter by a weight associated with the new data only when a predetermined relationship between the value of the new data and the value of the shared input data is verified,

[0054] a3) For each old data, only when a predetermined relationship between the value of the old data and the value of the same input data is verified, a first counter is decremented by a weight associated with the old data.

[0055] Preferably, step c) performed by the processing module comprises:

[0056] c1) initializing a first counter to the sum already calculated in the process of the last execution of step c) for screening a previous data set, the set of n input data including at least one new data not present in the previous data set and including input data common to the previous data set, the previous data set including at least one old data not present in the set of n input data,

[0057] c2) for each new data, incrementing a first counter by a weight associated with the new data only if a predetermined relationship between the value of the new data and the value of the same input data is verified,

[0058] c3) For each old data, only when a predetermined relationship between the value of the old data and the value of the same input data is verified, decrementing a first counter by a weight associated with the old data.

[0059] Preferably, the predetermined relationship is a strict sequential relationship.

[0060] Preferably, the number of processing modules arranged in parallel is strictly less than n, so that at least one data among the n input data, referred to as remaining data, is not processed as reference data by any of the processing modules, and the screening device also includes an additional module, which is configured to generate output data based on the output data generated by the processing module, and the output data generated by the additional module indicates whether the remaining data is a quantile of the set included in a predetermined quantile subset.

[0061] According to a third aspect, there is also provided an apparatus for processing an input image to generate an output image, the processing apparatus comprising:

[0062] - a pixel selection module (12) configured to select n pixel neighborhoods in the input image (A),

[0063] - The screening device according to the second aspect is configured to screen the selected n pixel neighborhoods to generate quantiles of the n pixel neighborhoods, wherein the quantiles constitute the values ​​of the pixels of the output image.

[0064] According to a fourth aspect, there is also provided a method for processing a set of n input data, the input data comprising reference data, each input data having a value, and each input data being associated with a weight, the method comprising the following steps performed by a processing module:

[0065] a) calculating the sum of weights associated only with input data other than said reference data, the input data other than said reference data having values ​​strictly smaller than the value of said reference data,

[0066] b) comparing the sum calculated in step a) with a first threshold value,

[0067] c) calculating the sum of weights associated only with input data other than said reference data, the input data other than said reference data having a value strictly greater than the value of said reference data,

[0068] d) comparing the sum calculated in step c) with a second threshold value,

[0069] e) generating output data only when the following two conditions are met: the sum calculated in step a) is strictly or not strictly less than a first threshold, and the sum calculated in step c) is strictly or not strictly less than a second threshold, the output data indicating whether the reference data is a quantile of the set included in a predetermined quantile subset.

[0070] According to a fifth aspect, there is also provided a method for screening a set of n input data, for generating quantiles of the set contained in a predetermined quantile subset, each input data having a value, and each input data being associated with a weight, the method comprising:

[0071] - executing the processing method according to the fourth aspect in parallel for multiple times, each execution of the processing method processing different input data from the set as reference data,

[0072] - Generating quantiles based on output data produced during parallel execution of the processing method.

[0073] Preferably, the set of n input data screened by the method described in the fifth aspect is a pixel neighborhood of an image.

[0074] According to a sixth aspect, there is also provided a computer program product comprising program code instructions, wherein when the program is executed by a computer, the program code instructions execute the steps of the method described in the fifth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Other features, objects and advantages of the present invention will become more apparent from the following description, which is illustrative and non-limiting only and must be read with reference to the accompanying drawings, in which:

[0076] Figure 1 A processing module according to a first embodiment of the present invention is schematically shown.

[0077] Figure 2 A processing module according to a second embodiment of the present invention is schematically shown.

[0078] Figure 3 A processing module according to a third embodiment of the present invention is schematically shown.

[0079] Figure 4 A screening device according to a first embodiment is schematically shown.

[0080] Figure 5 A screening device according to a second embodiment is schematically shown.

[0081] Figure 6 An image processing apparatus according to a first embodiment is schematically shown.

[0082] Figure 7 A screening device according to a third embodiment is schematically shown.

[0083] Figure 8 A screening device according to a fourth embodiment is schematically shown.

[0084] Fig. 9 A portion of an image and two selected pixel neighborhoods in the image are schematically shown.

[0085] Fig.10 A portion of an image and three selected pixel neighborhoods in the image are schematically shown.

[0086] In all figures, similar elements have the same reference numerals. DETAILED DESCRIPTION

[0087] Figure 1 A processing module 1 according to a first embodiment is shown. The processing module 1 takes as input a set of n input data. Each input data has a value.

[0088] The processing module 1 has a function of detecting whether a value of one of the input data (referred to as reference data in the rest of the present application) is a predetermined quantile of a set of n input data.

[0089] The processing module 1 is configured to implement the following steps:

[0090] a) calculating the number of input data other than the reference data, the input data other than the reference data having a value strictly smaller than the value of the reference data,

[0091] b) comparing the number calculated in step a) with a first threshold value Sa,

[0092] c) calculating the number of input data other than the reference data having a value strictly greater than the value of the reference data,

[0093] d) comparing the sum calculated in step c) with a second threshold value Sb,

[0094] e) generating output data V0 only when the following two conditions are met: the sum calculated in step a) is strictly less than the first threshold Sa, and the sum calculated in step c) is strictly less than the second threshold Sb, the output data V0 indicating whether the reference data is a predetermined quantile of a set of n data.

[0095] exist Figure 1 In the embodiment shown, n=3. The corresponding values ​​of the three input data are respectively represented as P0, P1, and P2. The value of the reference data is P0.

[0096] The structure of the processing module 1 will be described in detail below, which enables the processing module to implement the above steps.

[0097] The processing module 1 comprises a plurality of main comparators arranged in parallel. Each main comparator comprises two inputs and one output. Each main comparator is configured to compare two values ​​received by the main comparator via two inputs and provide a result at the output of the main comparator, the result providing information about the comparison.

[0098] Each primary comparator is limited to checking whether the two values ​​passed to it as input verify a predetermined binary relationship R specific to said comparator. The result provided as output is an item of Boolean information. In other words, each primary comparator is limited to verifying whether xRy is true, where x and y are the two values ​​received through the two inputs.

[0099] The inputs to the primary comparator are shown one above the other in the diagram; generally, x (the left operand of R) is the value received on the top input, and y (the right operand of R) is the value received on the bottom input. The binary relationships detected by the comparators are represented in the diagram with corresponding symbols.

[0100] In general, if the binary relationship R checked by the primary comparator is verified by the value it receives as input, the result provided by the primary comparator is called "positive", while in the opposite case, the result provided by the primary comparator is called "negative". For example, a positive result is represented by the value 1, while a negative result is represented by the value 0 (zero).

[0101] exist Figure 1 In the first embodiment shown, the binary relation R verified by each primary comparator is a strictly sequential relation (thus, R can be < or >).

[0102] The main comparator is arranged to receive as input the value P0 of the input reference data and the value of one of the other input data (here P1 or P2 since n=3). In other words, these comparators are configured to generate a comparison result of the value P0 of the reference data with the value of another input data in the set.

[0103] Therefore, the multiple comparators include:

[0104] A first set of n-1 comparators providing a result indicating whether the value P0 of the reference data is strictly greater than the value of the other input data (in Figure 2 In , these comparators are shown with the sign >); and

[0105] A second set of n-1 comparators providing a result indicating whether the value P0 of the reference data is strictly less than the value of the other input data (in Figure 2 Among them, these comparators show signed <).

[0106] In Figure 1 In the processing module 1 shown, N = 3, and each group includes the following:

[0107] · The first group of >-type comparators, including the following two comparators:

[0108] ο A comparator for verifying whether P0 > P1, and

[0109] ο A comparator for verifying whether P0 > P2,

[0110] · The second group of <-type comparators, including the following two comparators:

[0111] ο A comparator for verifying whether P0 < P1, and

[0112] ο A comparator for verifying whether P0 < P2.

[0113] The processing module 1 also includes a first adder and a second adder (denoted by the symbol + in Figure 1 ).

[0114] The first adder is connected to the corresponding outputs of the first group of comparators. The first adder is configured to determine the number of input data other than the input reference data, and the input data other than the input reference data has a value strictly less than the value P0 of the reference data (step a). The determined number is the output of the first adder.

[0115] To this end, the first adder can simply initialize the first counter to zero, and whenever the first adder receives a positive result from a comparator belonging to the first group, the first counter is incremented by 1.

[0116] Similarly, the second adder is connected to the corresponding outputs of the second group of comparators. The second adder is configured to determine the number of input data other than the input reference data, and the input data other than the input reference data has a value strictly greater than the value P0 of the reference data (step c). The determined number is the output of the second adder.

[0117] To this end, the second adder can simply initialize the second counter to zero, and whenever the second adder receives a positive result from a comparator belonging to the second group, the second counter is incremented by 1.

[0118] The processing module 1 also includes a first auxiliary comparator and a second auxiliary comparator (shown on the right side of the adder).

[0119] The two auxiliary comparators are comparators limited to verifying strict order relations, similar to the main comparators.

[0120] More precisely, the first auxiliary comparator ( Figure 1 The first comparator is configured to verify whether the number determined by the first adder is strictly less than the first threshold value Sa (step b in the method). If so, the first comparator generates a positive result at its output, for example, the positive result is represented by the value 1; otherwise, the first comparator generates a negative result at its output, for example, the negative result is represented by the value 0.

[0121] Similarly, the second auxiliary comparator ( Figure 1 The first comparator is configured to verify whether the number determined by the second adder is strictly less than a second threshold value Sb (step d in the method). If so, the first comparator generates a positive result at its output, for example, the positive result is represented by a value of 1; otherwise, the first comparator generates a negative result at its output, for example, the negative result is represented by a value of 0.

[0122] To generate output data V0, processing module 1 may include an AND type logic gate, taking the result provided by the auxiliary comparator as input. In this case, when the value of V0 is 1, V0 indicates that the value of the reference data is a predetermined quantile of the set of n input data.

[0123] The quantile detected by the processing module 1 depends on the values ​​assigned to the threshold Sa and the threshold Sb.

[0124] If the first threshold and the second threshold are respectively (n+1) / 2, and n is an odd number, the quantile detected by processing module 1 is the median; in other words, processing module 1 has the function of detecting whether value P0 is the median of the values ​​of n input data.

[0125] In one embodiment, Sa=n and Sb=1 can be set. In this embodiment, the detected quantile is the maximum value among the values ​​of n input data. In other words, the module has the following function: determine whether the reference value is the input data with the maximum value in the set.

[0126] In another embodiment, Sa=1 and Sb=n may be set. In this case, the detected quantile is the minimum value among the values ​​of n input data. In other words, the module has the following function: determine whether the reference value is the input data with the minimum value in the set.

[0127] The operation of the processing module 1 can be explained by two examples (in these examples, it is assumed that Sa=Sb=(n+1) / 2, so the detected quantile is the median).

[0128] In the first example, we assume that P0>P1>P2. Then, processing module 1 performs the following operations:

[0129] · Each of the two comparators in the first group provides a positive result to the first adder, such that the first counter reaches a value of 2 after incrementing twice. The value of the first counter is sent to the first secondary comparator, which observes that the value is not strictly less than the first threshold (the value of the first counter is specifically equal to the first threshold with a value of (n + 1) / 2). Therefore, the first secondary comparator generates a negative result.

[0130] · Also, each of the two comparators in the second group provides a negative result to the second adder, thereby keeping the second counter at zero. The value of the second counter is sent to the first secondary comparator, which observes that the value is indeed strictly less than the second threshold (zero is strictly less than (n + 1) / 2). Therefore, the second secondary comparator generates a positive result.

[0131] · Since the two results generated by the two secondary comparators are not both positive, the processing module can conclude that the value P0 is not the median.

[0132] Now we assume P1 < P0 < P2. The processing module 1 operates as follows:

[0133] · Only one of the comparators in the first group provides a positive result to the first adder, such that the first counter reaches a value of 1 after incrementing once. The value of the first counter is sent to the first secondary comparator, which observes that the value is indeed strictly less than the first threshold (1 < 2). Therefore, the first secondary comparator generates a positive result.

[0134] · Similarly, only one of the comparators in the second group provides a positive result to the second adder, such that the second counter reaches a value of 1 after incrementing once. The value of the second counter is sent to the second secondary comparator, which observes that the value is indeed strictly less than the first threshold (1 < 2). Therefore, the second secondary comparator generates a positive result.

[0135] · Since the results generated by the two secondary comparators are both positive, the processing module concludes that the value P0 is indeed the median of the values P0, P1, P2.

[0136] It should be noted that even if several of the n input data have equal values, especially in the case where several values are equal to the detected quantile, the processing module 1 can still operate normally.

[0137] Figure 2 The processing module 2 according to the second embodiment is shown. The second embodiment differs from the first embodiment in the following features.

[0138] The first set of master comparators does not verify a strict order relationship, but is limited to verifying an equality relationship, which has the advantage of allowing a reduction in the surface area of the master comparator. Thus, if the two comparison values are equal, the result provided by the first set of master comparators is positive, while in the opposite case (if the two comparison values are different), the result provided by the first set of master comparators is negative.

[0139] In Figure 2 processing module 2 shown, n = 3, and the master comparator group includes:

[0140] · The first set = type of master comparator, including the following two comparators:

[0141] ο A comparator for verifying whether P0 = P1, and

[0142] ο A comparator for verifying whether P0 = P2,

[0143] · The second set < type of master comparator, including the following two comparators:

[0144] ο A comparator for verifying whether P0 < P1, and

[0145] ο A comparator for verifying whether P0 < P2.

[0146] Thus, in processing module 2, there are two comparators for comparing the value of the reference data with the value of the same other input data, but the comparisons implemented by these two comparators are based on different binary relationships, such that the results provided by these two comparators give different types of information: one result indicates whether the value of the reference data is equal to another value, and the other result indicates whether there is a strict order relationship between the reference data value and the other input data.

[0147] Processing module 2 is configured to cross these two different results to determine whether the other data must be considered for the first adder calculation.

[0148] In practice, this crossing is implemented by an additional logic gate of the exclusive - NOR (NOR) type, which takes the two results as inputs and whose output is connected to the first adder.

[0149] To illustrate the reduction in surface area that can be achieved in processing module 2 compared to processing module 1, the example of 16-bit encoded values ​​will be considered. Then, a comparator for verifying a strict order relationship (equivalent to subtraction in terms of complexity) can be implemented using 16LUT6. At the same time, a comparator limited to verifying equality (equality is a bitwise comparison + a tree of these comparisons) can be implemented using 16 / 3LUT6. Although the cost required to cross the two results is 7LUTs, the cost is still kept low enough to enable the overall surface area of ​​processing module 2 to be reduced relative to processing module 1.

[0150] Figure 3 A processing module 3 according to a third embodiment is shown. The third embodiment differs from the first embodiment in the following features.

[0151] The second set of main comparators does not verify a strict order relationship, but only an equality relationship, which provides the advantage of allowing its surface area to be reduced. Therefore, if the two comparison values ​​are equal, the result provided by the second set of main comparators is positive, and in the opposite case (if the two comparison values ​​are different), the result provided by the second set of main comparators is negative.

[0152] exist Figure 3 In the processing module 3 shown, n=3, and the main comparator includes:

[0153] The first group> type of main comparator includes two comparators:

[0154] ο a comparator to verify whether P0>P1, and

[0155] ο a comparator to verify whether P0>P2,

[0156] The second group = the main comparator of type, including two comparators:

[0157] ο a comparator for verifying whether P0 = P1, and

[0158] o A comparator for verifying whether P0=P2.

[0159] Similar to the second embodiment, in the third embodiment there are two comparators for comparing the value of the reference data with the value of another input data, but the comparison implemented by the two comparators relies on different binary relationships, so that the results provided by the two comparators give different types of information: one of the results indicates whether the value of the reference data is equal to another value, and the other result indicates whether there is a strict sequential relationship between the reference data value and the other input data.

[0160] The processing module according to the second embodiment is configured to interleave the two different results to determine whether further data has to be taken into account by the second adder.

[0161] In practice, this interleaving is achieved by an additional logic gate of the exclusive-OR (NOR) type, which takes the two results as inputs and whose output is connected to the second adder.

[0162] This third embodiment has the same surface area reduction advantage as the second embodiment.

[0163] refer to Figure 4 , the screening device 4 comprises a plurality of processing modules 1. Each of these modules 1 complies with the first embodiment. Of course, it is understood that each of these modules 1 can be replaced by the processing module 2 according to the second embodiment or the processing module 3 according to the third embodiment.

[0164] The screening device 4 comprises n inputs, each input data corresponding to one input.

[0165] Each processing module 1 in the screening device 4 is itself associated with one of the input data. Each processing module 1 is configured to process the input data associated therewith as reference data. Therefore, the number of processing modules 1 of the screening device 4 is at most equal to n. The processing module processes the data of the value Pi as reference data, and the output data Vi indicates whether Pi is a predetermined quantile.

[0166] The process modules 1 in the screening device 4 are arranged in parallel, in the sense that the process modules 1 are configured to operate in parallel.

[0167] Figure 4 In the screening device 4 shown, n=3, so it includes three processing modules 1:

[0168] The first processing module processes the first data with a value of P0 as reference data to generate output data V0 for indicating whether P0 is the desired quantile,

[0169] The second processing module processes the second data with a value of P1 as reference data to generate output data V1 for indicating whether P1 is the desired quantile,

[0170] The third processing module processes the third data having a value of P2 as reference data to generate output data V2 indicating whether P1 is the desired quantile.

[0171] The total number of main comparators is at most equal to 2n(n-1), for example, if n=3, the total number is 12.

[0172] The screening device 4 further comprises a module for generating quantiles 6. The generating module 6 is connected to the outputs of the different processing modules 1 arranged in parallel, so that the generating module 6 receives n data Vi.

[0173] The generating module 6 is used to select one of the n input data as output data according to the data Vi.

[0174] exist Figure 4 In the illustrated embodiment, the generation module 6 has a structure that uses only bitwise AND and OR operators. More precisely, the selection module includes a plurality of bitwise AND logic gates, each of which takes one of the Vi data as input and also takes the associated data Pi as input. The selection module also includes a bitwise OR type logic gate, which takes the respective outputs of the bitwise AND logic gate as input. The bitwise OR type logic gate provides the quantile (e.g., the median of the values ​​of n input data) sought by the screening device 4 as an output. This structure is advantageous because it does not contain any logic with priorities. Therefore, such a structure uses fewer logic levels than a structure containing such priority logic, thereby allowing greater frequency increase potential.

[0175] In a variant, the generation module 6 may comprise a priority encoder of the quantile indicators followed by a multiplexer.

[0176] Figure 5 A screening device 5 according to a second embodiment is shown. The difference between the screening device 5 and the screening device 4 is that the number of processing modules 1 in the screening device 5 is strictly less than n, so that at least one of the n input data, called residual data, is not processed as reference data by any of the processing modules.

[0177] The screening device 5 comprises a supplementing module 7, which is configured to generate output data based on the output data generated by the processing module 1, and the output data generated by the supplementing module indicates whether the remaining data is the desired quantile.

[0178] For example, the number of processing modules is equal to n-1, = so that there is only one remaining input data.

[0179] exist Figure 5 In the particular embodiment shown, the number of processing modules 1 is equal to n-1, or when n=3, the number of processing modules 1 is equal to 2.

[0180] In fact, if all other output data indicate a negative result (ie the corresponding reference data is not the sought quantile), then by process of elimination the input data not associated with the processing module (here P2) must be the sought quantile.

[0181] In practice, the complementary module may be an additional logic gate of the exclusive-OR (or NOR) type, having as input the output of the processing module Vi and comprising an output connected to the quantile generation module 6 .

[0182] The advantage of this embodiment is that since the surface area required for the supplementation module is smaller than the surface area of ​​the processing module 1. Therefore, the overall surface area used to realize the device is reduced.

[0183] The screening devices 4 and 5 are advantageously used in the field of image processing. Figure 6 The image processing device 10 comprises a pixel selection module 12, at least one screening device 4 arranged at the output end of the pixel selection module 12, and an image generation module 14 arranged at the output end of the screening device 4. Of course, in the image processing device 10, the screening device 4 can be replaced by the screening device 5.

[0184] Typically, the image processing device 10 has a function of generating an output image based on a filter of an input image, the filter being implemented by the filter device 4 .

[0185] The pixel selection module 12 is configured to receive an input image A. The input image A comprises a plurality of pixels, each pixel having its specific position in the input image (the position is usually in the form of a pair of row and column indices). Each pixel of the input image A also has a value providing its color information. In the following, it will first be assumed that each pixel of the input image A has a single value indicating a grayscale.

[0186] The pixel selection module 12 is configured to select from the input image A a neighborhood of n pixels associated with a pixel of image A (the so-called primary pixel).

[0187] For example, when n=3, the neighborhood generally includes a primary pixel and two neighboring pixels of the primary pixel. The two neighboring pixels are generally located on either side of the primary pixel (located in the same column or row as the primary pixel of the input image A).

[0188] In another embodiment, where n=9, the neighborhood forms a square pixel centered on the primary pixel, and the neighborhood includes eight neighboring pixels of the primary pixel.

[0189] The screening device 4 is configured to receive as input the respective values ​​of the n pixel neighborhoods selected by the pixel selection module 12. In other words, the input data processed by the screening device 4 are n pixels, which constitute the pixel neighborhood selected by the pixel selection module 12.

[0190] The filtering means 4 provide as input the filtered pixel value V associated with the primary pixel.

[0191] The image processing device 10 is configured to repeat the above steps in multiple consecutive iterations, each iteration taking new pixels of the input image as input, and the new pixels of the input image are regarded as primary pixels by the pixel selection module 12.

[0192] After these successive iterations, the screening means produces as many screened pixel values ​​V as input pixels which were successively processed as primary pixels by the pixel selection module.

[0193] The generation module 14 is configured to generate an output image B based on all these filtered pixel values ​​V provided by the filtering device 4 .

[0194] In a particularly advantageous embodiment of the image processing device 10 , n is an odd number and Sa=Sb=(n+1) / 2 (in this case the filter device 4 acts as a median filter). Specifically, this embodiment enables erroneous pixel values ​​to be eliminated from the input image A.

[0195] In the above, it is assumed that the image processing device 10 is processing a grayscale input image. In a variant, the image processing device 10 can be configured to process a color input image. In this case, each pixel of the input image may not include a single value, but a k-uplet of a color component, which is a feature of the pixel color. For example, a k-uplet is a triple consisting of a red component, a green component, and a blue component. In other words, the input image is a superposition of k basic images, each of which is associated with one of the k components of the input image A.

[0196] The pixel selection module 12 is configured to provide the screening means with n pixel values ​​of a neighborhood belonging to the same color component. The screening means can thus be used k times, once for each component, to allow the generation module to generate a color output image.

[0197] In a variant, the image processing device 10 may comprise k screening devices 4 arranged in parallel, each screening device 4 being associated with one of the k components of the input image.

[0198] Figure 7 A third embodiment of the screening device 11 is shown.

[0199] The screening device 11 comprises all components of the screening device 4, in particular the aforementioned three processing modules 1, and aims to detect whether different input data are predetermined quantiles of the set with the help of thresholds Sa and Sb, hereinafter referred to as the first quantile.

[0200] The screening device 11 further comprises three supplementary processing modules having the same structure as the modules of the device 4, but the three supplementary processing modules use threshold values ​​Sa' and Sb' different from the threshold values ​​Sa and Sb to detect a second quantile different from the first quantile.

[0201] The three complementary processing modules are:

[0202] a fourth processing module, processing the first data with a value of P0 as reference data to generate output data V'0 for indicating whether P0 is the desired second quantile,

[0203] a fifth processing module, processing the second data with a value of P1 as reference data to generate output data V'1 for indicating whether P1 is the desired second quantile,

[0204] A sixth processing module, processing the third data with a value of P2 as reference data to generate output data V'2 for indicating whether P1 is the sought second quantile.

[0205] The screening device 11 comprises the same n inputs as the screening device 4. On the other hand, the screening device 11 comprises two outputs instead of just one output; the first output, already present in the screening device 4, provides the first quantile, while the second output provides the second quantile. The second output is provided by a supplementary quantile generation module, which has, for example, the same Figure 4 The module 6 shown has the same structure.

[0206] Several processing blocks using the same main comparator and the same adder are:

[0207] A first processing module and a fourth processing module,

[0208] A second processing module and a fifth processing module, and

[0209] A third processing module and a sixth processing module.

[0210] It can be seen that in this application, multiple components are shared to obtain multiple different quantiles. This principle can of course be extended to more than two quantiles.

[0211] It can also be considered that, in this embodiment, the processing module 1 is "expanded" to implement the following additional steps:

[0212] - b') comparing the sum calculated in step a) with a third threshold value (Sa'),

[0213] -d') comparing the sum calculated in step c) with a fourth threshold value (Sb'),

[0214] -e') generates output data only when the following two conditions are met: the sum calculated in step a) is strictly or not strictly less than a third threshold value (Sa'), and the sum calculated in step c) is strictly or not strictly less than a fourth threshold value (Sb'), and the output data indicates whether the reference data is a second quantile or multiple quantiles different from the quantile determined in step e).

[0215] In order to make the two quantiles detected by the "extended" module different, the threshold pair (Sa', Sb') is different from the threshold pair (Sa, Sb).

[0216] Symmetric optimization

[0217] exist Figure 4 In the screening device 4 shown, the total number of main comparators required to obtain n data Vi, which are then passed as input to the output selection module, is relatively large.

[0218] In order to reduce said number and thus reduce the total surface area of ​​the screening device 4, the screening device can be arranged so that the main comparator is used not only to generate output data Vi related to input data Pi, but also to generate output data Vj related to different input data Pj.

[0219] This type of optimization is called symmetric optimization because it is based on the symmetry of the comparisons made: "x is strictly greater than y" is equivalent to "y is strictly less than x".

[0220] Figure 8 A symmetry-optimized screening device 8 is shown, wherein n = 3. The screening device 8 comprises the same type of components as the screening device 4, but differs therefrom in that the screening device 8 comprises fewer main comparators.

[0221] Take for example a first processing module associated with first input data with a value of P0 and generating data V0 and a second processing module associated with second input data with a value of P1.

[0222] The main comparator configured to compare the values ​​P0 and P1 of the first input data and the second input data, respectively, is part of the first set of comparators of the first processing module and is also part of the second set of comparators of the second processing module. In other words, the comparator is configured to compare P0 and P1 and provide a result that is subsequently used by two adders, which are:

[0223] an adder of the first processing module, configured to perform step a), and

[0224] The adder of the second processing module is used to perform step c).

[0225] There is another main comparator configured to compare the values ​​P0 and P1 of the first input data and the second input data, respectively, the main comparator forming part of the second set of comparators of the processing module and also part of the first set of comparators of the second processing module. In other words, the main comparator is configured to compare P0 and P1 and provide a result that is subsequently used by two adders, the two adders being:

[0226] an adder of the first processing module, for performing step c), and

[0227] The adder of the second processing module is configured to perform step a).

[0228] Finally, the first processing module and the second processing module share the aforementioned comparator, both of which have the particularity of comparing the respective values ​​of the data associated with the two processing modules.

[0229] This principle can be extended to each pair of processing modules in the screening device. Therefore, the total number of main comparators can be divided by 2, thereby further reducing the implementation surface area of ​​the screening device.

[0230] exist Figure 8 In the embodiment shown, where n=3, the modules removed by symmetric optimization are shown in gray. The total number of main comparators is reduced to 6 (in Figure 4 In the embodiment shown, there are 12).

[0231] It will be appreciated that the same type of symmetric optimization can be performed in a screening device comprising a processing module 2 that meets the requirements of the second embodiment or a processing module 3 that meets the requirements of the third embodiment.

[0232] It can be understood that the screening device 8 after symmetry optimization can replace the screening device 4 in the image processing device 10 .

[0233] Optimization through sliding and

[0234] The process of steps a) and c) performed by any one of the processing modules 1, 2, 3 can also be optimized when the processing modules are repeatedly run by successively iterating over overlapping sets of input data.

[0235] When the processing module according to one of these embodiments is part of a screening device (the screening device itself is also Figure 6 This type of optimization, referred to as optimization by sliding sum, can be performed in particular when the pixel selection module 12 is a part of the image processing device 10 shown in FIG. 1 . Specifically, the pixel selection module 12 can be configured to perform a scan of the input image A so that the neighborhood of n pixels selected during the current iteration overlaps the neighborhood of n pixels selected during the previous iteration. For example, the two neighborhoods are offset horizontally or vertically by one pixel (which means that during these two consecutive iterations, two pixels that are successively processed as reference pixels by the pixel selection module 12 are adjacent).

[0236] In the present application, the "current set" refers to the set of n input data processed by the processing module of the screening device in the current iteration, and the "previous set" refers to the set of n input data processed by the same processing module in the previous iteration.

[0237] The current set differs from the previous set in that the current set includes at least one new data that does not exist in the previous data set, and the current set does not include at least one old data that exists in the previous set. However, the current set shares at least one input data with the previous set.

[0238] Fig. 9 A portion of an input image A is shown, together with two pixel neighborhoods (shown in dashed form) selected by the pixel selection module 12 during two consecutive iterations, where in one embodiment n = 9. In this embodiment, there are three new input data, six common data and three old data.

[0239] In the following, it is assumed that the current iteration and the previous iteration both process the same input data as reference data. In this case, the internal operations of the processing modules implementing these two iterations can be optimized. Figure 1 The example of the processing module of the first embodiment is shown, but the following description is also applicable to Figure 2 and Figure 3 Embodiment of the invention.

[0240] It should be noted that in step a), the number of input data other than the reference data is calculated, and the value of the input data other than the reference data is strictly smaller than the value of the reference data, and in step c), the number of input data other than the reference data is calculated, and the value of the input data other than the reference data is strictly greater than the value of the reference data. Figure 1 , Figure 2 and Figure 3 In the illustrated embodiment, step a) and step c) comprise initializing the first counter and the second counter to zero.

[0241] In order to optimize the implementation of step a) during the current iteration, it is advantageous to save the sum calculated in step a) of the previous iteration. Then, step a) of the current iteration comprises the following steps:

[0242] a1) Initialize the first counter to the stored sum,

[0243] a2) for each new data in the current set, increment the first counter by 1 only if the value of the new data is strictly smaller than the value of the reference data,

[0244] a3) For each old data, only when the value of the old data is strictly smaller than the value of the reference data,

[0245] Decrement the first counter by 1.

[0246] Similarly, in order to optimize the implementation of step c) during the current iteration, the sum calculated in step c) of the previous iteration is advantageously saved. Step c) of the current iteration then comprises the following steps:

[0247] c1) initializing a second counter to the stored sum,

[0248] c2) For each new data in the current set, increment the second counter by one only if the value of the new data is strictly greater than the value of the reference data.

[0249] c3) For each old data, only when the value of the old data is strictly greater than the value of the reference data, the second counter is decremented by one.

[0250] In the above embodiment, steps a2), a3), c2) and c3) use a strict sequential relationship. However, this is not necessary for achieving optimization through sliding.

[0251] In another embodiment, the input data processed as reference data by the same module of the processing modules 1, 2, 3 are different during the current iteration and during the previous iteration. In this case, the optimization by sliding sums implies communication between different processing modules of the screening device. Specifically, steps a1-a3) or steps c1-3) performed by a processing module are based on a sum saved by another processing module.

[0252] These optimizations performed by sliding sums are beneficial because they result in a reduction in the number of comparisons and additions performed by the processing module during the execution of steps a) and c) in the current iteration.

[0253] To achieve this optimization, a ternary adder can be used, which has three inputs instead of Figures 1 to 3 Two inputs are shown (the third input is used to receive the value saved from the previous iteration). This adder can be implemented using a bitwise LUT6.

[0254] Communication optimization

[0255] In the event that two data sets processed in sequence overlap, the total number of comparisons made by the main comparator of the screening device 4 or 8, or even the main comparator of the processing module 1, 2 or 3, can also be limited.

[0256] This optimization, called "propagation optimization", is based on the idea that two common input data between the current set and the previous set do not need to be compared twice, i.e., once during the previous iteration and again during the current iteration. Instead, the comparison result between the two values ​​in the previous iteration is saved and reused by the adder in the current iteration if it turns out that the two values ​​are related to input data that are still present in the set being processed during the current iteration.

[0257] For example, suppose Figure 1 , Figure 2 or Figure 3 One of the processing modules shown (n=3) processed three input data with values ​​P0, P1, P2 during the previous iteration, and the screening device must process a set of input data during the current iteration, which has new input data with value P3, but does not include input data with value P0 (thus the old value). In other words, P0 becomes P1, P1 becomes P2, and P2 becomes P3.

[0258] In this case, during the previous iteration, the result of the comparison of the value P1 and the value P2 may be saved; the saved result may be used by the adder during the current iteration.

[0259] It should be noted that this optimization by propagation is not limited to the case of the iteration immediately preceding the current iteration, but can be generalized to multiple previous iterations, either earlier or less recent, because comparisons that have already been made can be found in older iterations and reused for the current iteration.

[0260] Fig.10 shows a portion of an input image A. In the embodiment, n=9, Fig.10 Two pixel neighborhoods (indicated by thin dashed lines) selected by the pixel selection module 12 during two separate previous iterations, referred to as previous sets, and a pixel neighborhood (whose pixels are shaded) selected by the pixel selection module 12 during the current iteration, referred to as the current set, are shown. In this embodiment, there is one new data, four partially shared data, four completely shared data, and six old data. The term "partially shared data" should be understood as data in the current set that belongs to only one of the previous sets, and the term "completely shared data" should be understood as data in the current set that belongs to two previous sets.

[0261] During the previous iterations, the screening means 4, 8 have generated comparison results between values ​​of completely common data, between values ​​of partially common data and values ​​of completely common data, and between values ​​of partially common data belonging to the same previous set, which have been saved according to the propagation optimization.

[0262] On the contrary, the values ​​of the partial common data sets (from one and the other of the two previous sets, respectively) were not compared by the screening means 4 and 8 during the previous iteration (4 comparisons if n=9). Likewise, the values ​​of the new data were not compared with the values ​​of the other data in the current set (8 comparisons if n=9).

[0263] Thus, if n=9, during the current step, the screening device must perform 12 comparisons with propagation optimization and 72 (9 times 8) comparisons without propagation optimization.

[0264] The propagation optimization thus offers the advantage of significantly reducing the number of comparisons performed during the current iteration, the screening means 4 , 8 being restricted to comparisons whose results have not been produced previously.

[0265] Other variant embodiments of quantile detection

[0266] In the above embodiment, the condition verified in step e) is based on a strict order relationship (<): Therefore, it is verified whether the number obtained in step a) is strictly less than the first threshold Sa, and similarly, it is verified whether the number obtained in step c) is strictly less than the threshold Sb. In addition, the sum of the threshold Sa and the threshold Sb is n+1.

[0267] In a variant, it may be provided that at least one of the two conditions verified in step e) is based on a non-strict order relationship (≤). In this case, the sum of the threshold value Sa and the threshold value Sb may be equal to n-1 (if the two conditions use an order relationship ≤), or may be equal to n (if one of the two conditions uses an order relationship ≤ and the other uses a strict order relationship <). This variant enables the same output data Vi as the output data discussed above to be obtained.

[0268] It is also possible to select the threshold value Sa and the threshold value Sb to have non-integer values.

[0269] In summary, in general, the sum of the two thresholds is equal to n+p, where p is a function that depends on whether the sum calculated in step a) must be strictly less than the first threshold value, and whether the sum calculated in step b) must be strictly less than the second threshold value, for the two conditions to be met. In other words, p is a function of the strict or non-strict order relationship used in step e).

[0270] The detected quantile is not necessarily the median. The quantile f detected by the processing module can be any value (f is a percentage between 0% and 100%). The threshold can be adjusted as follows: Sa = lower round-off (f*n) + 1 and Sb = (n+1) - Sa (vice versa, first calculate Sb = upper round-off ((1-f)*n) and Sa = (n+1) - Sb). The term upper round-off should be understood as lower round-off + 1.

[0271] Generalization of detection of subsets belonging to multiple quantiles

[0272] The processing modules 1, 2, and 3 discussed above have the function of detecting whether the reference input data is a specific quantile, such as the median of n input data.

[0273] Therefore, the detection can be summarized as follows: if the reference data is a quantile of a set of n data contained in a predetermined quantile subset, then the processing module can detect it. The term "subset" of quantiles means that at least one quantile does not belong to the subset. In other words, the desired quantile subset is not a set of all possible quantiles ranging from 0% to 100%, but is included in the range.

[0274] Preferably, at least one of the minimum and maximum values ​​in the set of n data is excluded from the predetermined quantile subset. In other words, the detection applied by the processing module to the reference data with the maximum value or the reference data with the minimum value in the set of n data will be negative.

[0275] In order to obtain this generalization, the thresholds Sa and Sb used in modules 1, 2 or 3 can be set so that their sum does not necessarily equal the value of n+p. These thresholds define continuous subsets of multiple quantiles. It is also conceivable to replicate Figure 7 The device shown is used to obtain multiple discrete subsets of quantiles.

[0276] In a particular variation, the subset of the plurality of quantiles is continuous, includes a median of the set of n data, and includes at least one other quantile.

[0277] Other variant embodiments of the generation module

[0278] In the embodiment shown, the generating module 6 acts as a selector. However, other embodiments may be provided in which the value generated at the output of the generating module does not correspond to any value in the n input data. This situation occurs especially when n is an even number. In this case, there may be two medians (a low median and a high median). The generating module 6 may then calculate the arithmetic mean of the two medians.

[0279] Generalization of weighted input datasets

[0280] In the foregoing embodiment, the input data is counted during steps a) and c) (the value of the increment used to increment the first counter and the second counter is 1).

[0281] However, the n input data processed in any of the above embodiments can be weighted. In this case, each input data is associated with a predetermined weight, which is an addition to the value of the input data. The processing module is then modified.

[0282] In step a), the sum of weights associated only with input data other than the reference data having values ​​strictly less than the value of the reference data is calculated. Similarly, in step c), the sum of weights associated only with input data other than the reference data having values ​​strictly greater than the value of the reference data is calculated. In other words, the first counter and the second counter are incremented by the weights, rather than by increments of 1.

[0283] In addition, the sum of the first threshold value Sa and the second threshold value Sb is equal to s+p, and s is the sum of the weights of the n input data.

[0284] Therefore, the previously described graph-related embodiments include special cases of this general principle, in which the weights of each of the n input data are equal to 1.

[0285] The following specific exemplary embodiments require attention:

[0286]

[0287]

[0288] Furthermore, in the above application, the processing module takes as input n pixels that are used to form a neighborhood of pixels in the image related to a reference pixel, and the weight associated with the neighborhood pixel can be a function of the relative position between the pixel and the reference pixel. By way of non-limiting example, a high weight can be selected to be assigned to the reference pixel compared to pixels assigned to pixels surrounding the reference pixel.

[0289] All the embodiments shown in the figures (where n=3 or n=9) can be generalized to any number n greater than 3. However, the number n is preferably an odd number, which facilitates the implementation of a pixel filter centered on the reference pixel, which takes the reference pixel into account. More preferably, n is the square of an odd number (allowing the implementation of a filter on a square neighborhood around the reference pixel, which takes the reference pixel into account). It should be noted that the cases of n=3, n=9 and n=25 as examples of odd squares are applicable to all the aforementioned embodiments.

[0290] It can be seen that respectively Figure 1 , 2 Each of the processing modules 1, 2 and 3 shown in Figures 1 and 3 is suitable for implementing the method for processing a set of n input data disclosed in the beginning of the specific embodiment of the present application, the method for processing a set of n input data comprising steps a) to d). These different processing modules 1, 2, 3 are usually in the form of electronic circuits (FPGA, ASIC or other); therefore, the different units shown in the figure are physical components included in the electronic circuits. At different levels, the surface area occupied by the processing modules is very limited because they do not perform any complex operations, such as sorting.

[0291] The foregoing also applies to the aforementioned screening device and image processing device.

[0292] However, it is conceivable that the same method for processing n input data is implemented in software by a non-specialized computer. Therefore, the steps of the method are encoded in the form of a computer program executed by one or more processors. Figure 4 and Figure 5 The screening method is implemented in one of the screening devices shown in the figure, or even Figure 6 The image processing method implemented by the image processing device 10 shown in FIG. 1 is also applicable.

[0293] In the embodiment described in the figure, the use of parallel processing modules 1, 2, 3 reduces the average time for determining the desired quantile. In a variant, it is conceivable to repeat the processing method implemented by processing modules 1, 2 or 3 in sequence, instead of executing them in parallel, until a quantile matching the desired quantile is found. This repetition is particularly easy to implement when the method is implemented in software; in this case, only one processor can be used to repeat the processing method implemented by processing modules 1, 2 or 3 in sequence. This variant is slower on average than the parallel variant, but has the advantage of consuming less computational load in time t.

[0294] When the desired value is not a single quantile, but a quantile belonging to a continuous subset of quantiles, sequential execution is very effective. This is because the detection of belonging to a subset is easier to verify than the detection of a single quantile, so the execution speed of the method is still fast. For example, as long as the time required to obtain a quantile close to the exact median is shorter than the time required to obtain the exact median, then the quantile close to the exact median is acceptable.

Claims

1. An image processing device for calculating an output image from an input image, the image processing device comprising: - a pixel selection module configured to select a neighborhood of n input pixels in the input image, each input pixel having a value and associated with a weight, - screening means, configured to screen a neighborhood of n input pixels to produce quantiles of the neighborhood of n input pixels, said quantiles constituting values ​​of pixels of the output image, wherein said screening means comprises: - a plurality of processing modules arranged in parallel, each processing module being configured to perform a detection producing output data indicating whether a reference pixel of a neighborhood associated with the processing module is a quantile of the neighborhood included in a predetermined subset of quantiles, - a quantile generation module, configured to generate the quantile based on the output data respectively generated by the plurality of processing modules, Wherein, the detection includes: a) calculating a first sum of weights associated only with input pixels other than said reference pixel, the input pixels other than said reference pixel having values ​​strictly smaller than the value of said reference pixel, b) comparing the first sum to a first threshold, c) calculating a second sum of weights associated only with input pixels other than said reference pixel, the input pixels other than said reference pixel having values ​​strictly greater than the value of said reference pixel, d) comparing the second sum with a second threshold, e) generating the output data so that the output data indicates that the reference pixel is the quantile only when the following two conditions are met: a first sum is strictly or not strictly less than the first threshold, and a second sum is strictly or not strictly less than the second threshold; and so that when at least one of the two conditions is not met, the output data indicates that the reference pixel is not the quantile.

2. The image processing device according to claim 1, wherein: Each processing module includes: - a plurality of first comparators arranged in parallel, each first comparator being configured to generate a comparison result between the value of the reference pixel and the value of another input pixel in the neighborhood, - a first adder configured to calculate a first sum based on the result generated by the first comparator.

3. The image processing device according to claim 1, wherein: Each processing module includes: - a plurality of second comparators arranged in parallel, each second comparator being configured to generate a comparison result between the value of the reference pixel and the value of another input pixel in the neighborhood, - a second adder configured to calculate a first sum based on the result generated by said second comparator.

4. The image processing device according to claim 1, wherein: Each processing module includes: two comparators, configured to respectively generate two comparison results between the value of the reference pixel and the value of another input pixel in the neighborhood, wherein one of the two comparators is configured to only detect the equality between the value of the reference pixel and the value of another input pixel in the neighborhood, and the other of the two comparators is configured to only detect the sequential relationship between the value of the reference pixel and the value of another input pixel in the neighborhood, and the processing module is also configured to cross the two results to determine whether the weight of the other input pixel of the neighborhood is included in the first sum or the second sum.

5. The image processing device according to claim 1, wherein: The sum of the first threshold and the second threshold is equal to s+p, where s is the sum of the weights of the n input pixels, and where, p depends on whether, for the two conditions to be satisfied, the first sum must be strictly smaller than the first threshold and whether the second sum must be strictly smaller than the second threshold.

6. The image processing device according to any one of claims 1 to 5, wherein: The predetermined subset of quantiles includes a single quantile.

7. The image processing device according to any one of claims 1 to 5, wherein: The predetermined subset of quantiles includes the median of the neighborhood.

8. The image processing device according to any one of claims 1 to 5, wherein: The n weights are all equal to 1.

9. The image processing apparatus according to claim 1, wherein: Calculating the first sum includes: a1) initializing a first counter to the sum calculated during the previous execution of step a), during which one of the processing modules processed a previous pixel neighborhood including the reference pixel, the domain of the n input pixels included at least one new pixel that was not present in the previous pixel neighborhood, and the previous pixel neighborhood included at least one old pixel that was not present in the neighborhood of the n input pixels, a2) for each new pixel, incrementing the first counter by a weight associated with the new pixel only if a predetermined relationship between the value of the new pixel and the value of the reference pixel is verified, a3) For each old pixel, decrementing the first counter by the weight associated with the old pixel only when a predetermined relationship between the value of the old pixel and the value of the reference pixel is verified.

10. The image processing apparatus according to claim 1, wherein: Calculating the second sum involves: c1) initializing a second counter to the sum calculated during the previous execution of step c), during which one of the processing modules processed a previous pixel neighborhood including the reference pixel, the neighborhood of the n input pixels included at least one new pixel that was not present in the neighborhood of the previous pixel, and the neighborhood of the previous pixel included at least one old pixel that was not present in the neighborhood of the n input pixels, c2) for each new pixel, incrementing the second counter by a weight associated with the new pixel only if a predetermined relationship between the value of the new pixel and the value of the reference pixel is verified, c3) For each old pixel, decrementing the second counter by the weight associated with the old pixel only when a predetermined relationship between the value of the old pixel and the value of the reference pixel is verified.

11. The image processing device according to any one of claims 9 and 10, wherein: Each predetermined relationship is a strict order relationship.

12. The image processing apparatus according to claim 1, wherein: The quantile generation module is configured to: f) for each output data generated by any of said processing modules, applying a bitwise AND operation on said output data and the value of a reference pixel associated with said processing module to generate a result, g) applying a bitwise OR operation to the result produced in step f).

13. The image processing apparatus according to claim 1, wherein: The screening apparatus comprises a comparator configured to generate a comparison result between a value of a first pixel in the neighborhood and a value of a second pixel in the neighborhood, and wherein the plurality of processing modules comprises: a first processing module configured to process the first pixel as a reference pixel, the first processing module configured to calculate a first sum or calculate a second sum based on a result generated by the comparator, - a second processing module configured to process the second pixel as a reference pixel, the second processing module being configured to calculate the first sum or calculate the second sum based on the result generated by the comparator.

14. The image processing apparatus according to claim 1, wherein: A neighborhood of n input pixels includes two input pixels shared with a previous pixel neighborhood previously processed by the screening device, and wherein one of the processing modules is configured to calculate a first sum or a second sum based on a comparison result between the two shared input pixels that has been previously generated by the processing module to process the previous pixel neighborhood.

15. The image processing apparatus according to claim 1, wherein: The number of the processing modules arranged in parallel is strictly less than n, so that at least one pixel among the n input pixels, referred to as the remaining pixel, is not processed as a reference pixel by any of the processing modules, and the screening device also includes an additional module, which is configured to generate output data based on the output data generated by the processing module, and the output data generated by the additional module indicates whether the remaining pixel is the quantile.

16. A computer-implemented method for computing an output image from an input image, the computer-implemented method comprising: - select a neighborhood of n input pixels in the input image, each input pixel having a value and associated with a weight, - screening a neighborhood of n input pixels to produce quantiles of the neighborhood of n input pixels, said quantiles constituting values ​​of pixels of the output image, wherein said screening comprises: - performing the detections in parallel, each detection generating output data indicating whether a reference pixel of the neighborhood is a quantile of the neighborhood included in a predetermined subset of quantiles, - generating said quantiles based on output data respectively generated by said detection, Each test includes: a) calculating a first sum of weights associated only with input pixels other than said reference pixel, the input pixels other than said reference pixel having values ​​strictly smaller than the value of said reference pixel, b) comparing the first sum to a first threshold, c) calculating a second sum of weights associated only with input pixels other than said reference pixel, the input pixels other than said reference pixel having values ​​strictly greater than the value of said reference pixel, d) comparing the second sum with a second threshold, e) generating the output data so that the output data indicates that the reference pixel is the quantile only when the following two conditions are met: a first sum is strictly or not strictly less than the first threshold, and a second sum is strictly or not strictly less than the second threshold; and so that when at least one of the two conditions is not met, the output data indicates that the reference pixel is not the quantile.

17. A non-transitory computer-readable medium comprising code instructions for causing a computer to execute the method according to claim 16.