Object counting apparatus, method, and electronic device

The object counting method improves night-time vehicle detection by converting images into binary masks, generating highlight waveforms from pixel counts, and accurately tracking vehicle passage to enhance accuracy and reduce computational costs.

JP2024114658APending Publication Date: 2024-08-23FUJITSU LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024017966
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-10
Filing Date
2024-02-08
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Vehicle counting at night is challenging due to limited vehicle features in night-time images and interference from headlights, leading to inaccurate detection and tracking.

Method used

An object counting method that converts input images into binary mask images, detects object contours, generates a highlight waveform based on pixel counts, and counts objects using this waveform to improve accuracy and reduce calculation costs.

Benefits of technology

Enhances the accuracy of object counting, particularly at night, by utilizing pixel-based highlight waveforms to filter noise and accurately track vehicle passage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024114658000001_ABST
    Figure 2024114658000001_ABST
Patent Text Reader

Abstract

To provide an object counting apparatus, a method, and an electronic device.SOLUTION: An object counting apparatus comprises: a first detecting unit for converting an input image into a binarized mask image and detecting object contours in the mask image; a first generating unit for generating a highlightwave based on the number of first pixels (i.e., white pixels) in the object contour of each of the mask images; and a first counting unit for counting the number of objects based on the highlightwave. The object counting apparatus according to the present invention performs counting based on the highlightwave obtained from the number of pixels, thereby improving the accuracy of the counting and reducing calculation costs.SELECTED DRAWING: Figure 8
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] FIELD OF THE DISCLOSURE The present invention relates to the technical field of image processing. [Background technology]

[0002] Vehicle counting is one of the most important technologies in Intelligent Transport System (ITS), which helps to analyze traffic distribution and solve the problem of traffic congestion. With the development of artificial intelligence technology, the accuracy of daytime vehicle counting is becoming increasingly higher.

[0003] It should be noted that the above description of the technical background is for the purpose of making the technical solutions of the present invention clear and complete, and is described for the purpose of making those skilled in the art understand. These technical solutions are merely described as part of the background technology of the present invention, and are not well known to those skilled in the art. Summary of the Invention [Problem to be solved by the invention]

[0004] Counting vehicles at night is one of the challenges. Even with advanced deep learning methods, it is difficult to detect and track vehicles because few vehicle features can be extracted from images taken at night. In addition, vehicles with their headlights on also affect the detection results.

[0005] In view of at least one of the above technical problems, an embodiment of the present invention provides an object counting device, method, and electronic device that can improve counting accuracy and reduce calculation costs by performing counting based on a highlight waveform obtained from the number of pixels. [Means for solving the problem]

[0006] In one aspect of an embodiment of the present invention, an object counting device is provided, the device including: a first detection unit that converts an input image into a binarized mask image and detects object contours in the mask image; a first generation unit that generates a highlight wave based on the number of first pixels (i.e., white pixels) in the object contours of each of the mask images; and a first counting unit that counts objects based on the highlight wave.

[0007] In another aspect of an embodiment of the present invention, a method for counting objects is provided, comprising the steps of converting an input image into a binarized mask image, detecting object contours in the mask image, generating a highlightwave based on the number of first pixels (i.e., white pixels) in the object contours in each of the mask images, and counting objects based on the highlightwave.

[0008] In another aspect of an embodiment of the present invention, there is provided an electronic device including a memory having a computer program stored therein and a processor, the processor being configured to execute the computer program to realize the above-mentioned object counting method.

[0009] One of the advantageous effects of the embodiment of the present invention is as follows: In the object counting method of the present invention, the counting is performed based on the highlight waveform obtained from the pixel count, which can improve the counting accuracy and reduce the calculation cost.

[0010] Certain embodiments of the invention are disclosed in detail, as set forth in the following description and in the drawings, which show how the principles of the invention may be employed, but are not intended to be limited in scope, and include all changes, modifications, and equivalents within the spirit and content of the appended claims. [Brief description of the drawings]

[0011] The drawings included herein are for understanding the embodiments of the present invention, constitute a part of this specification, and are for illustrating the embodiments of the present invention, and together with the description of the text, explain the principles of the present invention. Note that the drawings described herein are merely for illustrating the embodiments of the present invention, and those skilled in the art can easily obtain other drawings based on these drawings. [Figure 1] 1 is a schematic diagram of an example of a method for counting objects according to an embodiment of the present invention; [Diagram 2] FIG. 1 is a schematic diagram of an example of converting an input image into a binary mask image in step 101. [Diagram 3] FIG. 2 is a schematic diagram of an example of an input image and a mask image. [Figure 4] FIG. 2 is a schematic diagram of an example of a highlight waveform. [Diagram 5] FIG. 13 is a schematic diagram of an example of a method for counting objects based on highlight waveforms. [Figure 6] FIG. 5 is a schematic diagram of an example of step 501. [Figure 7] FIG. 5 is a schematic diagram of an example of step 502. [Figure 8] FIG. 2 is a schematic diagram of an example of an object counting device. [Figure 9] 1 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0012] The above and other features of the present invention will become apparent from the drawings and the following description. The specification and drawings disclose specific embodiments of the present invention, i.e., some embodiments according to the principles of the present invention. It is to be understood that the present invention is not limited to the described embodiments, and the present invention includes all modifications, variations, and equivalents within the scope of the appended claims.

[0013] In the embodiments of the present invention, the terms "first" and "second" are used to distinguish different elements by name, and do not imply any spatial arrangement or temporal order of these elements, and the elements are not limited to these terms. The term "and / or" includes any one or more of the listed terms and combinations thereof. The terms "including," "including," and "having" refer to the presence of stated features, elements, components or members, but do not exclude the presence or addition of one or more other features, elements, components or members.

