Image segmentation by watershed with optimized image data processing through iterative reconstruction

FR3143806B1Active Publication Date: 2025-03-07SAFRAN ELECTRONICS & DEFENSE (FR)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
FR2022013941
Authority / Receiving Office
FR · FR
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-12-20
Publication Date
2025-03-07
Estimated Expiration
2042-12-20

Smart Images

  • Figure 00000031_0000
    Figure 00000031_0000
  • Figure 00000031_0001
    Figure 00000031_0001
  • Figure 00000031_0002
    Figure 00000031_0002
Patent Text Reader

Abstract

The invention relates to a method implemented by a computing unit comprising: obtaining an image, each pixel of the image being associated with: a label indicating whether the pixel is a source pixel, the sources comprising local pixel intensity extrema of a first type; an identifier of a source associated with the pixel; a pixel intensity; a pixel intensity extremum of a second type on a path between the source associated with the pixel and the pixel, the second type of pixel intensity extremum being the inverse of the first type of pixel intensity extremum; until a stopping criterion is met, at least one iteration of successive pixel traversals of the image. Abstract figure: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

Title of the invention: Image segmentation by watershed with optimized processing of image data by iterative reconstruction Technical field

[0001] The present disclosure relates to the field of image processing. More particularly, the present disclosure relates to the field of image segmentation techniques. Prior art

[0002] Image segmentation consists of separating an image into one or more regions.

[0003] The image segmentation technique known as “watershed” in English allows you to segment an image into different regions corresponding to different light sources or objects in the image.

[0004] [Fig.l] represents an example of an image serving as a basis for a segmentation by watershed.

[0005] The Imgl image is a two-dimensional representation, in which each pixel is associated with an intensity value. The Imgl image can be obtained in different ways. For example, it can be obtained from the output of an infrared, radio, ultraviolet, or visible light sensor, or generated by a computer program.

[0006] The image Imgl shows the different intensity values ​​of the pixels. In the example of [Fig.l], the image is an image obtained by an infrared sensor, and the intensity of each pixel decreases with the gray level, a darker pixel corresponding to a lower intensity. We therefore perceive in this example four distinct light sources Srcl.l, Src2.1, Src3.1, and Src4.1. It should be noted that in this example a source is defined by one or more high intensity pixels, but that depending on the use cases a source can be defined by one or more low intensity pixels.

[0007] Watershed algorithms are used to separate an image such as Imgl into several regions corresponding to different objects or light sources. In the example of [Fig.l], a light source corresponds to a local maximum of intensity (“hot spot” of the image), and the watershed algorithm will therefore assign neighboring pixels of lower intensity to this source. However, watershed algorithms are also applicable to the opposite case, i.e. to cases where a source corresponds to a local minimum of intensity (“cold spot” of the image). In the example of [Fig.l], the sources are therefore local maxima of intensity of the image obtained by infrared sensor. However, in other examples of application of the invention, the sources can form local minima.

[0008] [Fig.2] shows an example of defining light sources in an image for the purpose of applying watershed segmentation.

[0009] The image Img2 corresponds to a definition of labels of the pixels of the image Imgl. Thus, each of the pixels of the image Img2 corresponds to a pixel of the image Imgl with the same coordinates, and defines a label for this pixel: - Pixels Srcl, Src2, Src3 and Src4 correspond to the pixels of 4 light sources respectively; - Pixl pixels correspond to pixels attributable to a region, that is, pixels which are not source pixels, but can be associated with a source to form a region; - PixO pixels correspond to pixels not attributable to a region.

[0010] The difference between Pixl and PixO pixels may consist of their intensity. For example, in the case of Figures 1 and 2 where the sources correspond to low intensity pixels, PixO pixels may be pixels having an intensity greater than a threshold, considered as an intensity threshold for possible membership in a region.

[0011] In an exemplary embodiment according to the state of the art, the water sharing algorithms operate on the principle of a Hierarchical Queue (FAH), that is to say that the pixels to be segmented are successively added to the FAH, then processed and removed from the FAH. The use of FAHs is for example described by the American patent published under number US4809348.

[0012] For example, a state-of-the-art water sharing algorithm may be as follows: - During a first pixel scan: • Each source pixel: • Is stacked in a pile corresponding to its radiometry • Its label is placed in the Imtrait image • Each non-source detected pixel: • is marked as to be labeled • Its level is put in the Imtrait image - As long as there are pixels to label: • As long as the list is not empty: • Popping a pixel (i, j) (highest level) • Each of these neighbors to be labeled (u,v): • Is added to the FAH • Takes the value of the pixel (i,j) in the Imtrait image • No longer declared to be labeled • When the stack is empty, a new pixel to be labeled is identified and:

[0013]

[0014]

[0015]

[0016]

[0017]

[0018]

[0019]

[0020] - It is assigned a new label - We add it to the FAH In other words, when processing each pixel of the FAH, the region of the pixel is propagated to its neighbors to be labeled, which are then themselves added to the FAH. [Fig.3] shows an example of segmenting an image into regions by watershed segmentation. Image Img3 represents the segmentation of images Img1 and Img2 using a watershed algorithm as described above. In the example of [Fig.3], the image has been segmented into 4 regions Reg.3, Reg2.3, Reg3.3 and Reg4.3, corresponding respectively to the sources Srcl, Src2, Src3 and Src4. The PixO pixels are not assigned to any zone. The example in [Fig.3] shows that a state-of-the-art watershed algorithm allows for efficient segmentation of the Imgl image into regions associated with different sources. The watershed segmentation algorithm allows, in particular, for precise allocation of pixels to each of the sources. Region segmentation can be used in various image processing applications. For example, it can be used in object detection, where object detection can be performed on each region separately. While state-of-the-art hierarchical queue segmentation techniques provide an effective solution for segmenting an image into regions, they have characteristics that limit their use for real-time applications or on embedded computers: - the path of the pixels in the image is not known in advance, and the pixels successively processed may belong to completely different areas of the image. The processing of each pixel therefore involves the loading of new image data; a slowdown in the loading of image data from memory implies a latency for each pixel; - the processing of each pixel depends on the result of the processing of the previous pixel. It is therefore not possible to parallelize the processing of pixels. These limitations are further exacerbated by the increase in image size, which implies, as soon as the size of an image exceeds the storage capacity of an internal memory of a computing unit performing the image processing, to store the images in memories external to the processor performing the image processing, for example DDR SDRAM type memories (from the English "Double Data Rate Synchronous Dynamic Random Access Memory"). Indeed, memories external to processors generally have a high latency. Loading image data for each pixel from an external memory therefore often involves a latency high for processing each pixel, which significantly slows down the overall image processing time.

[0021] One solution to improve processing time is to reduce the spatial resolution and / or the number of bits per pixel. However, this involves a significant loss of data, and therefore a significant approximation of the result of the separation algorithm.

[0022] There is thus a need for an image segmentation method by water division optimizing the processing of image data to limit the processing time without significantly reducing the quality of the result obtained. Summary

[0023] The present disclosure improves the situation.

