PIXEL LABELING PROCESS
The pixel labeling method processes batches of connected pixels with predetermined rules and equivalence table updates, addressing performance bottlenecks in state-of-the-art methods, achieving faster and more efficient image processing.
Patent Information
- Authority / Receiving Office
- FR · FR
- Patent Type
- Patents
- Current Assignee / Owner
- SAFRAN ELECTRONICS & DEFENSE (FR)
- Filing Date
- 2023-12-22
- Publication Date
- 2026-05-08
AI Technical Summary
State-of-the-art image processing methods in embedded optronic devices face limitations due to the need for frequent equivalence requests, resource constraints, and label number limitations, leading to performance bottlenecks and inefficient processing.
A pixel labeling method that processes batches of connected pixels rather than individual pixels, applying labels based on predetermined rules and updating equivalence tables to minimize label generation and processing time.
The method significantly accelerates image processing by 2 to 4 times, reduces label generation, and enhances image labeling capacity, while maintaining the same clock frequency, by efficiently managing equivalence relations.
Smart Images

Figure 00000017_0000 
Figure 00000017_0001 
Figure 00000018_0000
Abstract
Description
Title of the invention: PIXEL LABELING METHOD technical field
[0001] The invention relates to the field of image processing acquired by an embedded optronic device. STATE OF PRIOR ART
[0002] In a known manner, embedded optronic devices integrate image processing functions. These image processing functions are integrated into programmable components of the field-programmable gate array type, also called "FPGA" in English.
[0003] State-of-the-art image processing is based on traversing the image in the natural direction (from left to right then from top to bottom), and labeling the pixels on the stream, at a rate of one pixel per FPGA clock cycle. If in the four pixels passed from the 8-connected neighborhood of a new pixel, there is a pixel already labeled, then the new pixel receives the value of the label of the already labeled pixel.
[0004] Thus, as illustrated in the example in [Fig. 1], by applying the known methods, the pixel at x:2 and y:2 takes the value of the pixel at x:3 and y:1. This is the value of label 1. However, it is possible to start a new labeling process without knowing in advance that this new region will potentially be 8-connected to a region already labeled. This is the case for regions 2 and 3; in [Fig. 1], the pixel at x:5 and y:6 is part of the region labeled 2, connected with the pixel at x:8 and y:6. But this connection information is not known at the time the pixel at x:5 and y:6 is labeled, resulting in the creation of label 3. It will nevertheless be necessary to associate these two regions when the pixel at x:8 and y:6 is processed. So in this case, we need to define an equivalence table that allows us to associate region 3 with region 2. The principle is that the larger region always points towards the smaller region.In a well-known way, equivalence requests are resolved on the stream to always point to the smallest region. This avoids losing branches in atypical shapes and thus having unassociated regions. Finally, when the image traversal is complete, the equivalence table must be traversed to resolve the remaining associations.
[0005] If the processing is carried out at a rate of one pixel per clock cycle, there is only one maximum equivalence request every two clock cycles but one line out of 3, so this makes on an image in which there is an equivalence request every 6 clock cycles on average.
[0006] Next, during implementation, the number of labels must be limited. Indeed, the number of labels defines the size of the equivalence table, which therefore has an impact on the use of resources such as block random access memory (BRAM) in FPGAs and also on the traversal time during association resolution.
[0007] Furthermore, the number of labels defines the number of bits required to encode the label number. This therefore impacts the data volume of the label image, and consequently the resources required for its storage or the bandwidth required to transfer the label image to external (or internal) memory.
[0008] Consequently, during implementation, the number of labels is limited, and often only just, depending on the image types and the resources and bandwidth of the target hardware. Therefore, it is possible to reach this limit even though all the pixels to be labeled have not yet been labeled. In this case, the remaining pixels are simply not labeled. This is a performance limitation related to the implementation.
[0009] In this context, it is necessary to provide an image processing method that is faster for the same clock frequency with a superior image labeling capability. Description of the invention
[0010] To this end, according to a first aspect, a method for labeling pixels of an image comprising a plurality of pixels is proposed, the image being acquired by an optronic device that includes electronic circuitry for implementing the pixel labeling method. The method comprises at least the following steps:
[0011] - acquire at least one batch to be labeled comprising at least two connected pixels label;
[0012] - determine if there is at least one pixel already labeled in contact with the batch to be labeled;
[0013] - if there is at least one pixel already labeled with at least one label in contact with the batch to label, then apply at least one label to the pixels of the batch to be labeled;
[0014] - if there is not at least one pixel already labeled in the vicinity of the batch to be labeled, then create a new label;
[0015] - provide the acquired image including the labeled pixels to a third-party device for of further treatment.
[0016] Thus, in a particularly advantageous way, the method according to the invention makes it possible to process batches of pixels (i.e., a plurality of pixels). Processing batches of pixels allows for faster image processing with a higher image labeling capacity, for the same clock frequency, than known methods. which scan the image pixel by pixel. Indeed, batch pixel processing accelerates the processing of all the pixels in the image. Thus, the method according to the invention can, for example, be two to four times faster than a known prior art method that processes pixels one by one.
[0017] According to a particular arrangement, if there are several pixels already labeled with different labels in contact with the batch to be labeled, then apply one of the different labels to at least one pixel of the batch to be labeled, the label applied being chosen according to a predetermined priority rule.
[0018] According to a particular arrangement, if two connected pixels labeled with distinct labels are detected, the two labels are compared according to a predetermined equivalence table comprising equivalence relations between so-called mother labels associated with so-called daughter labels.
[0019] According to a particular arrangement, the parent labels found associated with at least two daughter labels are compared and the oldest parent label is identified as the parent label in the equivalence table and the daughter labels in the equivalence table are modified to become identical to the identified parent label.
[0020] According to a particular arrangement, the parent labels found associated with at least two daughter labels are identical and the parent label is identified as the parent label in the equivalence table and the daughter labels in the equivalence table are modified to become identical to the identified parent label.
[0021] According to a particular provision, the method includes a step of solving the equivalence table by assigning to each daughter label the oldest possible corresponding parent label.
[0022] According to a particular arrangement, the method includes a step in which the image is traversed to modify the labels whose equivalence relation has changed during the equivalence table resolution step, so that the labels which have become child labels in an equivalence relation are modified to become identical to their respective parent label.
[0023] According to a particular provision, the step of acquiring at least one batch to be labeled includes the acquisition of several batches that are not in contact.
[0024] According to another aspect, an optronic device is proposed which includes electronic circuitry for implementing a pixel labeling method which includes at least the following steps:
[0025] - acquire at least one batch to be labeled comprising at least two connected pixels label;
[0026] - determine if there is at least one pixel already labeled in contact with the batch to be labeled;
[0027] - if there is at least one pixel already labeled with at least one label in contact with the batch to label, then apply at least one label to the pixels of the batch to be labeled;
[0028] - if there is not at least one pixel already labeled in the vicinity of the batch to be labeled, then create a new label;
[0029] - provide the acquired image including the labeled pixels to a third-party device for of further treatment.
[0030] According to another aspect, a computer program product is proposed comprising program code instructions for executing the process according to the invention.
[0031] According to another aspect, a non-transient storage medium is proposed on which is stored a computer program comprising program code instructions to execute the process according to the invention, when said instructions are read from said non-transient storage medium and executed by a processor. Brief description of the drawings
[0032] The features of the invention mentioned above, as well as others, will become clearer upon reading the following description of at least one exemplary embodiment, said description being made in relation to the accompanying drawings, among which:
[0033] [Fig-1] schematically illustrates the implementation of a labeling process;
[0034] [Fig.2] schematically illustrates a pixel labeling method;
[0035] [Fig.3] schematically illustrates the processing of an image by a known process;
[0036] [Fig.4] schematically illustrates the obtaining of labeled pixels by the known process of the [Fig.3];
[0037] [Fig.5] schematically illustrates obtaining an image processed by the known process of Figs. 3 and 4;
[0038] [Fig.6] schematically illustrates the processing of an image by a known process;
[0039] [Fig.7] schematically illustrates the obtaining of labeled pixels by the known process of the [Fig.6];
[0040] [Fig.8] schematically illustrates obtaining an image processed by the known process of Figs. 6 and 7;
[0041] [Fig.9] schematically illustrates the processing of an image by a labeling process;
[0042] [Fig. 10] schematically illustrates the obtaining of labeled pixels by the process of [Fig.9];
[0043] [Fig. 11] schematically illustrates obtaining an image processed by the process of Figs. 9 and 10;
[0044] [Fig. 12] schematically illustrates the application of a label to a pixel of a batch;
[0045] [Fig. 13] schematically illustrates the application of a label to a pixel of a batch using a priority rule;
[0046] [Fig. 14] schematically illustrates the application of a label to a pixel of a batch using a priority rule;
[0047] [Fig. 15] schematically illustrates the application of a label to a pixel of a batch;
[0048] [Fig. 16] schematically illustrates an equivalence table;
[0049] [Fig. 17] schematically illustrates an equivalence table before a step of resolution ;
[0050] [Fig. 18] schematically illustrates the solution of the equivalence table of [Fig.17];
[0051] [Fig. 19] schematically illustrates a computer system.
[0052] [Fig.20] schematically illustrates the equivalence treatment step.
[0053] DETAILED DESCRIPTION OF IMPROVEMENTS
[0054] Pixel labeling method
[0055] With reference to [Fig.2], according to a first aspect, a 100 process is proposed pixel labeling of an image acquired by an optronic device which includes electronic circuitry 200 to implement the pixel labeling process 100.
[0056] The pixel labeling method 100 includes in particular the following steps: - acquiring 101 at least one batch to be labeled comprising at least two connected pixels to be labeled; - determine 102 if there is at least one pixel already labeled in contact with the batch to be labeled; - if there is at least one pixel already labeled with at least one label in contact with the batch to be labeled, then apply 104 at least one label to the pixels of the batch to be labeled; - if there is not at least one pixel already labeled in the vicinity of the batch to be labeled, then create 106 a new label; - provide 110 the acquired image including the labeled pixels to a third-party device for further processing.
[0057] Thus, in a particularly advantageous manner, the method 100 according to the invention allows for the processing of batches of pixels (i.e., a plurality of pixels). Batch pixel processing enables faster image processing, at the same clock frequency, than known methods that scan the image pixel by pixel. Indeed, batch pixel processing accelerates the processing of all the pixels in the image. Thus, the method according to the invention can, for example, be two to four times faster than a known prior art method that processes pixels one by one.
[0058] Furthermore, it is specified that in this document, connected pixels are understood to mean two pixels that are touching (i.e., two pixels that are in contact). More precisely, depending on its position in the image, a pixel can be in contact with up to eight other pixels. It should be noted that an image consists of a pixel matrix, that is, a set of rows and columns of pixels. Thus, a pixel can be in contact with two other pixels on the same row, two other pixels on the same column, two other pixels on one diagonal, and two other pixels on a second diagonal.
[0059] The processing of batches of connected pixels is a particularly ingenious feature of the invention that allows for a significant gain in efficiency compared to prior art methods. Figures 3 to 11 illustrate comparatively the processing of the same image using different prior art methods and method 100 according to the invention. In these figures, the grayed-out pixels are the pixels to be labeled.
[0060] Thus, [Fig. 3] illustrates the processing of an image using a conventional prior art method, in which only one pixel is processed at a time. The pixels are processed from top to bottom and from left to right. The image has sixty-four pixels. Therefore, sixty-four clock cycles are required to label the entire image (at a rate of one pixel labeled per clock cycle). [Fig. 4] illustrates the image of [Fig. 3] labeled using this method. Labeling one pixel at a time resulted in the generation of five different labels. However, as can be seen in the image, labels 1, 2, 3, and 5 refer to adjacent pixels; they therefore all refer to the same object. It is thus necessary to re-scan the image to apply equivalencies to the labels, so that the image illustrated in [Fig. 5] is the final processed image. It should be noted that, in a known way, modifying a label according to an equivalence rule takes several clock cycles.It is therefore clear that the more different related labels the labeling generates, the longer the processing will be because many equivalences will need to be applied. Thus, in other words, according to this method, the total processing time for each pixel requiring a label modification based on an equivalence rule is several clock cycles, compared to a single clock cycle if the pixel does not require any modifications after labeling.
[0061] Figure 6 illustrates a case of the same image as that in Figure 3, processed by simultaneously processing several unconnected pixels. In this example, the pixels are processed in groups of four unconnected pixels. Here, the groups consist of pixels from the same column positioned on every other row. This processing method allows the entire image to be labeled in sixteen clock cycles. However, as illustrated in Figure 7, this processing method generates seven different labels. Therefore, numerous equivalence rules must be applied to obtain the final processed image in Figure 8. As explained previously, Modifying a label according to an equivalence rule takes several clock cycles. It therefore appears that the method in Figs. 6 to 8 is less efficient than the method in Figs. 3 to 5, as it ultimately requires more processing time. Finally, [Fig. 9] illustrates the same image as in Figs. 3 and 6, but processed using method 100. As in the example in [Fig. 9], pixels are processed in batches of two connected pixels.
[0062] As illustrated in [Fig.10], the application of process 100 makes it possible to create only three labels, for a processing in three times fewer clock cycles than the processing of [Fig.3].
[0063] As can be seen, process 100 according to the example in [Fig. 10] generated the creation of only one extra label. The application of equivalences to obtain the processed image in [Fig. 11] is therefore particularly fast compared to known processes.
[0064] Thus, by processing the image in batches of connected pixels, the method 100 according to the invention saves processing time in label generation and also generates a minimal number of labels, resulting in significant time savings. Furthermore, the fact that the method 100 generates fewer labels than prior art methods also provides a higher image labeling capacity than prior art methods. Indeed, processing devices are physically limited to a maximum number of labels that can be generated. Since the method 100 generates fewer labels, it reaches label saturation less quickly when processing a particularly complex image.
[0065] As previously stated, [Fig.2] illustrates the method 100 according to the invention.
[0066] It is specified that according to a particular provision, during step 101, it is possible to acquire several batches of pixels that are not connected.
[0067] Preferably, step 102 of the determination is carried out by traversing the pixels of the image from left to right and from top to bottom. More precisely, since an image is a matrix of pixels, the image therefore comprises rows and columns of pixels that form a matrix (i.e., an array). Step 102 is thus carried out by traversing the image from the top left pixel to the bottom right pixel, progressing in a left-to-right direction and row by row from top to bottom.
[0068] It is specified that although the image is traversed in a conventional direction, a different path through the image could be considered without affecting the processing according to the invention. Batch processing of connected pixels is a particularly advantageous technical feature that fundamentally distinguishes the operation of the pixel labeling process 100 compared to other known pixel labeling processes.
[0069] Application of a label
[0070] If there is at least one pixel already labeled with a single label in contact with the batch to be labeled 104d, then the method 100 applies 104a the label to the pixels of the batch to be labeled.
[0071] In other words, in this configuration, only one label is detected upon contact with the batch to be labeled. The batch to be labeled then takes the single label that was detected upon contact with it.
[0072] This configuration is illustrated in [Fig. 12]. In [Fig. 12], the pixels "a" are pixels of a batch to be labeled. Label 1 is the only one connected to the batch to be labeled. According to this example, the pixels "a" will therefore take the label "1".
[0073] According to another configuration, if there are several pixels already labeled with different labels in contact with the batch to be labeled 104d, then the method 100 applies 104b one of the different labels to at least one pixel to be labeled, the label applied being chosen according to a predetermined priority rule.
[0074] The priority rule is a predetermined (i.e., predefined) rule that establishes a priority order among the labels. This priority order determines which label to choose if it is possible to assign several labels to the same pixel. Thus, for example, the priority rule can be defined based on the position of the labeled pixels surrounding a pixel in a batch to be labeled. Indeed, as previously stated, an image is a matrix of pixels, and each pixel can potentially be in contact with up to eight other pixels. More precisely, since each pixel is a square, it can be in contact with four other pixels on its sides (left, right, top, and bottom) and with four other pixels diagonally (top left, bottom left, top right, and bottom right).Thus, a priority rule can be defined so that a label on a pixel in contact with a side of a pixel to be labeled will have priority over a label on a pixel in contact with a diagonal of a pixel to be labeled. This example is illustrated in [Fig. 13]. In [Fig. 13], the pixels "a" are pixels in a set to be labeled. Labels 1 and 2 are connected to the set of pixels being labeled; the pixels "a" will take label "2," which has priority in the neighborhood.
[0075] According to another example illustrated in [Fig. 14], the pixel PI to be labeled can take the labels of the pixels directly adjacent to it. Thus, according to this example, pixel PI can take the labels 1, 2, 3, or 4. According to this example, the priority order is defined as follows: the left pixel has priority over the top-left pixel. The top-left pixel has priority over the top pixel. The top pixel has priority over the top-right pixel. Therefore, according to the example presented here, the pixel labeled 1 has priority. on the pixel labeled 2, which has priority over the pixel labeled 3, itself having priority over the pixel labeled 4. So according to the example presented here, PI takes the label 1 according to the priority rule.
[0076] According to another configuration, illustrated in [Fig. 15], no label is connected to the batch of pixels to be labeled "a", a new label (label "2") is then created (step 106) and the pixels "a" of the batch will therefore take the new label, label "2".
[0077] Equivalence
[0078] As schematically illustrated in [Fig. 2] and [Fig. 20], the method 100 further includes a step 104c for recording and processing equivalences. It should be recalled that an equivalence must be processed when two pixels labeled with distinct labels are in contact. If two connected pixels labeled with labels are detected 104d, the two labels are compared 104c according to a predetermined equivalence table comprising equivalence relations between labels that point to other labels (i.e., the equivalence table includes equivalence relations between labels that are equivalent to other labels). If a label in the equivalence table points to itself, it is called the parent label. A label in the equivalence table that points to another label is called the child label.The equivalence processing consists of searching for the parent label of each label for which an equivalence needs to be created. The child labels are stored. Then, the parent labels found associated with at least 2 child labels are compared 104c 1, the oldest parent label (i.e. a parent label with a creation date in the process, the oldest which corresponds to the parent label with the lowest label in the equivalence tables), replaces 104c2 the stored child labels associated with the most recent of the parent labels (having a creation date in the process, the most recent).
[0079] If the parent labels found associated with at least two child labels are identical, the parent label is identified as the parent label in the equivalence table, and the child labels in the equivalence table are modified 104c2 to become identical to the identified parent label. In other words, at the start of the process, all the labels in the equivalence table are parent labels because they point to themselves. Each time an equivalence is created, a parent label is updated and points to a label that is not itself; it then becomes a child label.
[0080] During the search for parent labels, it is possible to read one or more child labels before finding the parent label. For example, in a case where the labels are referenced A, B, C, and D, equivalencies for A and B are sought. If, in the equivalency table, A points to A, then a parent label. The search for A's parent label is then complete. If, in the equivalence table, B points to C, C points to D, and D points to D, then D is a parent, and B and C are children (the children of D), and the search for B's parent is complete. If A is older than D, then labels B, C, and D are all updated to point to A. If D is older than A, then A, B, and C are updated to point to D. During an equivalence process, most often a parent label is updated, and possibly child labels are also updated.
[0081] An equivalence table is schematically represented in [Fig. 16]. This example of an equivalence table can be used with the example situation in [Fig. 1]. In [Fig. 1], as described previously, four pixels have been assigned the label 3 and eight pixels have been assigned the label 2. As illustrated in this example, the pixels labeled 3 and the pixels labeled 2 are connected. It is therefore necessary to compare the labels according to the equivalence table to obtain only one set of pixels with the same label. According to the example presented here, the equivalence table in [Fig. 7] indicates that label 3 points to label 2, which is a parent label. A label is said to be a parent label when it points to itself. This is the case for label 2. In other words, according to the example presented here, label 3 points to label 2. We look up label 2 in the equivalence table. Label 2 points to itself; therefore, it is a parent label.Thus, pixels initially labeled 3 have their label changed to receive the label 2 according to this 104c2 equivalence table.
[0082] According to a particular arrangement, the equivalence table is established so that a more recent label points to an earlier label with which it is in contact. In other words, according to the examples presented here, the labels are numerical labels, the first label created is label 1, then label 2 was created, and so on. Thus, according to this example, the higher the numerical value of a label, the more recently it appeared in the process. If two distinct labels are in contact, the higher-value label points to (is the child label of) the label with the lower value. This arrangement makes it very advantageous to associate all the branches of an object with an atypical shape under a single label.
[0083] Furthermore, in a particularly clever way, when a label is chosen according to the predetermined priority rule, this label is recorded (step 104c) in the equivalence table as a label equivalent to the other different labels in contact with the set of pixels to be labeled. In other words, according to this arrangement, when labeling a set of pixels, if the set of pixels is in contact with several already labeled pixels, then a label is chosen (from among those in contact) using the priority rule. This means that the set of pixels that has just been labeled is in contact with other labels. To avoid having to process Subsequently, the equivalence table is updated in real time, and an equivalence is created between the label chosen according to the priority rule and the other labels in contact with the set of pixels. This arrangement allows for the rapid grouping of the largest possible number of pixels under the same label.
[0084] Resolution of equivalences
[0085] According to a particularly advantageous provision, the method further includes a step 108 of solving the equivalence table by assigning to each daughter label the oldest possible corresponding parent label. It is specified that by oldest possible parent label is understood to mean a parent label whose creation date, in the method, is the earliest possible relative to the creation dates of the other parent labels. Typically, the labels can have incremental numeric or alphabetic values. Thus, typically, in the case of labels having numeric values, label 1 is the oldest label. Similarly, in the case of labels having alphabetic values, label A can be the oldest label.
[0086] Preferably, this step can be performed after the pixels have been labeled. This step 108 then consists of traversing the equivalence table again and searching for the oldest parent label for each child label. In other words, according to the example in [Fig. 17], label 6 points to label 5, and labels 5 and 4 point to label 3. Furthermore, label 3 points to label 2. Label 2, which points to itself, is a parent label. The resolution step 108 thus corrects the equivalence table so that labels 2 to 6 point to label 2, as illustrated in [Fig. 18].
[0087] After solving the equivalence table, the method 100 includes a step 109 in which the image is traversed to modify the labels whose equivalence relation changed during the equivalence table solving step, so that the labels that became child labels in an equivalence relation are modified to become identical to their respective parent label. This step makes it possible to group an entire group of connected pixels under the same parent label without any branch being overlooked.
[0088] Provision of the acquired image
[0089] As previously stated, at the end of process 100, the acquired image including the labeled pixels is provided 110 to a third-party device for further processing.
[0090] It is specified that by third-party device, it is understood, for example, to be a computer system, a vehicle using the acquired image, or a moving object using the acquired image for guidance. Of course, this list is not exhaustive, and other examples of third-party devices are possible. Furthermore, by subsequent processing, it is understood for example: a use to guide a vehicle or an object, or for example a use to enable the recognition of a sought-after element in an image.
[0091] Following process 100, the acquired image can also be provided 110 to a third-party device using the processing performed to determine which object appearing in the image each pixel of the image belongs to. This makes it possible to calculate characteristics of this object, for example its surface area. The acquired image can also be provided 110 to a system implementing a "water-sharing" type process.
[0092] The method 100 described in the invention can be integrated into a processing chain whose purpose is the detection and identification of objects in the image. It is also specified that the optronic device described below can be integrated into the third-party device.
[0093] Optronic device
[0094] According to another aspect, an optronic device is proposed comprising one or more optical sensors enabling the acquisition of one or more images.
[0095] In addition, the optronic device includes electronic circuitry (computer system 200) adapted to implement a process 100.
[0096] As schematically shown in [Fig. 19], the computer system 200 may include, connected by a communication bus 210: a processor 201; a random access memory 202; a read-only memory 203, for example of type ROM (“Read Only Memory”) or EEPROM (“Electrically-Erasable Programmable Read Only Memory”); a storage unit 204, such as a hard disk drive (HDD) or a storage media reader, such as an SD card reader (“Secure Digital”); and an input / output interface manager 205.
[0097] The processor 201 is capable of executing instructions loaded into RAM 202 from ROM 203, external memory, a storage medium (such as an SD card), or a communication network. When the computer system 200 is powered on, the processor 201 is capable of reading instructions from RAM 202 and executing them. These instructions form a computer program enabling the processor 201 to implement process 100.
[0098] All or part of the method 100 can thus be implemented in software form by executing a set of instructions by a programmable machine, for example a DSP (Digital Signal Processor) or a microcontroller, or be implemented in hardware form by a dedicated machine or component, for example an FPGA (Field Programmable Gate Array) or ASIC (Application-Specific Integrated Circuit). Generally speaking, the computer system 200 includes circuitry. electronic adapted and configured to implement, in software and / or hardware form, the process in relation to the computer system 200 in question.
[0099] Computer program product
[0100] According to another aspect, a computer program product is also proposed, comprising program code instructions for executing process 100.
[0101] Storage medium
[0102] According to another aspect, a non-transient storage medium is also proposed on which is stored the computer program comprising program code instructions to execute process 100.
Claims
Demands
1. A method (100) for labeling pixels of an image comprising a plurality of pixels, the image being acquired by an optronic device comprising electronic circuitry (200) for implementing the method (100) of pixel labeling, the method (100) being characterized in that it comprises at least the following steps: - acquiring (101) at least one batch to be labeled comprising at least two connected pixels on the same line to be labeled; - determining (102) whether there is at least one pixel already labeled in contact with the batch to be labeled; - if there is at least one pixel already labeled with at least one label in contact with the batch to be labeled, then applying with a priority rule (104) at least one label to the pixels of the batch to be labeled; - if there is not at least one pixel already labeled in the vicinity of the batch to be labeled, then creating (106) a new label;- if there are several pixels already labeled with different labels in contact with the batch to be labeled (104d), then apply (104b) one of the different labels to at least one pixel of the batch to be labeled, the applied label being chosen according to a predetermined priority rule; - provide (110) the acquired image including the labeled pixels to a third-party device for further processing.
2. A method (100) according to claim 1, wherein if two connected pixels labeled with distinct labels are detected (104d), the two labels are compared (104cl) according to a predetermined equivalence table comprising equivalence relations between so-called mother labels associated with so-called daughter labels.
3. Method (100) according to any one of claims 1 or 2, wherein the parent labels found associated with at least two daughter labels are compared (104cl) and the oldest parent label is identified as the parent label in the equivalence table and the daughter labels in the equivalence table are modified (104c2) to become identical to the identified parent label.
4. A method (100) according to claim 1 or 2, wherein the parent labels found associated with at least two daughter labels are identical and the parent label is identified as label mother in the equivalence table and daughter labels in the equivalence table are modified (104c2) to become identical to the identified mother label.
5. A method (100) according to any one of the preceding claims, comprising a step (108) of solving the equivalence table by assigning to each daughter label the oldest possible corresponding parent label.
6. A method (100) according to claim 5 comprising a step in which the image is traversed to modify (109) the labels whose equivalence relation has changed during the equivalence table resolution step, so that the labels which have become daughter labels in an equivalence relation are modified to become identical to their respective parent label.
7. A method (100) according to any one of the preceding claims wherein the acquisition step (101) of at least one batch to be labeled includes the acquisition of several batches that are not in contact.
8. Optronic device characterized in that it comprises electronic circuitry (200) for implementing a pixel labeling method which includes at least the following steps: - acquire (101) at least one batch to be labeled comprising at least two connected pixels on the same line to be labeled; - determine (102) whether there is at least one pixel already labeled in contact with the batch to be labeled; - if there is at least one pixel already labeled with at least one label in contact with the batch to be labeled, then apply with a priority rule (104) the at least one label to the pixels of the batch to be labeled; - if there is not at least one pixel already labeled in the vicinity of the batch to be labeled, then create (106) a new label;- if there are several pixels already labeled with different labels in contact with the batch to be labeled (104d), then apply (104b) one of the different labels to at least one pixel of the batch to be labeled, the applied label being chosen according to a predetermined priority rule; - provide (110) the acquired image including the labeled pixels to a third-party device for further processing.
9. Product computer program comprising program code instructions to perform process (100) according to any of claims 1 to 8, when said program is executed by a computer.
10. Non-transient storage medium on which is stored a computer program comprising program code instructions to execute the method (100) according to any one of claims 1 to 8, when said instructions are read from said non-transient storage medium and executed by a processor.