[0014] In the present embodiment, the singular forms "a", "the", "the" and the like include the plural, meaning "a kind" or "a class", and are not limited to "one". Additionally, the term "said" includes both the singular and the plural, unless the context clearly dictates otherwise. Additionally, the term "according to" means "at least in part depending on" and the term "based on" means "at least in part based on", unless the context clearly dictates otherwise.

[0015] Features described and / or shown with respect to one embodiment may be used in the same or similar manner in one or more other embodiments, may be combined with features in the other embodiments, or may be used in place of features of the other embodiments. The terms "including" or "including" refer to the presence of a described feature, element, component or member, but do not exclude the presence or addition of one or more other features, elements, components or members.

[0016] <Example 1> An embodiment of the present invention provides a method for counting objects.

[0017] 1 is a schematic diagram of an example of an object counting method according to an embodiment of the present invention. As shown in FIG. 1, the object counting method includes the following steps:

[0018] Step 101: Convert an input image into a binarized mask image, and detect object contours in the mask image.

[0019] Step 102: Generate a highlightwave based on the number of first pixels in the object contour of each of the mask images.

[0020] Step 103: Count the objects based on the highlight waveform.

[0021] According to the first embodiment of the present invention, the object counting method performs counting based on the highlight waveform obtained from the pixel count, which can improve the counting accuracy and reduce the calculation cost. The method of the present invention can improve the object counting result, especially in the night environment.

[0022] In the present invention, the object may be a vehicle such as a car or other object. Since a vehicle such as a car turns on its lights when traveling at night, the object counting method of the present invention is particularly suitable for counting vehicles or objects capable of emitting light traveling at night. In the following description of the present invention, the object is described as a vehicle as an example, but the description is also applicable to the case where the object is another object. Moreover, the method is not limited to a nighttime scenario, but can also be applied to other scenarios where illumination is more sufficient than at night.

[0023] 2 is a schematic diagram of an example of converting an input image into a binary mask image in step 101. As shown in FIG. 2, the method of converting an input image into a binary mask image includes the following steps:

[0024] Step 201: Convert the input image into a grayscale image.

[0025] Step 202: Convert the grayscale image into a binary image based on a threshold value.

[0026] Step 203: A dilation process is performed on the binary image to form the mask image.

[0027] In step 201, the input image may be a color image, for example an RGB color image, which may be from an image frame of a video captured by a surveillance device or stored in a storage device.

[0028] Regarding the method of converting the input color image into a grayscale image in step 201, reference may be made to the prior art.

[0029] In step 202, the pixel value of each pixel of the grayscale image may be compared with a threshold value, and if the pixel value of the pixel is equal to or greater than the threshold value, the pixel may be set to have a first pixel value (e.g., the first pixel value is a pixel value corresponding to a white pixel), and if the pixel value of the pixel is less than the threshold value, the pixel may be set to have a second pixel value (e.g., the second pixel value is a pixel value corresponding to a black pixel).

[0030] In at least one embodiment, the threshold used for each grayscale image may be adjusted, specifically, the threshold used for that grayscale image may be set based on a predetermined ratio of pixels in the grayscale image that correspond to input images of multiple frames prior to the grayscale image.

[0031] For example, if, for a number of input images prior to the current grayscale image, the number of pixels in the corresponding grayscale images whose pixel values ​​are less than a first predetermined value (e.g., the first predetermined value is 60) is greater than a second predetermined value (e.g., the second predetermined value is 80% of the total number in the grayscale image) and the duration of the number of input images exceeds a third predetermined value (e.g., the third predetermined value is 30 seconds), then set the threshold used for the current grayscale image to a first threshold (e.g., the first threshold is 220), otherwise set the threshold used for the current grayscale image to a second threshold (e.g., the second threshold is 180), where the first threshold is greater than the second threshold.

[0032] In step 203, a dilation process is performed on the binary image generated in step 202 to form a mask image. This makes it possible to remove part of the noise in the binary image by filtering. Here, the related art may be referred to for a specific method of dilation process on the binary image.

[0033] In step 101, object contours in the mask image generated in step 203 may be detected, and the detected contours may be filtered. For example, if the number of pixels in a contour is smaller than a fourth predetermined value (e.g., the fourth predetermined value is 10), or if the width or height of a contour is smaller than a fifth predetermined value (e.g., the fifth predetermined value is 30), the contour is deleted. This makes it possible to avoid false detection due to noise in the image, such as uneven lighting.

[0034] Step 101 may output a mask image and information of object contours in the mask image, which may be, for example, a bounding box of the object contour.

[0035] Fig. 3 is a schematic diagram of an example of an input image and a mask image. As shown in Fig. 3(a), an input image 300 may have two regions of interest (ROI) 301 and 302. After performing the operation of step 101 on the input image 300, a mask image 303 shown in Fig. 3(b) can be formed. The region of interest 302 (as shown in Fig. 3(a)) of the mask image 303 has an object contour 304, the bounding box of which is represented as 305.

[0036] In step 102, a highlightwave is generated based on the number of first pixels (eg, the first pixels are white pixels) in the mask image.

[0037] In at least one embodiment, each region of interest (ROI) of the mask image may correspond to one highlight waveform. For example, a vector buffer may be used to store information of the highlight regions in the region of interest of the mask image, and the highlight waveform may be generated based on the information of the highlight regions. Each peak in the highlight waveform may correspond to one object (e.g., the object is a vehicle such as a car) passing through the region of interest.

[0038] Figure 4 is a schematic diagram of an example highlightwave. In Figure 4, curve 401 represents a highlightwave.