[0024] A method implemented by a computing unit is proposed, comprising: obtaining an image, each pixel of the image being associated with: a label indicating whether the pixel is a source pixel, the sources comprising local pixel intensity extrema of a first type; an indicator of a source associated with the pixel; an intensity of the pixel; a pixel intensity extremum of a second type on a path between the source associated with the pixel and the pixel, the second type of pixel intensity extremum being inverse to the first type of pixel intensity extremum; until a stopping criterion is verified, at least one iteration of traversing successive pixels of the image, said traversal comprising, for at least one current pixel on the path: If the pixel is not a source pixel and if, among the current pixel and the neighboring pixels belonging to a neighborhood of said current pixel,the extremum of the first type among the pixel intensity extrema of the second type on the paths between the sources associated with the pixels and the pixels belongs to a neighboring pixel of said current pixel or if the pixel is a source pixel and if, among the current pixel and the neighboring pixels belonging to a neighborhood of said current pixel and assigned to the same source, the extremum of the first type among the pixel intensity extrema of the second type on the paths between the sources associated with the pixels and the pixels belongs to a neighboring pixel of said current pixel: if the pixel is not a source pixel, the assignment to said current pixel of the source indicator of said neighboring pixel; the assignment, to the value of the intensity extremum of the second type on the path between the source associated with the pixel and the current pixel,of the extremum of the second type between: the value of the intensity extremum of the second type on the path between the source associated with the neighboring pixel and the neighboring pixel; the intensity of said pixel.

[0025] The term “label indicating whether the pixel is a source pixel” means information indicating for each pixel whether it is a source pixel or not. For example, the label may be a Boolean number indicating whether the pixel is a source pixel, a text label indicating “source” or “non-source”, etc. The invention is not limited to a particular label type.

[0026] The term “source indicator” means information that makes it possible to determine the source associated with the pixel. Source indicators can be of different types. For example, sources can be represented by numbers (1, 2, 3, 4, etc.), text labels (“source A”, source B”, etc.), etc.

[0027] "Pixel intensity" means a digital value associated with the pixel indicating an intensity level associated with the pixel. Representations of pixel intensities can be of different types. For example, pixel intensities can be encoded on 8 bits, 16 bits, etc. Pixel intensities are generally represented by unsigned integers. However, the invention is not restricted to this example, and pixels can be represented by any digital representation allowing a comparison of pixel intensities.

[0028] "Intensity extremum" means a minimum or a maximum. One type of intensity extremum represents either a maximum or a minimum. "The second type of pixel intensity extremum being the inverse of the first type of pixel intensity extremum" means that the second type of extremum is a maximum if the first type of extremum is a minimum, and that the second type of extremum is a minimum if the first type of extremum is a maximum.

[0029] Thus, in a set of embodiments of the invention: - the sources may include local minima, in which case the pixel intensity extrema of the second type on the paths between the sources associated with the pixels and the pixels are intensity maxima; - sources may include local maxima, in which case pixel intensity extrema of the second type on the paths between pixel-associated sources and pixels are intensity minima.

[0030] By "a path between the source associated with the pixel and the pixel" is meant the set of pixels having, during successive iterations, propagated information between the source and the current pixel.

[0031] The term “neighborhood of a pixel” means a contiguous set of pixels neighboring a current pixel, which may or may not be immediately contiguous neighbors of the current pixel.

[0032] In the method according to the invention, the allocation of pixels to the different sources is carried out step by step, so that, on the path leading from a source to a pixel, the extremum of the second type (e.g. the maximum intensity on the path between the source and the pixel, if the source comprises a local minimum of intensity, and vice versa) is as close as possible to an extremum of the first type. In other words: - if the sources comprise local minima, the source associated with a given pixel corresponds to the path having the lowest maximum intensity among the paths leading to the different possible sources; - conversely, if the sources include local maxima, the source associated with a given pixel corresponds to the path with the highest minimum intensity among the paths leading to the different possible sources. This allows for efficient watershed segmentation to be obtained, without requiring loss of information and therefore approximation in the result obtained.

[0033] In the method according to the invention, the pixels are processed in a predefined traversal order. The data to be read are therefore known in advance, which makes it possible to anticipate their loading and to mask the latency of accessing the data in memory, in particular when a memory external to the processor performing the operations is used. In a set of embodiments of the invention, the traversals are carried out by successive pixels, for example line by line or column by column. The image data can then be loaded for several contiguous pixels successively, which further limits the latency. [Fig.7] provides several examples of possible traversal directions, with 4 variations of traversal directions of successive pixels by lines, with all combinations of vertical direction (from bottom to top and from top to bottom), and horizontal direction (from left to right and from right to left).

[0034] In addition, processing by successive pixels makes it possible to reuse the results of operations of a current pixel for the next pixel, which reduces the need for access to external memory by using a local "cache".

[0035] Finally, the deterministic path makes it possible to process several lines of pixels of the image in parallel, the parallelization of the operations making it possible to significantly reduce the processing time of the method.

[0036] The method according to the invention therefore makes it possible to benefit from a water-sharing segmentation method providing good quality results, with reduced processing time and latency which can be adjusted as needed.

[0037] According to another aspect, there is provided a computer program comprising instructions for implementing the method according to one of the embodiments of the invention when this program is executed by a processor

[0038] According to another aspect, a device is provided comprising at least one computing unit configured to execute the method according to one of the embodiments of the invention.

[0039] The term "computing unit" means an electronic component capable of performing electronic or computer calculations to carry out a specific function. A computing unit can designate any type of processor or electronic component capable of performing digital calculations. For example, a computing unit can be an integrated circuit, an ASIC (from the English acronym "Application-Specific Integrated Circuit", literally in French "circuit intégré propre à une application"), an FPGA (from the English "Field Programmable Gate Array", literally in situ programmable gate array), a microcontroller, a microprocessor, a DSP (from the English acronym "Digital Signal Processor", literally in French "digital signal processor"), a processor, a GPU (from the English acronym "Graphics Processing Unit", literally in French "graphics computing unit"). A computing unit according to the invention is not limited to a particular type of computing architecture. For example, a processor may implement a Harvard or Von Neumann type architecture.

[0040] The characteristics set out in the following paragraphs may, optionally, be implemented, independently of one another or in combination with one another: of the intensity of the pixel if the pixel is a source pixel; of a predefined value otherwise.

[0041] In some embodiments, the method comprises an initialization step comprising an assignment, to the pixel intensity extremum value of the second type on the path between the source associated with the pixel and the pixel

[0042] In some embodiments, the stopping criterion includes a check that a predefined number of iterations has been completed.

[0043] This makes it possible to ensure that a number of iterations considered sufficient has been carried out, while limiting the execution time of the method.

[0044] In some embodiments, the stopping criterion includes a check that the number of pixels modified during an iteration is less than or equal to a threshold.

[0045] “Modified pixel” means a pixel of which at least one associated value has been modified during the iteration. An associated value may in particular be the source indicator associated with the pixel, and / or the value of the intensity extremum of the second type on the path between the source associated with the pixel and the pixel.

[0046] This makes it possible to stop the iterations when it is considered that the propagation of the values ​​has been sufficient so that the information associated with each pixel no longer fluctuates significantly during a next iteration.

[0047] The threshold may for example consist of a number of pixels (for example, the criterion may be validated if at most 1, 2, or even no pixels have been modified), or a percentage or ratio of the pixels traveled during the iteration (for example, the criterion may be validated if at most 5% or 10% of the pixels traveled have been modified).

[0048] In certain embodiments, the method comprises a plurality of parallel execution iterations of the same pixel path direction on several strips of the image, the plurality of successive iterations corresponding respectively to a plurality of distinct image path directions.

[0049] This makes it possible to process several strips of the image in parallel, and therefore to parallelize calculation operations and reduce calculation times.

[0050] For example, several rows or columns of pixels parallel to each other can be traversed in parallel.