[0039] Here, the horizontal axis is the frame number of the input image, and the frame numbers are arranged in ascending order, indicating that time increases. The horizontal axis may also be other parameters corresponding to the frame numbers, but the present invention is not limited thereto. In FIG. 4, the vertical axis is the normalized pixel value. For example, the vertical axis may be expressed as hlratio, where hlratio=hlcount / roiarea, where hlcount is the number of first pixels (e.g., white pixels) in the object contour of the region of interest of the mask image, and roiarea is the number of pixels in the region of interest of the mask image. For example, in the case of the mask image 303 in FIG. 3(b), the ratio hlratio of the number of first pixels in the object contour 304 to the number of pixels in the region of interest 302 (e.g., shown in FIG. 3(a)) is 0.35.

[0040] In step 102, a highlight waveform may be formed using the hlratio of a mask image corresponding to each input image as data. Here, if the hlratio of the mask image is greater than a third threshold (for example, the third threshold is 0.09), the hlratio of the mask image is used as one piece of data for the highlight waveform, and the highlight waveform is formed using the data. Also, if the hlratio of the mask image is equal to or less than the third threshold, the hlratio of the mask image is not used as one piece of data for the highlight waveform. Since a small hlratio may correspond to noise in the mask image, by selecting an hlratio greater than the third threshold as data for the highlight waveform, noise interference can be further avoided and the amount of calculation and memory can be reduced.

[0041] For example, in the 364th frame to the 358th frame, the ratios hlratio between the number of first pixels hlcount in the object contours in the second region of interest in the mask image of each frame and the number of pixels roiarea in the second region of interest are 0.06, 0.1, 0.2, 0.26, 0.31, 0.33, and 0.35, respectively, and the hlratio corresponding to the 364th frame is 0.06, which is smaller than the third threshold, and the hlratios corresponding to the 365th frame to the 358th frame are all larger than the third threshold, so that the hlratios corresponding to the 365th frame to the 358th frame (i.e., 0.1, 0.2, 0.26, 0.31, 0.33, and 0.35) are used as data to form a highlight waveform. The data may be stored in a highlight waveform data buffer (e.g., a highlightwave buffer), and an identifier (ID) of each data may correspond to the frame number of the input image of the data.

[0042] In step 102, if the hlratio of the mask image corresponding to the input image is greater than a fourth threshold (e.g., the fourth threshold is 0.4), it may be determined that the hlratio corresponds to a peak in the highlight waveform. For example, a peak flag may be set to 1 to indicate that the current highlight waveform data corresponds to a peak. In the present invention, a peak flag may be maintained separately for each region of interest in the input image, whereby the peak flag may be an array, and the size of the array is the number of regions of interest. Also, the initial value of the peak flag corresponding to each region of interest may be 0.

[0043] When the hlratio of the mask image corresponding to each input image is gradually reduced to the third threshold or less and the peak flag peakflag=1, it is determined that one peak has already appeared in the highlight waveform, that is, an object (e.g., a vehicle) has passed through the region of interest. At this time, step 103 may be executed, that is, the number of objects may be counted based on the highlight waveform.

[0044] In step 103, peaks in the highlight waveform may correspond to the passage of objects through the region of interest, e.g., one peak in the highlight waveform may correspond to the passage of one object through the region of interest. Thus, in at least one embodiment, when a peak appears in the highlight waveform, a count of objects passing through the region of interest may be increased by one.

[0045] In the present invention, in order to avoid interference and improve the accuracy of counting objects, the moving direction of the object corresponding to the peak in the highlight waveform may be determined, and the count value of the object may be determined based on the result of the determination of the moving direction. For example, it is determined whether the moving direction of the object corresponding to the peak in the highlight waveform coincides with the predetermined moving direction of the object in the region of interest, and if it coincides, it is determined that the peak corresponds to the object passing through the region of interest, and the count value of the object passing through the region of interest is increased (for example, increased by 1); if it does not coincide, it is determined that the peak does not correspond to the object passing through the region of interest, and the count value of the object passing through the region of interest is not increased by 1.

[0046] In some aspects, the count value of an object may be determined based on both the moving direction and the moving distance of an object corresponding to a peak in the highlight waveform. For example, if the moving direction of an object corresponding to a peak in the highlight waveform matches the predetermined moving direction of an object in the region of interest and the moving distance of the object is equal to or greater than a distance threshold, the peak is determined to correspond to an object passing through the region of interest, and the count value of the object passing through the region of interest is increased (e.g., increased by 1). Otherwise, the peak is determined not to correspond to an object passing through the region of interest, and the count value of the object passing through the region of interest is not increased by 1.

[0047] 5 is a schematic diagram of an example of a method for counting objects based on highlight waveforms. As shown in FIG. 5, the method for counting objects based on highlight waveforms includes the following steps:

[0048] Step 501: For a peak in the highlight waveform, two frame numbers corresponding to data having a predetermined value on either side of the peak are determined.

[0049] Step 502: Obtain the bounding boxes of the object contours corresponding to the two frame numbers respectively, compare the positions of the two bounding boxes, and determine the moving direction and moving distance of the object corresponding to the peak.

[0050] Step 503: If it is determined that the moving direction of the object corresponding to the peak coincides with a predetermined moving direction of the object in the region of interest and the moving distance is equal to or greater than a distance threshold, the count value of the object passing through the region of interest is increased.

[0051] Fig. 6 is a schematic diagram of an example of step 501. As shown in Fig. 6, in step 501, for a peak 601 in the highlight waveform, frame numbers f1 and f2 corresponding to data 602 and 603 having predetermined values ​​on both sides of the peak may be determined. Here, data 602 may be the first data on the left side of the peak 601 that is equal to or greater than a threshold T (for example, the threshold T may be 0.2), and data 603 may be the last data on the right side of the peak 601 that is equal to or greater than a threshold T.

[0052] Figure 7 is a schematic diagram of an example of step 502. As shown in Figure 7, step 502 determines that for frame numbers f1 and f2 determined in step 501, input image 701 with frame number f1 corresponds to bounding box 7011 of the object contour, and input image 702 with frame number f2 corresponds to bounding box 7021 of the object contour.

[0053] In step 502, the distance in a predetermined direction between the circumscribing bounding box 7011 and the circumscribing bounding box 7021 is calculated, and in Fig. 7, the predetermined direction is the height direction of the input image. The predetermined direction may also be the width direction of the input image, or a direction forming a predetermined angle with the height direction or the width direction.

[0054] The distance between the upper edge of the circumscribing bounding box 7011 and the upper edge of the circumscribing bounding box 7021 may be dy1 (for example, dy1 is obtained by subtracting the coordinate value of the upper edge of the circumscribing bounding box 7011 from the coordinate value of the upper edge of the circumscribing bounding box 7021), and the distance between the lower edge of the circumscribing bounding box 7011 and the lower edge of the circumscribing bounding box 7021 may be dy2 (for example, dy2 is obtained by subtracting the coordinate value of the lower edge of the circumscribing bounding box 7011 from the coordinate value of the lower edge of the circumscribing bounding box 7021). As a result, the distance dy between the circumscribing bounding box 7011 and the circumscribing bounding box 7021 in the specified direction is the maximum value of dy1 and dy2, that is, dy=max(dy1, dy2).

[0055] In step 502, the distance in a given direction between the bounding box 7011 and the bounding box 7021 is a positive value, i.e., the object moves in a bottom-to-top direction in the height direction of the input image. The absolute value of the distance dy is, for example, greater than or equal to a distance threshold. The distance threshold may be related to the size of the region of interest 700, for example, the distance threshold may be equal to 0.2*roi_length, where roi_length may be equal to the height of the region of interest 700.

[0056] In Fig. 7, even in the region of interest 700 in which the circumscribing bounding boxes 7011 and 7021 are located, the predetermined movement direction of the object is from bottom to top in the height direction of the image. In Fig. 7, the movement direction of the object determined in step 502 matches the predetermined movement direction of the object in the region of interest 700, and |dy|≧0.2*roi_length, so the peak 601 in Fig. 6 corresponds to an object passing through the region of interest 700, and in step 503, the count value of the object passing through the region of interest 700 is increased (e.g., the count value of the object in the region of interest 700 is increased by 1).

[0057] In at least one embodiment of the present invention, as shown in FIG. 1, the object counting method may further include the following steps.

[0058] Step 104: Count the objects based on the results of object detection and tracking performed on the input image.

[0059] Step 105: Merging the highlight waveform-based counting result and the tracking-based counting result.

[0060] In step 104, object detection and tracking may be performed on the input image to obtain trajectory information of each object. Also, when the object is detected to reach a predetermined position in the image (for example, the predetermined position may be a counting line preset in the image), one counting may be performed, i.e., one is added to the count value of the object passing through the region of interest. One count value is respectively maintained for each region of interest. For a detailed description of step 104, reference may be made to the related art, and a detailed description will be omitted in the embodiments of the present invention.

[0061] In step 105, the highlight waveform-based counting result (e.g., the counting result of step 103) and the tracking-based counting result (e.g., the counting result of step 104) are merged. For example, the highlight waveform-based counting result and the tracking-based counting result are added to obtain a total counting result. Step 105 may also process the highlight waveform-based counting result and / or the tracking-based counting result to avoid double counting.

[0062] In at least one aspect of step 105, the method of avoiding duplicate counting may be the following method. When the count value of the current region of interest changes in the counting operation based on the tracking result within the first period, the waveform counting flag value (wavetimetrackcnt) corresponding to the first period is increased (for example, 1 is added). Also, when counting based on the highlight waveform for the data of the first period, if the waveform counting flag value (wavetimetrackcnt) corresponding to the first period is not an initial value (for example, the initial value is 0), the count value based on the highlight waveform is not changed, that is, counting based on the highlight waveform is not performed using the data of the first period, or the count value based on the highlight waveform using the data of the first period is reset.

[0063] For example, before performing counting based on the highlight waveform using the data of the first period, it may be confirmed whether the waveform counting flag value (wavetimetrackcnt) is at its initial value, and if the waveform counting flag value (wavetimetrackcnt) is at its initial value, counting based on the highlight waveform using the data of the first period may be performed, and if the waveform counting flag value (wavetimetrackcnt) is not at its initial value (e.g., greater than the initial value), counting based on the highlight waveform using the data of the first period may not be performed.

[0064] Also, for example, after performing counting based on the highlight waveform using the data of the first period, it may be confirmed whether the waveform counting flag value (wavetimetrackcnt) is at its initial value, and if the waveform counting flag value (wavetimetrackcnt) is at its initial value, counting based on the highlight waveform using the data of the first period may be suspended, and if the waveform counting flag value (wavetimetrackcnt) is not at its initial value (for example, greater than its initial value), the counting value based on the highlight waveform using the data of the first period may be reset.

[0065] In at least one other aspect of step 105, a method for avoiding duplicate counting may be the following method: During a period of counting based on a highlight waveform, a bounding box of an object contour in a mask image (e.g., referred to as a highlight box) is compared with a bounding box of an object obtained by tracking, and if there is an overlap, a count flag (countflag) of the object obtained by tracking is set to a first value (e.g., the first value may be 1), and when counting based on the tracking result, an object whose count flag (countflag) is the first value is not counted.