[0051] In certain embodiments, the method comprises, upon validation of the stopping criterion, a step of re-labeling the pixels located in a region without a source.

[0052] A set of pixels does not include a source pixel if none of the pixels in the set is associated with a label indicating that it is a source.

[0053] This allows, when at the end of processing the pixels associated with a source are not located in a region of contiguous pixels of which the source is part, to redefine the pixel source labels, to merge regions and associate each pixel with the best possible source, which will be located in the same region of contiguous pixels as it.

[0054] In some embodiments, the neighborhood of the current pixel comprises all pixels contiguous to the current pixel.

[0055] The use of a neighborhood comprising all the pixels contiguous to the current pixel allows more efficient propagation of information relating to sources and extrema, which can in certain cases limit the number of calculation iterations.

[0056] In some embodiments, using a plurality of different pixel traversal directions during several successive iterations respectively.

[0057] The use of several different paths allows for faster convergence of the process, because the data is propagated in several different or even opposite directions.

[0058] In certain embodiments, the method comprises at least two directions of travel from a group comprising 4 directions of travel, corresponding respectively to a travel of the image from left to right and from top to bottom; a travel of the image from right to left and from bottom to top; a travel of the image from right to left and from top to bottom; a travel of the image from left to right and from bottom to top.

[0059] The use of at least two distinct path directions allows particularly rapid convergence of the pixel values, and therefore limits the number of calculation iterations. Brief description of the drawings

[0060] Other characteristics, details and advantages will appear on reading the detailed description below, and on analyzing the attached drawings, in which:

[0061] [Fig-1] shows an example of an image serving as a basis for a segmentation by watershed.

[0062] [Fig.2] shows an example of defining light sources in the image of [Fig.l] with a view to applying watershed segmentation.

[0063] [Fig.3] shows an example of segmentation of the image of [Fig.l] into regions by a segmentation by water sharing.

[0064] [Fig.4] shows an example of an image segmentation method by sharing according to a set of embodiments of the invention.

[0065] [Fig.5] shows a simplified example based on a single spatial dimension. principle of segmentation by water sharing according to a set of embodiments of the invention. In this simplified example, the sources are local minima of the intensity.

[0066] [Fig.6] shows two examples of neighborhoods of a pixel according to two modes of rea uses of the invention.

[0067] [Fig.7] shows four examples of possible paths of an image in two di mentions in a set of embodiments of the invention.

[0068] [Fig.8] shows the evolution of the variation of the pixels of an image over the successive iterations, depending on the directions of travel used, in an exemplary embodiment of the invention.

[0069] [Fig.9] shows an example of experimental result of evaluation of the number of iterations required to achieve data convergence based on a rotation angle applied to the input image, in an exemplary embodiment of the invention.

[0070] [Fig. 10] shows an example of an image to be segmented in an exemplary embodiment of the invention.

[0071] [Fig. 11] shows an example of source detection on an image in an exemplary embodiment of the invention.

[0072] [Fig. 12] shows an example of initial segmentation of an image into regions according to the sources present in the image in an exemplary embodiment of the invention.

[0073] [Fig. 13] shows an example of segmentation of an image into regions at the end of a first propagation iteration in an exemplary embodiment of the invention.

[0074] [Fig. 14] shows an example of segmentation of an image into regions at the end of a second propagation iteration in an exemplary embodiment of the invention.

[0075] [Fig. 15] shows an example of segmentation of an image into regions at the end of a third propagation iteration in an exemplary embodiment of the invention.

[0076] [Fig. 16] shows an example of a pixel processing parallelization structure in a set of embodiments of the invention. Description of the embodiments

[0077] Reference is now made to [Fig.4].

[0078] The P400 method is an example of a method for segmenting an image by sharing according to a set of embodiments of the invention.

[0079] The method P400 comprises a first step S410 of obtaining an image.

[0080] The image S410 can be obtained in various ways, for example by loading from a file or captured by an image sensor.

[0081] The image S410 may be of different types. For example, it may be an infrared, visible light, ultraviolet, etc. image. For example, the image may be a radiometry image in which the intensity of each pixel corresponds to the intensity of an infrared signal received by each pixel.

[0082] The invention will be described with reference to two-dimensional images, but is not limited to this example, and is for example applicable to images of dimensions less than or greater than 2, for example 1D signals, or 3D volumetric data.

[0083] Each pixel of the image is associated with a set of information comprising: • a label indicating whether the pixel is a source pixel, the source pixels being local intensity extrema of a first type; • an indicator of a source associated with the pixel; • a pixel intensity; • a pixel intensity extremum of a second type on a path between the source associated with the pixel and the pixel, the second type of pixel intensity extremum being the inverse of the first type of pixel intensity extremum. This value may be, in the remainder of this disclosure, called “im_ext”.

[0084] Among this information, some are fixed and form input data. For example, the intensity of each pixel, and the label indicating that it is a source pixel are fixed input data.

[0085] Others are intended to be modified during successive iterations, and can be initialized to initial values. For example, the source indicator associated with the pixel of the non-source pixels can be initialized to a value indicating the absence of a source, then this value can be updated as soon as the pixel is associated with a source. Similarly, the intensity extremum of a pixel of a second type on a path between the source associated with the pixel and the pixel can be initialized to a base value, for example the intensity extremum of the first type among all the possible intensity values ​​of pixels.

[0086] The indication of the source pixels, and of the indicators associated with each source, is obtained at the input of the method. This indication can be obtained from different ways. Indeed, many methods for selecting sources in an image exist, such as the morphological extractor by H-maxima.

[0087] It should be noted that a source may comprise one or more pixels, and that only some pixels are source pixels.

[0088] Reference is now made to [Fig.5].

[0089] [Fig.5] represents for simplicity a variable signal as a function of a single spatial dimension Img5 illustrating the operating principle of a water-sharing segmentation method according to the invention. [Fig.5] deliberately represents a very simple example, in order to schematically illustrate the operation of a method according to the invention.

[0090] If the image Img5 is an image based on a single spatial dimension, the method will be applicable to images of higher dimensions, in particular images in 2 or 3 spatial dimensions.

[0091] In the example of [Fig.5], the intensity of the pixels is represented by the altitude of the curve Courb5. Two sources Srcl.5 and Src2.5 have been identified on the image. In the example of [Fig.5], the sources include local minima. However, not all local minima are necessarily in sources. For example, the image Img5 includes a bowl Cuv5 comprising a local minimum that is not in a source. The image Img5 also includes local maxima, represented on the image Img5 by “cols” Coll.5 and Col2.5.

[0092] The principle of the watershed segmentation algorithm according to the invention consists of assigning the pixels to each source in such a way that, for each pixel, the “highest pass crossed” is as low as possible. For example, in the example of [Fig.5], the pixels PixSrcl.5 will be assigned to the source Srcl.5, and the pixels PixSrc2.5 to the source Src2.5. In particular, the pixels belonging to the basin Cuv5 must be assigned to the source Src2.5, because the “highest pass crossed” Col2.5 is lower than the pass Col 1.5 which should be crossed on the path between the basin Cuv5 and the source Srcl.5.

[0093] For this purpose, the assignment of a source to each pixel is done by a propagation, from pixel to pixel, of the following information: - the source to which the pixel belongs; - the maximum height of the “highest pass” on the path leading from the source to the pixel, i.e. the maximum intensity of the pixels on the path between the source and the current pixel.

[0094] When a pixel is already assigned to a first source, this information can be overwritten by information associated with a second source, if and only if the maximum height of the “highest pass” on the path leading from this 2nd source to the pixel is lower than the maximum height of the “highest pass” on the path of the Ith source to pixel.

[0095] In the example of the figure, the sources are local minima. The extrema of the 1st type are therefore minima, and the extrema of the 2nd type maxima, represented in particular by the passes. The invention is of course not limited to this example, and the sources can be local maxima (extrema of the 1st type), while the extrema of the 2nd type are minima.

[0096] We will now return to [Fig.4] to present the steps of a method according to a set of embodiments of the invention, before concretely illustrating the operation of the invention on 3 pixels Pixl.5, Pix2.5, Pix3.5 of [Fig.5],

[0097] In a set of embodiments of the invention, the method P400 comprises a second initialization step S420.

[0098] The initialization step S420 may comprise the assignment, to the pixel intensity extremum value of the second type on the path between the source associated with the pixel and the pixel: - the intensity of the pixel if the pixel is a source pixel; - a predefined value otherwise.

[0099] The predefined value may be a global extremum. For example, in the example of [Fig.5], the predefined value may be a global maximum intensity on the image, or a maximum possible intensity value taking into account the coding of the intensity of the pixels. More generally, this predefined value may be equal to a value between an extremum of the second type among the pixel intensity values ​​on the image, and an extremum of the second type of the possible pixel intensity values.

[0100] The initialization step S420 may also comprise assigning, to all pixels that are not source pixels, a predefined identifier indicating that the pixel is not associated with any source.

[0101] For example, if the sources are identified by a source number 1, 2, 3... the index 0 can be assigned to each non-source pixel, in order to indicate that it is not associated with any source.

[0102] The method P400 then comprises at least one iteration S430 of traversing successive pixels of the image. Each traversal iteration consists of traversing the image in a predefined order, then performing on at least one pixel calculation steps making it possible to assign, step by step, source indicators to the pixels.

[0103] In a set of embodiments of the invention, all of the pixels are traversed at each iteration.

[0104] In other embodiments, each pixel is further associated with a label indicating whether the pixel is to be processed or not, for example a Boolean value. In this case, the substeps indicated below are only performed for the pixels indicated as to be processed.

[0105] The label can also be modified between different iterations. For example, the number of pixels to be processed can decrease between successive iterations.

[0106] Each iteration includes the following sub-steps.

[0107] A first sub-step S431 consists of selecting a current pixel.

[0108] The selection of pixels can be done by successive pixels, that is to say that, in the order of traversal, each new current pixel is a pixel neighboring the previous current pixel. The selection can therefore consist of selecting: - A first pixel of the route; - Or a pixel adjacent to the previous pixel, in the order of traversal, or a first pixel of the next line, if the previous pixel was a last pixel of a line.

[0109] It should be noted, however, that this example is provided as a non-limiting example only. Pixel traversals not operating line by line can also be used, i.e. successive pixels are not necessarily contiguous in the order of traversal, as long as the pixel traversal is known in advance, which allows the data to be loaded in advance.

[0110] According to different embodiments of the invention, the selection of the current pixel can be carried out on all the pixels of the image, or only a part of them.

[0111] For example, in the example of Figures 2 and 3 where the sources are positioned on local maxima, the PixO pixels must not be associated with a source, because their intensity is too low, i.e. lower than a limit Hmin. These pixels are called background pixels.

[0112] In a set of embodiments of the invention, steps S432 to S434 may therefore not be applied to the background pixels.

[0113] For example, in the example of [Fig.5] where the sources are positioned on local minima, the pixels whose intensity is greater than the limit HMax are identified as being background and can be considered as not having to be associated with a source.

[0114] The path can be done for example by line, column, diagonally... According to different embodiments of the invention, different path orders are possible, certain examples are for example presented in [Fig.7].

[0115] A second sub-step S432 consists of comparing the “im_ext” values ​​of the current pixel, and of pixels neighboring the current pixel.

[0116] Neighboring pixels are pixels belonging to a neighborhood of the current pixel.

[0117] According to different embodiments of the invention, the neighborhood of the current pixel can take different forms. For example, the neighborhood can comprise all the pixels contiguous to the current pixel. Different examples of neighborhood forms are for example example presented in [Fig.6].

[0118] Sub-step S432 comprises a verification of whether the extremum of the first type among the values ​​“im_ext” of the current pixel, and of the pixels neighboring the current pixel is associated with the current pixel or with one of its neighbors.

[0119] Step S432 is performed separately depending on whether the pixel is a source or not.

[0120] If the pixel is a source pixel, only neighbors assigned to the same source as the pixel are taken into account for the comparison.

[0121] Otherwise, all neighbors are taken into account.

[0122] For example, in the example of [Fig.5], the extremum of the first type is a minimum, and the extremum of the second type a maximum. The “im_ext” value of each pixel therefore corresponds to the maximum pixel intensity encountered on the path leading from the source associated with the pixel to the pixel; if a pixel is not yet associated with a source, its “hn_ext” value may have been initialized to a maximum value.

[0123] In this example, sub-step S432 therefore consists of identifying which pixel, among the current pixel and the neighboring pixels, has the lowest “hn_ext” value.

[0124] If it is the current pixel, it is considered that it is already assigned to the source presenting the best path at this iteration.

[0125] Otherwise, that is to say if a neighboring pixel has the lowest hn_ext value, then we consider that the source associated with this neighboring pixel is a better source for the current pixel, since it is associated with a lower pass crossing.

[0126] Of course, this example is provided as an illustrative example in connection with the situation of [Fig.5], in which the sources comprise local minima. A reverse reasoning is also possible, in which the sources comprise local maxima, and step S432 consists of identifying the pixel having the highest im_ext value.

[0127] If the output of step S432 is positive and the pixel is not a source pixel, that is to say if the pixel is not a source pixel, and the extremum of the first type among the values ​​"im_ext" of the current pixel, and of the neighboring pixels of the current pixel is associated with a neighboring pixel, the iteration S430 comprises a sub-step S433 of assigning to said current pixel the source indicator of said neighboring pixel. In other words, it is considered that the source of the neighboring pixel is a better source for the current pixel, and the source indicator of the neighboring pixel is assigned to the current pixel.

[0128] If the output of step S432 is positive, that is to say if the extremum of the first type among the values ​​“im_ext” of the current pixel, and of the pixels neighboring the current pixel is associated with a neighboring pixel when the pixel is not a source pixel, or if the extremum of the first type among the values ​​“hn_ext” of the current pixel, and of the pixels neighboring the current pixel is associated with a neighboring pixel associated with the same source when the pixel is a source pixel, iteration S430 also comprises a sub-step S434 of assigning, to the value of the intensity extremum of the second type on the path between the source associated with the pixel and the current pixel, the extremum of the second type between: - the value of the intensity extremum of the second type on the path between the source associated with the neighboring pixel and the neighboring pixel; - the intensity of said pixel.

[0129] In other words, sub-step S434 consists of modifying the value hn_ext: - either in the hn_ext value of the neighboring pixel; - either in the intensity value of the current pixel.

[0130] The extremum of the second type of these two options is selected. For example, in the example of [Fig.5] where the extremum of the second type is a maximum, the highest value between the im_ext value of the neighboring pixel, and the intensity of the current pixel is selected.

[0131] Thus, if the im_ext value of the neighboring pixel is higher than the intensity of the current pixel (which means that the path between the source and the pixel passed through at least one intensity value, or col, higher than the intensity of the pixel), this value is assigned to the im_ext value of the current pixel.