[0066] For example, during a period (e.g., a second period) in which counting based on the highlight waveform is being performed, the bounding box (e.g., called a highlight box) of the object contour in the mask image corresponding to the current input image frame is compared with the bounding box of each object obtained by tracking in the current input image frame, and if the two bounding boxes overlap (e.g., the overlapping area or overlapping ratio is greater than a predetermined value), the count flag (countflag) of the object obtained by tracking is set to a first value. Also, if the boundary box (highlight box) of the object contour in the mask image corresponding to the current input image frame does not overlap with the boundary box of each object obtained by tracking in the current input image frame, the frame number f1 (for example, frame number f1 shown in FIG. 6) of the data of the highlight waveform data of the second period that is equal to or greater than the first threshold T (for example, the threshold T may be 0.2) is determined, and it is determined whether the boundary box of the object contour in the mask image corresponding to the frame number f1 overlaps with the boundary box of each object obtained by tracking in the input image of frame number f1, and if there is an object whose boundary box overlaps with the boundary box of the object contour in the mask image, the count flag (countflag) of the object obtained by tracking in the input image of frame number f1 is set to a first value. Also, when performing counting based on the tracking result, counting is not performed for objects whose count flag (countflag) is the first value, and counting is performed based on the tracking result for objects whose count flag (countflag) is not the first value.

[0067] The above merely describes steps or processes related to the present invention, and the present invention is not limited thereto. The object counting method may further include other steps or processes, and the specific contents of these steps or processes may refer to the prior art. In addition, the above merely exemplifies the embodiments of the present invention by taking some structures of the models used by the object counting method as examples, and the present invention is not limited to these structures, and appropriate modifications may be made to these structures, and these modifications should be included in the scope of the embodiments of the present invention.

[0068] The above-mentioned embodiments are merely illustrative of the embodiments of the present invention, and the present invention is not limited thereto, and appropriate modifications may be made based on the above-mentioned various embodiments. For example, the above-mentioned embodiments may be used alone, or one or more of the above-mentioned embodiments may be used in combination.

[0069] According to an embodiment of the present invention, the object counting method performs counting based on the highlight waveform obtained from the pixel count, which can improve the counting accuracy and reduce the calculation cost. The method of the present invention can improve the object counting result, especially in the night environment.

[0070] <Example 2> The embodiment of the present invention provides an object counting device corresponding to the object counting method according to the embodiment 1. Description of the contents of the embodiment 2 that are similar to those of the embodiment 1 will be omitted.

[0071] 8 is a schematic diagram of an example of an object counting device 800. As shown in FIG. 8, the object counting device 800 includes a first detection unit 801, a first generation unit 802, and a first counting unit 803.

[0072] The first detection unit 801 converts an input image into a binarized mask image, and detects object contours in the mask image.

[0073] A first generator 802 generates a highlightwave based on the number of first pixels (ie, white pixels) in the object contour of each of the mask images.

[0074] The first counting unit 803 counts the number of objects based on the highlight waveform.

[0075] In at least one embodiment, the first detection unit 801 converts the input image into a binarized mask image (mask) including converting the input image into a grayscale image, converting the grayscale image into a binary image based on a threshold, and performing a dilate operation on the binary image to form the mask image.

[0076] In at least one embodiment, if the number of pixels in the grayscale image whose pixel values ​​are less than a first predetermined value (e.g., 60) is greater than a second predetermined value (e.g., 80%) and the duration exceeds a third predetermined value (e.g., 30 seconds), the threshold is set to a first threshold (e.g., 220), otherwise the threshold is set to a second threshold (e.g., 180), the first threshold being greater than the second threshold.

[0077] In at least one aspect, if the number of pixels in a contour is less than a fourth predetermined value (e.g., 10) or the width or height of the contour's bounding box is less than a fifth predetermined value (e.g., 30), the first detection unit 801 removes the contour.

[0078] In at least one embodiment, if a ratio (hlratio) of a first number of pixels in the object contours of the mask image to the number of pixels in a region of interest (ROI) is greater than a third threshold (e.g., 0.09), the first generator sets the ratio as one data item of the highlight waveform.

[0079] In at least one embodiment, if the ratio is greater than a fourth threshold (eg, 0.4), the first generator sets a peakflag to 1.

[0080] In at least one embodiment, the first counting unit 803 counts objects based on the highlight waveform, including: determining, for a peak in the highlight waveform, two frame numbers corresponding to data having a predetermined value on either side of the peak; obtaining bounding boxes of object contours corresponding to the two frame numbers respectively; comparing positions of the two bounding boxes; determining a moving direction and moving distance of the object corresponding to the peak; and increasing a count value of objects passing through the region of interest if it is determined that the moving direction of the object corresponding to the peak matches a predetermined moving direction of an object in the region of interest and the moving distance is equal to or greater than a distance threshold.

[0081] As shown in FIG. 8, the object counting device 800 further includes the following units:

[0082] The second counting unit 804 counts the objects based on the results of object detection and object tracking performed on the input image.

[0083] The merging unit 805 merges the counting result based on the highlight waveform and the counting result based on the tracking.

[0084] In at least one embodiment, merging the counting results based on the highlight waveform and the counting results based on tracking includes, when the counting value of the current region of interest changes during a period when counting is based on the tracking result, performing an increment operation on the waveform counting flag value (wavetimetrackcnt) corresponding to the period, and when counting based on the highlight waveform, if the waveform counting flag value (wavetimetrackcnt) is not an initial value, not changing the counting value based on the highlight waveform.

[0085] In at least one embodiment, merging counting results based on the highlight waveform and counting results based on tracking includes, during the period of counting based on the highlight waveform, comparing bounding boxes of object contours in the mask image with bounding boxes of objects obtained by tracking, and if they overlap, setting a count flag of the object obtained by tracking to a first value, and when counting based on the tracking results, not counting objects whose count flag has the first value.