[0132] On the contrary, if the intensity of the current pixel is greater than the im_ext value of the neighboring pixel, which means that the intensity value of the current pixel is higher than all the intensity values ​​of the pixels encountered from the source, the im_ext value of the current pixel is assigned its intensity value.

[0133] This makes it possible to propagate the information on the maximum intensity encountered on the path between the source and the current pixel, and to update it if the current pixel has a higher intensity than all those encountered until then.

[0134] Iteration S430 then comprises a step S435 of checking whether the pixel traversal is complete. For example, if the traversal is a line, the traversal is considered complete if the last pixel of the line is reached.

[0135] If the traversal is not completed, the iteration S430 includes a return to step S431 consisting of selecting the next pixel in the traversal order, then performing the other operations of the iteration. This makes it possible to limit the processing time, for example to respect real-time constraints.

[0136] It should be noted that steps S434 and S434 of a current pixel can be performed before or after the selection of the next pixel, that is to say that the updating of the information on a pixel can be performed before or after the selection of the next pixel and its processing. Thus, according to different embodiments of the invention, the processing for each pixel can be based on data from previous pixels, updated or not.

[0137] The method P400 comprises, at the end of the iteration S430, a step S440 of verifying a stopping criterion. If the stopping criterion is not verified, the method P400 comprises a new iteration S430 of traversing the pixels.

[0138] Different stopping criteria may be used, alone or in combination.

[0139] For example, the stopping criterion may include a check that a predefined number of iterations has been completed.

[0140] For example, a number of iterations equal to 2, 3, 4, etc. can be carried out.

[0141] The stopping criterion may also include a check that the number of pixels modified during an iteration is less than or equal to a threshold. This makes it possible to guarantee the quality of the result obtained.

[0142] These criteria are provided by way of example only, and other criteria may be used according to different embodiments of the invention. The criteria may also be combined. For example, the stopping criterion may be checked if a predefined number of iterations has been performed AND / OR if the number of pixels modified during an iteration is less than or equal to a threshold.

[0143] In certain specific cases of images with at least two dimensions, it may happen that pixels associated with a source during an iteration find themselves “cut” from this source by a series of pixels associated with another source. In this case, a region may find itself “cut in two” at the end of the iterations.

[0144] In order to correct these cases, in a set of embodiments of the invention, the method P400 may comprise a step (S450) of re-labeling the pixels located in a region without a source

[0145] In practice, this re-labeling step consists of modifying the labels of pixels located in a region without a source, for example so that each pixel associated with a source is located in a region of contiguous pixels of which the source is a part. This step can be carried out in several ways.

[0146] The re-labeling step may include a first region-based re-labeling sub-step, in which each region of contiguous pixels associated with the same source is labeled with a unique region label.

[0147] In other words, contiguous sets of pixels associated with the same source are identified, and labeled as a single region. It should be noted here that, as indicated above, the source associated with this set of pixels may not be there, if the pixels of the set have been cut from the source. In this case, there will be at least two contiguous sets of pixels associated with the same source, but having two distinct unique region labels.

[0148] Then, a so-called label merging sub-step can be implemented to merge each source-free region with a connected region comprising a source.

[0149] This sub-step of merging labels can be implemented in several ways ways.

[0150] According to a first method, the region-based re-labeling step comprises constructing a region-to-region connectivity table indicating for each region which regions are connected. Then, the label merging sub-step identifies, for each region without a source, a connected region comprising a source in the table, and assigns to the region without a source the region code of the connected region with a source.

[0151] In the case where a region without a source is connected to several regions with a source, it can be merged with several regions. The choice of the region with which to merge it can be made in several ways. For example, the first region identified in the table can be selected.

[0152] In another example, the neighboring region to be merged with is that comprising a neighboring pixel of the current region having the extremum of the first type among the pixel intensity extrema of the second type on the paths between the sources associated with the pixels and the pixels belongs to a neighboring pixel of said current pixel.

[0153] The term “neighboring pixel of the region” means a pixel not belonging to the region, but neighboring a pixel of the region.

[0154] Thus, the region to merge with is the one with the “best neighboring pixel,” i.e., the one through which the region label would have propagated during possible successive iterations. This neighboring pixel can be detected during the equivalence resolution sub-step, or stored in the table during the region re-labeling sub-step.

[0155] According to a second method, after the sub-step of re-labeling by regions, the step of merging the labels consists of carrying out a new image traversal to merge a region without source with the first connected region found.

[0156] This makes it possible, in all cases where it is possible, to obtain unique regions comprising the intensity source associated with the pixels.

[0157] At the end of these steps, the method P400 is completed S460.

[0158] The values ​​associated with each pixel, and in particular the source numbers or the unique region labels, can then be provided as output of the process, for example as input to an image processing process. For example, the associations between pixels and sources or unique region labels can be provided as input to an image classification process, which can classify the different regions independently of each other. Another application can be the input to a temporal region tracking process (the regions are called plots) if the processing is done on a sequence of video images. Watershed segmentation is used to achieve the separation of plots into several plots when a plot contains multiple sources.

[0159] Generally, the method makes it possible to segment the pixels of an image into regions. Thus, any information making it possible to identify the segmented regions can be provided as output from the method.

[0160] It should be noted that pixel traversal iterations can be performed on a single traversal at a time, for example with the sequential execution of several pixel traversal iterations for a single operator, but also on several traversals in parallel (for example, several parallel rows or columns) in order to take advantage of the possibility of parallelizing the computational operations, and thus considerably reduce the computational times.

[0161] For example, several paths through the image can be carried out in several different path directions, during a plurality of successive iterations of path through the image, and, within each path iteration, several strips of the image can be processed in parallel in the same path direction.

[0162] This is possible because the successive pixel paths are predefined in the method according to the different embodiments of the invention, whereas they are random in the state-of-the-art methods using hierarchical queues.

[0163] Reference is again made to [Fig.5].

[0164] The application of the method according to the invention will be studied using the 3 pixels Pixl.5, Pix2.5, and Pix3.5, in: - A first scenario where the pixels are traversed from right to left, then from left to right; - A second scenario where the pixels are traversed from left to right, then from right to left.

[0165] In both scenarios, the im_ext value of the three pixels is initialized to the maximum value Hmax, and the neighborhood of a current pixel includes the pixel immediately to the right and immediately to the left of the current pixel.

[0166] In the first scenario, the pixels are scanned from right to left.

[0167] Starting from the source Src2.5, each pixel is successively associated with the source Src2.5, and its im_ext value becomes equal to its intensity.

[0168] For example, when pixel Pixl.5 is selected in this first pass, its im_ext value is still equal to HMax, and its source index indicates that it is not associated with any source. The same is true for the pixel immediately to its left.

[0169] On the other hand, the pixel immediately to the right has just been associated with the source Src2.5: its source identifier is “Src2.5”, and its im_ext value is equal to its intensity, since it is the highest point encountered so far starting from the source Src2.5.

[0170] In step S432, the im_ext values ​​of the current pixel and the two neighboring pixels are compared. The values ​​of im_ext for the current pixel and its left neighbor are equal to both HMax, but the im_ext value of the right neighbor is slightly less than HCol2.5. Thus, the minimum of the three values ​​is the im_ext value of the right neighbor.

[0171] The method then comprises the execution of steps S433 and S434: - The source “Src2.5” is assigned to the current pixel; - The im_ext value of the pixel Pixl.5. becomes the maximum between the intensity of the pixel (equal to HCol2.5) and the im_ext value of the right neighbor (slightly less than HCol2.5), i.e. HCol2.5.