[0086] It should be noted that the above merely describes each component or module related to the present invention, and the present invention is not limited thereto. The object counting device 800 may include other components or modules, and the specific contents of these components or modules may be referred to in the related art.

[0087] For simplicity, Fig. 8 merely illustrates the connection relationships or signal directions between each component or module as an example, and it is clear to those skilled in the art that various related technologies such as bus connection can be used. The above-mentioned various components or modules may be realized by hardware devices such as a processor and a memory, and the embodiment of the present invention is not limited thereto.

[0088] The above-mentioned embodiments are merely illustrative of the embodiments of the present invention, and the present invention is not limited thereto, and appropriate modifications may be made based on the above-mentioned various embodiments. For example, the above-mentioned embodiments may be used alone, or one or more of the above-mentioned embodiments may be used in combination.

[0089] <Example 3> An embodiment of the present invention provides an electronic device including the object counting device 800 described in the second embodiment, the contents of which are incorporated herein by reference. The electronic device may be, for example, a computer, a server, a workstation, a laptop computer, a smartphone, etc., but the embodiment of the present invention is not limited thereto.

[0090] Fig. 9 is a schematic diagram of an electronic device according to an embodiment of the present invention. As shown in Fig. 9, the electronic device 900 according to the embodiment of the present invention includes a processor (e.g., a central processing unit (CPU)) 910 and a memory 920. The memory 920 is connected to the processor 910. The memory 920 may store various data, and may further store an information processing program 921. The program 921 is executed under the control of the processor 910.

[0091] In some aspects, the functionality of the object counting device 800 may be integrated into the processor 910. Here, the processor 910 may be configured to implement the object counting method described in the first embodiment.

[0092] In some aspects, the object counting device 800 may be respectively configured with a processor 910, for example, the object counting device 800 may be a chip connected to the processor 910 and configured to realize the functions of the object counting device 800 under the control of the processor 910.

[0093] For example, the processor 910 may be configured to perform the steps of converting an input image into a binarized mask image, detecting object contours in the mask image, generating a highlightwave based on the number of first pixels (i.e., white pixels) in the object contour of each of the mask images, and counting objects based on the highlightwave.

[0094] In at least one embodiment, converting an input image into a binarized mask image includes converting the input image into a grayscale image, converting the grayscale image into a binary image based on a threshold, and performing a dilation operation on the binary image to form the mask image.

[0095] In at least one embodiment, if the number of pixels in the grayscale image whose pixel values ​​are less than a first predetermined value (e.g., 60) is greater than a second predetermined value (e.g., 80%) and the duration exceeds a third predetermined value (e.g., 30 seconds), the threshold is set to a first threshold (e.g., 220), otherwise the threshold is set to a second threshold (e.g., 180), the first threshold being greater than the second threshold.

[0096] In at least one embodiment, in the step of detecting object contours in the mask image, the contour is removed if the number of pixels in the contour is less than a fourth predetermined value (e.g., 10) or the width or height of the bounding box of the contour is less than a fifth predetermined value (e.g., 30).

[0097] In at least one embodiment, in the step of generating the highlight waveform, if a ratio (hlratio) of a first number of pixels in the object contours of the mask image to the number of pixels in a region of interest (ROI) is greater than a third threshold (e.g., 0.09), the ratio is used as one data of the highlight waveform.

[0098] In at least one embodiment, if the ratio is greater than a fourth threshold (eg, 0.4), a peakflag is set to 1.

[0099] In at least one embodiment, the step of counting objects based on the highlight waveform includes the steps of: determining, for a peak in the highlight waveform, two frame numbers corresponding to data having a predetermined value on either side of the peak; obtaining bounding boxes of object contours corresponding to the two frame numbers respectively, comparing the positions of the two bounding boxes, and determining the movement direction and movement distance of the object corresponding to the peak; and increasing a count value of objects passing through the region of interest if it is determined that the movement direction of the object corresponding to the peak matches the predetermined movement direction of the object in the region of interest and the movement distance is equal to or greater than a distance threshold.

[0100] In at least one embodiment, the method further includes counting objects based on results of object detection and tracking performed on the input image, and merging the counting results based on the highlight waveform and the counting results based on the tracking.

[0101] The step of merging the counting results based on the highlight waveform and the counting results based on tracking includes a step of increasing the waveform counting flag value (wavetimetrackcnt) corresponding to a period when the counting value of the current region of interest changes during the period when counting is based on the tracking result, and not changing the counting value based on the highlight waveform if the waveform counting flag value (wavetimetrackcnt) is not an initial value when counting based on the highlight waveform.

[0102] In at least one embodiment, the step of merging the counting results based on the highlight waveform and the counting results based on tracking includes a step of comparing the bounding boxes of the object contours in the mask image with the bounding boxes of the object obtained by tracking during the period of counting based on the highlight waveform, and if they overlap, setting a count flag of the object obtained by tracking to a first value, and a step of not counting objects whose count flag has the first value when counting based on the tracking results.

[0103] 9, the electronic device 900 may further include an input / output (I / O) device 930 and a display 940. Here, the functions of the components are similar to those of the conventional technology, and the description thereof will be omitted here. Note that the electronic device 900 does not need to include all the components shown in FIG. 9. The electronic device 900 may also include components not shown in FIG. 9, and may refer to the conventional technology.

[0104] An embodiment of the present invention provides a computer-readable program that, when executed in an electronic device, causes a computer to execute the object counting method according to the first embodiment in the electronic device.

[0105] An embodiment of the present invention further provides a storage medium having stored thereon a computer-readable program for causing a computer to execute the object counting method according to the first embodiment in an electronic device.

[0106] The above-mentioned apparatus and method of the present invention may be realized by hardware or a combination of hardware and software. The present invention relates to a computer-readable program, which, when executed by a logic unit, causes the logic unit to realize the above-mentioned apparatus or components, or to realize the above-mentioned various methods or steps. The present invention also relates to a storage medium for storing the above-mentioned program, such as a hard disk, a magnetic disk, an optical disk, a DVD, a flash memory, etc.

[0107] The methods / apparatuses described with reference to the embodiments of the present invention may be implemented in hardware, software modules executed by a processor, or a combination of both. For example, one or more of the functional block diagrams shown in the drawings, or one or more combinations of the functional block diagrams, may correspond to each software module in the flow of a computer program, or each hardware module. These software modules may correspond to each step shown in the drawings. These hardware modules may be realized by implementing these software modules in hardware, for example, using a field programmable gate array (FPGA).

[0108] The software module may be located in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a mobile hard disk, a CD-ROM, or any other form of storage medium known to those skilled in the art. The storage medium may be connected to the processor so that the processor reads information from the storage medium and writes information to the storage medium, or the storage medium may be a component of the processor. The processor and the storage medium are located in an ASIC. The software module may be stored in the memory of the mobile terminal, or in a memory card inserted in the mobile terminal. For example, if the device (e.g., a mobile terminal) uses a MEGA-SIM card or a large capacity flash memory device with a relatively large capacity, the software module may be stored in the MEGA-SIM card or the large capacity flash memory device.

[0109] One or more of the functional blocks and / or one or more combinations of functional blocks depicted in the drawings may be implemented in a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or any suitable combination thereof to perform the functions described herein. One or more of the functional blocks and / or one or more combinations of functional blocks depicted in the drawings may be implemented in, for example, a combination of computing devices, such as a combination of a DSP and a microprocessor, a combination of multiple microprocessors, one or more microprocessors in combination with a DSP communication, or any other configuration.

[0110] Although the present invention has been described above with reference to specific embodiments, the above description is merely illustrative and does not limit the scope of protection of the present invention. Various modifications and changes may be made to the present invention without departing from the spirit and principles of the present invention, and these modifications and changes also fall within the scope of the present invention.

[0111] Furthermore, the following supplementary notes are disclosed regarding the embodiments including the above-mentioned examples. (Appendix 1) 1. An object counting device comprising: a first detector for converting an input image into a binarized mask image and detecting object contours in the mask image; a first generator for generating a highlightwave based on a number of first pixels (i.e., white pixels) in the object contour of each of the mask images; a first counting unit that counts objects based on the highlight waveform. (Appendix 2) The first detection unit converts the input image into a binarized mask image (mask), converting the input image to a grayscale image; converting the grayscale image to a binary image based on a threshold; and performing a dilation process on the binary image to form the mask image. (Appendix 3) if the number of pixels in the grayscale image whose pixel values ​​are less than a first predetermined value (e.g., 60) is greater than a second predetermined value (e.g., 80%) and the duration exceeds a third predetermined value (e.g., 30 seconds), then set the threshold to a first threshold (e.g., 220); Otherwise, set the threshold to a second threshold (e.g., 180); 3. The apparatus of claim 2, wherein the first threshold is greater than the second threshold. (Appendix 4) The device described in Appendix 1, wherein the first detection unit removes a contour if the number of pixels in the contour is smaller than a fourth predetermined value (e.g., 10) or the width or height of the boundary box of the contour is smaller than a fifth predetermined value (e.g., 30). (Appendix 5) The device described in Appendix 1, wherein when a ratio (hlratio) of a first number of pixels in the object contours of the mask image to the number of pixels in a region of interest (ROI) is greater than a third threshold (e.g., 0.09), the first generation unit sets the ratio as one data of the highlight waveform. (Appendix 6) 6. The apparatus of claim 5, wherein if the ratio is greater than a fourth threshold (e.g., 0.4), the first generator sets a peakflag to 1. (Appendix 7) The first counting unit counts objects based on the highlight waveform, determining, for a peak in the highlight waveform, two frame numbers corresponding to data having a predetermined value on either side of the peak; Obtaining bounding boxes of object contours corresponding to the two frame numbers respectively, comparing the positions of the two bounding boxes, and determining the moving direction and moving distance of the object corresponding to the peak; and increasing a count of objects passing through the region of interest when the direction of movement of the object corresponding to the peak coincides with a predetermined direction of movement of an object in the region of interest and the movement distance is determined to be greater than or equal to a distance threshold. (Appendix 8) a second counting unit that counts objects based on a result of performing object detection and object tracking on the input image; 2. The apparatus of claim 1, further comprising a merging unit that merges the counting result based on the highlight waveform and the counting result based on the tracking. (Appendix 9) Merging the highlight waveform-based counting result and the tracking-based counting result The device described in Appendix 8 includes the steps of: when a counting value of a current region of interest changes during a period of counting based on a tracking result, performing an incrementing operation on a waveform counting flag value (wavetimetrackcnt) corresponding to the period; and when counting based on a highlighted waveform, not changing the counting value based on the highlighted waveform if the waveform counting flag value (wavetimetrackcnt) is not an initial value. (Appendix 10) Merging the highlight waveform-based counting result and the tracking-based counting result during a period of counting based on the highlight waveform, comparing a bounding box of the object contour in the mask image with a bounding box of the object obtained by tracking, and if they overlap, setting a count flag of the object obtained by tracking to a first value; The apparatus of claim 8, further comprising: when counting based on the tracking result, not counting objects whose countflag is a first value. (Appendix 11) A method for counting objects, comprising the steps of: converting an input image into a binarized mask image and detecting object contours in the mask image; generating a highlightwave based on a number of first pixels (i.e., white pixels) in the object contour of each of the mask images; and counting objects based on the highlight waveform. (Appendix 12) The step of converting the input image into a binarized mask image (mask) includes: converting the input image to a grayscale image; converting the grayscale image to a binary image based on a threshold; and performing a dilation process on the binary image to form the mask image. (Appendix 13) if the number of pixels in the grayscale image whose pixel values ​​are less than a first predetermined value (e.g., 60) is greater than a second predetermined value (e.g., 80%) and the duration exceeds a third predetermined value (e.g., 30 seconds), then set the threshold to a first threshold (e.g., 220); Otherwise, set the threshold to a second threshold (e.g., 180); 13. The method of claim 12, wherein the first threshold is greater than the second threshold. (Appendix 14) detecting object contours in the mask image, 12. The method of claim 11, further comprising removing a contour if the number of pixels in the contour is less than a fourth predetermined value (e.g., 10) or if the width or height of the contour's bounding box is less than a fifth predetermined value (e.g., 30). (Appendix 15) In the step of generating a highlight waveform, The method described in Appendix 11, wherein when a ratio (hlratio) of a first number of pixels in the object contours of the mask image to the number of pixels in a region of interest (ROI) is greater than a third threshold (e.g., 0.09), the first generator sets the ratio as one data of the highlight waveform. (Appendix 16) 16. The method of claim 15, further comprising setting a peakflag to 1 if the ratio is greater than a fourth threshold (e.g., 0.4). (Appendix 17) The step of counting objects based on the highlight waveform includes: determining, for a peak in the highlight waveform, two frame numbers corresponding to data having a predetermined value on either side of the peak; obtaining bounding boxes of object contours corresponding to the two frame numbers respectively, comparing the positions of the two bounding boxes, and determining the moving direction and moving distance of the object corresponding to the peak; and increasing a count of objects passing through the region of interest if the direction of movement of the object corresponding to the peak coincides with a predetermined direction of movement of the object in the region of interest and the movement distance is determined to be greater than or equal to a distance threshold. (Appendix 18) counting objects based on a result of object detection and tracking performed on the input image; 12. The method of claim 11, further comprising the step of combining the highlight waveform-based counting results and the tracking-based counting results. (Appendix 19) The step of merging the highlight waveform-based counting result and the tracking-based counting result includes: The method described in Appendix 18 includes a step of performing an increment operation on the waveform counting flag value (wavetimetrackcnt) corresponding to a period when the counting value of the current region of interest changes during the period when counting based on the tracking result, and not changing the counting value based on the highlight waveform when the waveform counting flag value (wavetimetrackcnt) is not an initial value when counting based on the highlight waveform. (Appendix 20) The step of merging the highlight waveform-based counting result and the tracking-based counting result includes: a step of comparing a boundary box of an object contour in the mask image with a boundary box of an object obtained by tracking during a period of counting based on the highlight waveform, and setting a count flag of the object obtained by tracking to a first value if the boundary boxes overlap; The method of claim 18, further comprising: when counting based on the tracking result, not counting objects whose countflag is a first value. (Appendix 21) A storage medium having a computer readable program stored thereon, the computer readable program causing a processor connected to the storage medium to execute a method for counting objects according to any one of appendixes 11 to 20.