[0172] The pixel path then continues into the Cuv5 well. Here, the pixel intensities are less than HCol2.5, so the information that the source of the pixels is the Src2.5 source is propagated, but the im_ext values ​​of the pixels in the well are all HCol2.5.

[0173] For example, when pixel Pix2.5 is selected during this first pass, its im_ext value is still equal to HMax, and its source index indicates that it is not associated with any source. The same is true for the pixel immediately to its left.

[0174] On the other hand, the pixel immediately to the right has just been associated with the source Src2.5: its source identifier is “Src2.5”, and its hn_ext value is equal to HCol2.5, since it is the highest point encountered so far starting from the source Src2.5.

[0175] In step S432, the hn_ext values ​​of the current pixel and the two neighboring pixels are compared. The im_ext values ​​for the current pixel and its left neighbor are both HMax, but the im_ext value of the right neighbor is HCol2.5. Thus, the minimum of the three values ​​is the im_ext value of the right neighbor.

[0176] The method then comprises the execution of steps S433 and S434: - The value of the source “Src2.5” is assigned to the current pixel; - The im_ext value of the pixel Pixl.5 becomes the maximum between the intensity of the pixel (less than HCol2.5) and the hn_ext value of the right neighbor (equal to HCO12.5), i.e. HCol2.5.

[0177] We note here that in the case of a pit, or more generally of pixels whose intensity is lower than the maximum intensity encountered on the path from the source, the source indicator is propagated, but the im_ext values ​​of the pixels all take the maximum pixel intensity encountered on the path, here HCol2.5.

[0178] On the rest of the path, at the exit of the bowl, that is to say when the intensity of the pixels becomes again greater than HCol2.5, the source indicator continues to be propagated, but the hn_ext values ​​of the different pixels are the intensities of the pixels, since it is each time the maximum intensity encountered from the source.

[0179] For example, pixel Pix3.5 is located just to the right of col Coll.5. The reasoning applied to pixel Pixl.5 applies in the same way, therefore at the end of the iteration: - The value of the source “Src2.5” is assigned to pixel Pix3.5; - The im_ext value of pixel Pix3.5 becomes its intensity, slightly lower than HColl.5.

[0180] In the second pass, from left to right, the source code Srcl.5 is propagated to the pass Coll.5.

[0181] When pixel Pix3.5 is selected, test S432 is applied, i.e. the values ​​of im_ext are compared between the current pixel Pix3.5 and its left and right neighbors.

[0182] In this case: - The hn_ext value of the neighboring pixel on the left, located on the Coll.5 col, is equal to HColl.5; - The im_ext value of the current pixel Pix3.5 is slightly lower; - The im_ext value of the right neighbor is even lower.

[0183] The minimum of the three hn_ext values ​​is therefore that of the right neighbor, associated with the source Src2.5. A propagation identical to the first pass can therefore be carried out, which does not modify any value associated with the pixel Pix3.5.

[0184] We see here that the propagation of the source identifier Srcl.5 is stopped just after the col Coll.5, because the maximum value encountered starting from the source Srcl.5 is equal to HColl.5, while the maximum values ​​encountered starting from the source Src2.5 are lower.

[0185] Let us now study a second scenario, where a first path is taken from left to right, then a second path from right to left.

[0186] During the first scan, all im_ext values ​​of non-source pixels are equal to HMax, and are not associated with any source. Starting from source Srcl.5, all pixels between source Srcl.5 and source Src2.5 are therefore associated with source Srcl.5, and the im_ext values ​​of pixels between col Coll.5 and source Src2.5 become equal to HColl.5, which is the maximum pixel intensity encountered, at col Coll.5, starting from source Srcl.5.

[0187] During the second pixel scan, from right to left, all pixels between pixel Pix3.5 and source Src2.5 are assigned to source Src2.5.

[0188] Indeed, when the condition of step S432 is evaluated for each pixel located between the source Src2.5 and the pixel Pix3.5, the im_ext value of the current pixel is equal to HColl.5, which is the maximum value encountered starting from Srcl.5, but the im_ext value of the neighboring pixel on the right is lower, since it is the maximum value encountered starting from Src2.5.

[0189] All of the reasoning carried out for the first right-to-left path of the first scenario can therefore be reproduced, with the difference that the im_ext value of the current pixel is equal to HColl.5 and not HMax.

[0190] So, scanning the pixels from right to left, all pixels between Src2.5 and Pix3.5 are reassigned to the Src2.5 source.

[0191] It is therefore noted that, in both cases, the method according to an embodiment of the invention makes it possible to segment the image Img5 into two regions separated by the pass Coll.5, and that this separation provides a coherent separation between the different sources, where the source associated with each pixel is the one for which the path from the source to the pixel crosses the lowest possible pass.

[0192] Of course, the example of [Fig.5] is provided as an illustrative and simplified example only, and other information propagation logics are possible within the framework of the invention.

[0193] For example, the sources may be local maxima rather than minima. In this case, the whole logic must be reversed, minima being sought instead of maxima and vice versa. In this case, the initialization value HMax becomes a minimum Hmin, and the sources assigned to each pixel are the sources for which the minimum intensity encountered on the path from the source to the pixel is the highest.

[0194] In the case of 2D images, the neighborhood of the pixels is generally also in 2D, which makes it possible to envisage 2D paths from a source to a pixel. The same is respectively true for 3D volumetric images.

[0195] Reference is now made to [Fig.6].

[0196] [Fig.6] shows two examples of neighborhoods of a pixel according to two embodiments of the invention.

[0197] In both cases, the neighborhood concerns a 2D image, and the pixel traversal is carried out from left to right, then from top to bottom of the image. In other words, the image is traversed line by line, from top to bottom, and, within each line, the traversal is carried out from left to right.

[0198] In both cases, masks VI and V2 contain only contiguous pixels of the current pixel, i.e., the pixels immediately above, below, to the left, to the right, and diagonally of the current pixel.

[0199] The neighborhood V1 is defined around a current pixel Pixl.6, and includes the contiguous pixels already crossed during the pixel traversal, that is to say: - the three contiguous pixels belonging to the upper line (upper left pixel, upper pixel, upper right pixel); - the pixel immediately to the left of the current pixel, on the same line.

[0200] The neighborhood V2 is defined by the set of pixels contiguous to the current pixel Pix2.6, whether or not they have already been crossed by the pixel path, that is to say: - the three contiguous pixels belonging to the upper line (upper left pixel, immediately higher pixel, upper right pixel); - the pixel immediately to the left of the current pixel, on the same line; - the pixel immediately to the right of the current pixel, on the same line; - the three contiguous pixels belonging to the lower line (lower pixel left, pixel immediately below, pixel below right).

[0201] The neighborhoods shown in [Fig.6] are provided solely as examples of neighborhoods usable in embodiments of the invention, and other pixel neighborhoods are conceivable, using only contiguous or non-contiguous pixels.

[0202] The use of a neighborhood comprising pixels contiguous to the current pixel makes it possible to obtain efficient propagation of information relating to sources and extrema, while limiting the number of operations to be carried out.

[0203] The use of a neighborhood such as neighborhood VI, comprising only the pixels contiguous to the current pixel which have already been traversed, makes it possible to limit the computational complexity of the method.

[0204] The use of a neighborhood such as the V2 neighborhood, comprising all the pixels contiguous to the current pixel, allows more efficient propagation of information relating to sources and extrema, which can in certain cases limit the number of calculation iterations.

[0205] However, although the examples in [Fig.6] show neighborhoods containing only pixels contiguous to the current pixel, larger neighborhoods can be defined, which could for example make it possible to reduce the number of passes.

[0206] Reference is now made to [Fig.7].

[0207] [Fig.7] represents 4 types of routes: - A Parc 1.7 route called a “video route” in which the image is scanned from left to right and from top to bottom; - A Parc2.7 route called “anti-video route” in which the image is traveled from right to left and from bottom to top; - A Parc3.7 route called “reverse video route” in which the image is scanned from right to left and from top to bottom; - A Parc4.7 route called “reverse anti-video route” in which the image is traveled from left to right and from bottom to top.

[0208] In each of these examples, a current pixel is represented respectively Pixl.7, Pix2.7, Pix3.7 and Pix4.7, each of the current pixels being respectively associated with the neighborhood V1.7, V2.7, V3.7 and V4.7.

[0209] This example shows how the information contained in the pixels Pixl.7, Pix2.7, Pix3.7 and Pix4.7 respectively propagates.

[0210] For example, the Parc 1.7 path of the pixels is carried out from left to right and from top to bottom. The propagation of the information is therefore essentially towards the bottom and the right, in the zone noted PixFutl.7, even if the use of the V2 neighborhood makes it possible to propagate information slightly to the left, with an offset of the area where the information is propagated by one pixel on each line, and on the line above the Pixl.7 pixel, allowing information to be propagated to pixels in the PixPassl.7 area.

[0211] The Parc2.7 path of the pixels is carried out from right to left and from bottom to top. The propagation of the information is therefore essentially upwards and to the left, in the zone noted PixFut2.7, even if the use of the V2 neighborhood allows information to be propagated slightly to the right, with a shift of the zone where the information is propagated by one pixel on each line, and on the line below the pixel Pix2.7, allowing information to be propagated to the pixels in the PixPass2.7 zone.

[0212] The Parc3.7 pixel path is from right to left and from top to bottom. The propagation of information is therefore essentially downwards and to the left, in the zone noted PixFut3.7, even if the use of the V2 neighborhood allows information to be propagated slightly to the right, with a shift of the zone where the information is propagated by one pixel on each line, and on the line above the pixel Pix3.7, allowing information to be propagated to the pixels in the PixPass3.7 zone.

[0213] The Parc4.7 pixel path is from left to right and from bottom to top. The propagation of information is therefore essentially upwards and to the right, in the zone noted PixFut4.7, even if the use of the V2 neighborhood allows information to be propagated slightly to the left, with a shift of the zone where the information is propagated by one pixel on each line, and on the line below the pixel Pix4.7, allowing information to be propagated to the pixels in the PixPass4.7 zone.

[0214] In other examples, the use of different directions of travel and / or neighborhood to imply a different propagation of the information.

[0215] According to different embodiments of the invention, the same image path can be used, or several different image paths can be used during the different successive iterations.

[0216] For example: - at least two routes chosen from the 4 routes shown in [Fig.4]; - two image paths corresponding to opposite directions of travel of the rows and / or columns can be used; - four image paths corresponding to the 4 possible combinations of respective image path directions of rows and columns (for example the 4 paths Park 1.7, Park2.7, Park3.7, Park4.7) can be used.

[0217] Using several different paths allows for faster convergence of the process, because the data is propagated in several different or even opposite directions. This is true for two separate paths, and even more so for four separate paths.

[0218] Reference is now made to [Fig.8].

[0219] Graph Gr8 represents the evolution of the variation of the pixels of an image during successive iterations, as a function of the directions of travel used, in an exemplary embodiment of the invention.

[0220] The vertical axis AxeV8 represents the percentage of pixels modified at an iteration.

[0221] The horizontal axis AxeH8 represents the index of the current iteration.

[0222] The 7 curves therefore represent the evolution of the percentage of pixels modified at during successive iterations.

[0223] The Evol.8 curve represents an example where only two directions of travel are used. The other curves represent examples where 4 directions of travel are used. The numbering "VI" to V6" corresponds to the 6 different orders combining the 4 possible directions of image travel successively. By convention, we start with the direct video travel (Park 1.7) and there are then 3*2*1 = 6 possible travel orders to make 4 successive travels.

[0224] We note that the state of the pixels tends to converge, that is to say that the percentage of pixels modified at each iteration decreases until it tends towards a zero value.

[0225] It is also noted that the convergence is much faster when 4 directions of travel are used, that is to say that the number of iterations necessary for no or almost no pixels to be modified is much lower. If the stopping criterion used in step S440 is a data convergence criterion, the number of iterations used by the method will therefore be lower.

[0226] This example therefore shows that the use of four directions of travel makes it possible to reduce the number of iterations necessary for the convergence of the process, and therefore the calculation time on a given image.

[0227] Reference is now made to [Fig.9].

[0228] Graph Gr9 represents an example of an experimental result of evaluating the number of iterations necessary to achieve data convergence as a function of a rotation angle applied to the input image, in an example embodiment of the invention.

[0229] In this example, a rotation is applied to the input image before starting the process. The set of angles applied to the image corresponds to uniformly distributed angles from 0° to 354° with a step of 6°. The image is therefore rotated by 0°, 6°, 12°, 18°... 354° depending on the different cases.

[0230] The horizontal axis AxeH9 represents the rotation angle applied to the image

[0231] The vertical axis AxeV9 represents the number of iterations required to converge.

[0232] The image segmentation method is then applied to the image according to the different rotations.

[0233] The points on the graph represent the number of iterations required for converge, depending on the rotation angle of the same image using 2 or 4 types of paths. This figure therefore provides an indication of the variability of the number of iterations to converge depending on the image, depending on whether 2 or 4 types of paths are used.

[0234] It can be seen that the number of iterations required to converge varies significantly depending on the angle applied to the image when 2 image paths are used, but much less if 4 image paths are used. This example therefore shows that the use of the 4 image paths Parcl.7, Parc2.7, Parc3.7 and Parc4.7 makes it possible to limit the number of iterations required to converge, regardless of the image.

[0235] Reference is now made to Figures 10 to 15.

[0236] Figures 10 to 15 represent several successive steps of a method of segmenting an image according to an exemplary embodiment of the invention.

[0237] In [Fig. 10], an image ImglO is obtained.

[0238] As in the example of [Fig.l], the intensity of each pixel increases with the gray level, a darker pixel corresponding to a greater intensity.

[0239] [Fig. 11] represents a source detection applied to the image ImglO.

[0240] The color code is the same as in [Fig.2]: - four sources Src 1.11, Src2.11, Src3.11 and Src4.11 were detected; - Pixll 1 pixels can be associated with a source; - the pixels PixOl 1 cannot be associated with a source (background pixels).

[0241] [Fig. 12] shows the initial association of source labels to the image pixels: the pixels of the four regions Reg.12, Reg 2.12, Reg 3.12 and Reg 4.12 are respectively associated with labels of the four sources Srcl.ll, Src2.11, Src3.ll and Src4.11. The pixels of the region Reg0.12 are not associated with any source either because they belong to the background (PixOl 1 of [Fig.l 1]) or because they have not yet been labeled at this stage (Pixll 1 of [Fig. 11]). It can be seen that at this stage, only the source pixels are associated with a source.