Claims

1. 1. An object counting device comprising: a first detector for converting an input image into a binarized mask image and detecting an object contour in the mask image; a first generator that generates a highlight waveform based on a first number of pixels in the object contour of each of the mask images; a first counting unit that counts objects based on the highlight waveform.

2. The device of claim 1 , wherein when a ratio of a first number of pixels in the object contour of the mask image to a number of pixels in a region of interest is greater than a third threshold, the first generation unit sets the ratio as one data item of the highlight waveform.

3. The apparatus of claim 2 , wherein the first generator sets a peak flag to 1 if the ratio is greater than a fourth threshold.

4. The first counting unit counts objects based on the highlight waveform, determining, for a peak in the highlight waveform, two frame numbers corresponding to data having a predetermined value on either side of the peak; Obtaining circumscribing bounding boxes of object contours corresponding to the two frame numbers respectively, comparing the positions of the two bounding boxes, and determining the moving direction and moving distance of the object corresponding to the peak; and increasing a count of objects passing through the region of interest when the direction of movement of the object corresponding to the peak coincides with a predetermined direction of movement of the object in the region of interest and the movement distance is determined to be equal to or greater than a distance threshold.

5. a second counting unit that counts objects based on a result of performing object detection and tracking on the input image; The apparatus of claim 1 , further comprising a merging unit for merging the highlight waveform-based counting result and the tracking-based counting result.

6. Merging the highlight waveform-based counting result and the tracking-based counting result The device of claim 5 further comprising: when a counting value of a current region of interest changes during a period of counting based on a tracking result, an incrementing operation is performed on a waveform counting flag value corresponding to the period; and when counting based on a highlighted waveform, if the waveform counting flag value is not an initial value, the counting value based on the highlighted waveform is not changed.

7. Merging the highlight waveform-based counting result and the tracking-based counting result during a period of counting based on the highlight waveform, comparing a boundary frame of the object contour in the mask image with a boundary frame of the object obtained by tracking, and if they overlap, setting a counting flag of the object obtained by tracking to a first value; The apparatus according to claim 5 , further comprising: not counting an object whose counting flag is a first value when counting based on the tracking result.

8. An electronic device comprising the object counting device according to any one of claims 1 to 7.

9. A method for counting objects, comprising the steps of: converting an input image into a binarized mask image and detecting object contours in the mask image; generating a highlight waveform based on a first number of pixels in the object contour of each of the mask images; and counting objects based on the highlight waveform.

10. Counting objects based on a result of object detection and tracking performed on the input image; The method of claim 9 , further comprising: combining the highlight waveform-based counting results with the tracking-based counting results.