[0242] [Fig. 13] shows the labeling of the sources at the end of a first iteration of traversing the pixels of the image. The pixels of the four regions Reg.13, Reg 2.13, Reg 3.13 and Reg 4.13 are respectively associated with labels of the four sources Srcl.11, Src2.11, Src3.11 and Src4.11. The pixels of the region Reg0.13 are not associated with any source. The traversal used for this iteration is the first type of traversal Parcl.7. We note that at this stage, "cones" of information propagation on the sources are visible, in particular for the region Reg3.13, due to the propagation of the information as shown with reference to [Fig.7].

[0243] [Fig. 14] shows the labeling of the sources at the end of a second iteration of traversing the pixels of the image, according to a second type of traversal different from the first. The pixels of the four regions Reg. 14 Reg 2.14, Reg 3.14 and Reg 4.14 are respectively associated with labels of the four sources Srcl.ll, Src2.11, Src3.ll and Src4.11. The pixels of the region Reg0.14 are not associated with any source.

[0244] [Fig. 15] shows the labeling of the sources at the end of a third iteration of traversing the pixels of the image, according to a third type of traversal different from the first and the second. The pixels of the four regions Reg 1.15, Reg 2.15, Reg 3.15 and Reg 4.15 are respectively associated with labels of the four sources Srcl.ll, Src2.11, Src3.ll and Src4.11. The pixels of the region Reg0.15 are not associated with any source. No modification of the source labels is made compared to the second iteration, the iterations therefore stop at the third, because the convergence criterion is satisfied. In this example, the convergence criterion relates to a number of modified pixel source labels less than a given threshold between two iterations. In this example the threshold is equal to 1, but no source label has been modified between the second and third iterations.

[0245] It is noted that the method according to the invention allows rapid convergence of the segmentation of the pixels of the image into regions associated with the different detected sources.

[0246] Reference is now made to [Fig. 16].

[0247] The method according to one of the embodiments of the invention can be im implemented on different types of computing units, such as: - integrated circuits such as FPGAs, ASICs, - processors, such as microprocessors, CPUs, DSPs or GPUs.

[0248] As indicated above, the method according to one embodiment of the invention has characteristics making it possible to reduce its execution time, in particular when it is implemented on an integrated circuit where an image is loaded from an external memory: - the paths are performed by successive pixels. The image data can therefore be loaded for several pixels successively, which limits the latency of loading the data when a memory external to the processor performing the operations is used; - processing by successive pixels allows the results of operations of a current pixel to be reused for the next pixel; - the deterministic path allows several lines of pixels of the image to be processed in parallel, the parallelization of operations making it possible to significantly reduce the processing time of the process.

[0249] [Fig. 16] thus shows an example of a Structlô structure for parallelizing pixel processing in a set of embodiments of the invention.

[0250] During certain image traversals, the operations performed on a pixel depend of the result of the line above. In this case, to respect the principle that the information of a pixel is updated before the processing of the next pixel, the processing of the different lines can be shifted. The current pixel of a line can thus be updated then transmitted to the structure which calculates the current pixel of another line (2 processors processing 2 consecutive lines are therefore not working on the same column, but on 2 columns shifted by at least one position).

[0251] In the example of [Fig. 16], a strip of 4 lines is loaded into memory, the 4 lines being loaded respectively into 4 memory areas MemLignl.16, MemLign2.16, MemLign3.16 and MemLign4.16.

[0252] These 4 lines are processed respectively by 4 operators OP1.16, OP2.16, OP3.16 and OP4.16. The parallelization structure Structlô also includes in this example a delay line Retl6 which represents the last line of the previous strip. This makes it possible not to reread in external memory the information already read or written, for the information modified during the scan.

[0253] At the end of the processing of the 4-line strip, the last line of the strip becomes the delay line Retl6 in order to avoid having to reload this line for the processing of the next strip.

[0254] The Structlô structure is provided as a non-limiting example only of a parallelization structure according to one embodiment of the invention. Other parallelization structures are conceivable. For example, another example of a parallelization structure according to the invention could work on 4 pixels aligned on the same line. This would require less bandwidth to read the data, to be able to share comparisons (a part of the comparisons between neighbors of the current pixel can be used for processing the next pixel). This makes it possible to reduce the amount of computing resources required for processing.

[0255] The present disclosure is not limited to the examples of method, device, and computer program, described above, only by way of example, but it encompasses all the variants that may be envisaged by those skilled in the art within the framework of the protection sought.

Claims

Claims

1. Method for segmenting a watershed type image (P400) implemented by a calculation unit comprising: - obtaining (S410) an image, each pixel of the image being associated with: • a label indicating whether the pixel is a source pixel, the sources comprising local pixel intensity extrema of a first type; • an indicator of a source associated with the pixel; • a pixel intensity; • a pixel intensity extremum of a second type on a path between the source associated with the pixel and the pixel, the second type of pixel intensity extremum being inverse to the first type of pixel intensity extremum; - until verification (S440) of a stopping criterion, at least one iteration (S430) of traversing successive pixels of the image, said traversing comprising, for each current pixel on the traversing, or each pixel determined as being to be processed: • If the pixel is not a source pixel and if, among the current pixel and the neighboring pixels belonging to a neighborhood of said current pixel, the extremum of the first type among the pixel intensity extrema of the second type on the paths between the sources associated with the pixels and the pixels belongs to a neighboring pixel of said current pixel or • if the pixel is a source pixel and if, among the current pixel and the neighboring pixels belonging to a neighborhood of said current pixel and assigned to the same source, the extremum of the first type among the pixel intensity extrema of the second type on the paths between the sources associated with the pixels and the pixels belongs to a neighboring pixel of said current pixel (S432): if the pixel is not a source pixel, the assignment (S433) to said current pixel of the source indicator of said neighboring pixel; • the assignment (S434), to the value of the intensity extremum of the second type on the path between the source associated with the pixel and the current pixel, of the extremum of the second type between: • the value of the intensity extremum of the second type on the path between the source associated with the neighboring pixel and the neighboring pixel; the intensity of said pixel.

2. Method according to claim 1 comprising an initialization step (S420) comprising: - an assignment, to the pixel intensity extremum value of the second type on the path between the source associated with the pixel and the pixel: • of the intensity of the pixel if the pixel is a source pixel; • of a predefined value otherwise.

3. Method according to one of claims 1 or 2, in which the stopping criterion comprises a verification that a predefined number of iterations has been carried out.

4. Method according to one of claims 1 or 2, in which the stopping criterion comprises a verification that the number of pixels modified during an iteration is less than or equal to a threshold.

5. Method according to any one of the preceding claims comprising a plurality of parallel execution iterations of the same pixel path direction on several strips of the image, the plurality of successive iterations corresponding respectively to a plurality of distinct image path directions.

6. Method according to any one of the preceding claims, comprising, upon validation of the stopping criterion, a step (S450) of relabeling the pixels located in a region without source.

7. Method according to any one of the preceding claims, in which the neighborhood (V2) of the current pixel comprises all of the pixels contiguous to the current pixel.

8. A method according to any preceding claim, comprising using a plurality of different pixel traversal directions in successive iterations respectively.

9. Method according to claim 8, comprising the use of at least two directions of travel from a group comprising 4 directions of travel, corresponding respectively to: - a travel of the image from left to right and from top to bottom (Park 1.7); - a travel of the image from right to left and from bottom to top (Park2.7); - a travel of the image from right to left and from top to bottom (Park3.7); - a travel of the image from left to right and from bottom to top (Park4.7).

10. Computer program comprising instructions for implementing the method according to one of claims 1 to 9 when this program is executed by a processor.

11. Device comprising at least one computing unit configured to execute the method according to one of claims 1 to 9.