WO2022070427A1 - 画像処理装置、画像処理方法及びコンピュータ可読媒体 - Google Patents

画像処理装置、画像処理方法及びコンピュータ可読媒体 Download PDF

Info

Publication number
WO2022070427A1
WO2022070427A1 PCT/JP2020/037653 JP2020037653W WO2022070427A1 WO 2022070427 A1 WO2022070427 A1 WO 2022070427A1 JP 2020037653 W JP2020037653 W JP 2020037653W WO 2022070427 A1 WO2022070427 A1 WO 2022070427A1
Authority
WO
WIPO (PCT)
Prior art keywords
processing
analysis
image
processing time
allocation
Prior art date
Application number
PCT/JP2020/037653
Other languages
English (en)
French (fr)
Inventor
威 有熊
貴稔 北野
Original Assignee
日本電気株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電気株式会社 filed Critical 日本電気株式会社
Priority to PCT/JP2020/037653 priority Critical patent/WO2022070427A1/ja
Priority to JP2022553416A priority patent/JPWO2022070427A5/ja
Publication of WO2022070427A1 publication Critical patent/WO2022070427A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the present invention relates to an image processing device, an image processing method, and a computer-readable medium.
  • Patent Document 1 discloses a video analysis system that detects a human face from input video data and further extracts the detected facial features.
  • the allocation of computational resources to the post-stage analysis unit is dynamically changed based on the content observation data obtained by observing changes in the analysis process performed in the pre-stage analysis unit.
  • analysis processing may be performed on multiple types of objects such as faces, human bodies and objects (belongings and clothes, etc.), and the results may be integrated. By doing so, it is possible to associate information such as belongings, face, and clothes with a certain person, and information associated with information of a plurality of objects can be used for detecting a suspicious person.
  • An object of the present disclosure is to solve such a problem, and to provide an image processing apparatus, an image processing method, and a program capable of improving the throughput of analysis processing.
  • the image processing apparatus includes an analysis execution means for executing analysis processing in parallel for each of a plurality of types of objects included in an image, and at least one of a plurality of computational resources for each of the plurality of analysis processes.
  • a resource allocating means for allocating one, a calculation means for calculating a first processing time which is a period from the processing start time to the processing end time of each of the plurality of analysis processes for the entire same image, and a plurality of the analyzes.
  • the allocation change is performed to change the allocation of the computational resources so that the difference in the first processing time becomes small.
  • the resource allocation means allocates at least one of a plurality of computational resources to each of the plurality of analysis processes according to the change process by the allocation change means.
  • At least one of a plurality of computational resources is allocated to each of the analysis processes executed for each of the plurality of types of objects included in the image, and the plurality of types of objects are allocated.
  • the analysis process is executed in parallel for each, and the first process time, which is the period from the process start time to the process end time of each of the analysis processes of a plurality of objects for the entire image of the same object, is calculated and plural.
  • the difference in the first processing time between the analysis processes is equal to or greater than a predetermined threshold value, the processing for changing the allocation of computational resources is performed so that the difference in the first processing time becomes smaller.
  • At least one of the plurality of computational resources is allocated to each of the plurality of analysis processes according to the change process.
  • the program according to the present disclosure includes a step of allocating at least one of a plurality of computational resources to each of the analysis processes executed for each of the plurality of types of objects included in the image, and the plurality of types of objects.
  • a step of executing analysis processing in parallel for each and a first processing time which is a period from the processing start time to the processing end time of each of the analysis processing of a plurality of objects for the entire image of the same image, are calculated. Allocation of the computational resources so that the difference in the first processing time between the step and the plurality of analysis processes becomes smaller than a predetermined threshold value.
  • the computer is made to execute a step of performing the change processing of the above and a step of allocating at least one of a plurality of computational resources to each of the plurality of analysis processes according to the change process.
  • an image processing device an image processing method and a program capable of improving the throughput of analysis processing.
  • FIG. 1 It is a figure which shows the outline of the image processing apparatus which concerns on embodiment of this disclosure. It is a flowchart which shows the image processing method executed by the image processing apparatus which concerns on embodiment of this disclosure. It is a figure which shows the structure of the image processing system which concerns on Embodiment 1. FIG. It is a figure which shows the structure of the image processing apparatus which concerns on Embodiment 1. FIG. It is a flowchart which shows the image processing method executed by the image processing apparatus which concerns on Embodiment 1. FIG. It is a flowchart which shows the image processing method executed by the image processing apparatus which concerns on Embodiment 1. FIG. It is a figure for demonstrating the face analysis processing and the human body analysis processing which concerns on Embodiment 1. FIG.
  • FIG. It is a figure which illustrates the analysis processing log information which concerns on Embodiment 1. It is a figure which illustrates the object information which concerns on Embodiment 1.
  • FIG. It is a figure which shows the structure of the image processing apparatus which concerns on Embodiment 2. It is a figure which illustrates the object information which concerns on Embodiment 2.
  • FIG. It is a flowchart which shows the allocation change process which is executed by the image processing apparatus which concerns on Embodiment 2.
  • FIG. 1 is a diagram showing an outline of the image processing apparatus 1 according to the embodiment of the present disclosure.
  • the image processing device 1 is, for example, a computer such as a server.
  • the image processing device 1 has an analysis execution unit 2, a resource allocation unit 4, a calculation unit 6, and an allocation change unit 8.
  • the analysis execution unit 2, the resource allocation unit 4, the calculation unit 6, and the allocation change unit 8 have functions as an analysis execution unit, a resource allocation unit, a calculation unit, and an allocation change unit, respectively.
  • the analysis execution unit 2 separately executes analysis processing for each of a plurality of types of objects included in the image in parallel.
  • the "image” may be a moving image (video) or a still image. Further, the image may be a frame image constituting the moving image.
  • the "object” is an object to be analyzed.
  • the object includes, for example, the "face” of the person, the "human body” which is the whole body of the person, and the “property” such as the person's belongings or clothes.
  • “Computational resources” include, for example, a processor, memory, and the like.
  • the processor may include, for example, a CPU (Central Processing Unit) and a hardware accelerator (for example, a GPU (Graphics Processing Unit)).
  • the resource allocation unit 4 allocates at least one of a plurality of computational resources to each of the analysis processes of the plurality of types of objects.
  • the calculation unit 6 calculates a first processing time (image processing time), which is a period from the processing start time to the processing end time of each of the plurality of analysis processes for the entire same image.
  • the allocation change unit 8 allocates computational resources so that the difference in the first processing time becomes smaller when the difference in the first processing time between the plurality of analysis processes becomes equal to or greater than a predetermined threshold value. Perform change processing.
  • the resource allocation unit 4 allocates at least one of a plurality of computational resources to each of the plurality of analysis processes according to the change process by the allocation change unit 8.
  • FIG. 2 is a flowchart showing an image processing method executed by the image processing apparatus 1 according to the embodiment of the present disclosure.
  • the resource allocation unit 4 allocates computational resources to each of the analysis processes of the plurality of types of objects (step S10).
  • the analysis execution unit 2 separately executes analysis processing for each of a plurality of types of objects in parallel (step S12). For example, when a plurality of types of objects are an object A (for example, a “face”) and an object B (for example, a “human body”), the analysis execution unit 2 analyzes the object A and the object B. Are executed separately and in parallel.
  • the resource allocation unit 4 allocates computational resources to each of the analysis process A related to the object A and the analysis process B related to the object B.
  • the calculation unit 6 calculates the image processing time of each of the plurality of analysis processes for the entire same image (step S14). For example, the calculation unit 6 has an image processing time A, which is a period from the processing start time of the analysis process A to the processing end time, and a period from the processing start time to the processing end time of the analysis process B, for a certain image X.
  • the image processing time B is calculated.
  • the allocation change unit 8 performs the calculation resource allocation change processing when the difference in the image processing time is equal to or greater than the threshold value (step S16).
  • the resource allocation unit 4 allocates at least one of a plurality of computational resources to each of the plurality of analysis processes according to the change process by the allocation change unit 8 (step S18).
  • the allocation change unit 8 performs the calculation resource allocation change processing so that the difference in the image processing time becomes small when the difference in the image processing time is equal to or greater than the threshold value.
  • the allocation change unit 8 performs the calculation resource allocation change processing when the difference between the image processing time A and the image processing time B becomes equal to or greater than the threshold value.
  • a specific example of the change process will be described in the embodiment described later.
  • the difference in the image processing time (first processing time) between the analysis processings of the plurality of types of objects is equal to or larger than the threshold value
  • the difference in the image processing time is small. It is configured to change the allocation of computational resources so that it becomes.
  • the period of waiting for processing is shortened from the end of the analysis processing having a short processing time to the end of the analysis processing having a long processing time. Therefore, it is possible to improve the throughput.
  • FIG. 3 is a diagram showing the configuration of the image processing system 20 according to the first embodiment.
  • the image processing system 20 includes one or more image pickup devices 30 and an image processing device 100.
  • the image pickup device 30 and the image processing device 100 are connected to each other so as to be able to communicate with each other via a network 22 such as the Internet.
  • the image processing device 100 may be realized by, for example, cloud computing.
  • the image pickup device 30 is, for example, a camera such as a surveillance camera or a security camera.
  • the image pickup apparatus 30 captures a surrounding subject (person, object, background, etc.) and generates image data showing the image.
  • the "image” may be a moving image (video) or a still image. Further, the image may be a frame image constituting the moving image.
  • the term "image” also means "image data indicating an image” as a processing target in information processing. In the following description, an example in which the image is a frame image will be described.
  • the image processing device 100 corresponds to the image processing device 1 shown in FIG.
  • the image processing device 100 receives an image from the image pickup device 30.
  • the image processing device 100 analyzes the received image and recognizes an object contained in the image. Details will be described later.
  • the face and the human body (whole body) of a person are recognized as the object, but the object is not limited to the face and the human body.
  • the number of objects is not limited to two, and may be any number of three or more.
  • FIG. 4 is a diagram showing the configuration of the image processing apparatus 100 according to the first embodiment.
  • the image processing apparatus 100 has a control unit 102, a storage unit 104, a communication unit 106, and an interface unit 108 (IF; Interface) as a main hardware configuration.
  • the control unit 102, the storage unit 104, the communication unit 106, and the interface unit 108 are connected to each other via a data bus or the like.
  • the control unit 102 is, for example, a processor such as a CPU.
  • the control unit 102 has a function as an arithmetic unit that performs analysis processing, control processing, arithmetic processing, and the like.
  • the storage unit 104 is a storage device such as a memory or a hard disk.
  • the storage unit 104 is, for example, a ROM (Read Only Memory) or a RAM (Random Access Memory).
  • the storage unit 104 has a function for storing a control program, an arithmetic program, and the like executed by the control unit 102.
  • the storage unit 104 has a function for temporarily storing processed data and the like.
  • the storage unit 104 may include a database.
  • the communication unit 106 performs necessary processing for communicating with another device such as the image pickup device 30 via the network 22.
  • the communication unit 106 may include a communication port, a router, a firewall, and the like.
  • the interface unit 108 is, for example, a user interface (UI).
  • the interface unit 108 has an input device such as a keyboard, a touch panel or a mouse, and an output device such as a display or a speaker.
  • the interface unit 108 accepts a data input operation by a user (operator) and outputs information to the user. For example, the interface unit 108 may output the result of the analysis process. Further, the interface unit 108 may output the amount of computational resources allocated to each analysis process.
  • the image processing device 100 has an image acquisition unit 110, a resource allocation unit 112, an analysis execution unit 120, an analysis status monitoring unit 130, and an allocation change unit 140 as constituent elements.
  • the analysis execution unit 120 includes a face analysis execution unit 122 and a human body analysis execution unit 124.
  • the analysis status monitoring unit 130 includes an image processing time calculation unit 132, an allocation change determination unit 134, and an object information calculation unit 136.
  • the allocation change unit 140 has a CPU allocation determination unit 142.
  • the image processing device 100 does not need to be physically composed of one device. In this case, each of the above-mentioned components may be realized by a plurality of physically separate devices.
  • the image acquisition unit 110 has a function as an image acquisition means.
  • the resource allocation unit 112 corresponds to the resource allocation unit 4 shown in FIG.
  • the resource allocation unit 112 has a function as a resource allocation means.
  • the analysis execution unit 120 corresponds to the analysis execution unit 2 shown in FIG.
  • the analysis execution unit 120 has a function as an analysis execution means.
  • the analysis status monitoring unit 130 corresponds to the calculation unit 6 shown in FIG.
  • the analysis status monitoring unit 130 has a function as an analysis status monitoring means.
  • the allocation change unit 140 corresponds to the allocation change unit 8 shown in FIG.
  • the allocation change unit 140 has a function as an allocation change means.
  • the face analysis execution unit 122 has a function as a face analysis execution means.
  • the human body analysis execution unit 124 has a function as a human body analysis execution means.
  • the image processing time calculation unit 132 corresponds to the calculation unit 6 shown in FIG.
  • the image processing time calculation unit 132 has a function as an image processing time calculation means.
  • the allocation change determination unit 134 has a function as an allocation change determination means.
  • the object information calculation unit 136 has a function as an object information calculation means.
  • the CPU allocation determination unit 142 has a function as a CPU ratio determination means.
  • each of the above-mentioned components can be realized, for example, by executing a program under the control of the control unit 102. More specifically, each component can be realized by the control unit 102 executing the program stored in the storage unit 104. Further, each component may be realized by recording a necessary program on an arbitrary non-volatile recording medium and installing it as needed. Further, each component is not limited to being realized by software by a program, and may be realized by any combination of hardware, firmware, and software. Further, each component may be realized by using a user-programmable integrated circuit such as an FPGA (field-programmable gate array) or a microcomputer. In this case, this integrated circuit may be used to realize a program composed of each of the above components. These things are the same in other embodiments described later. The specific functions of each component will be described later.
  • FPGA field-programmable gate array
  • the resource allocation unit 112 allocates computational resources (step S100). Specifically, the resource allocation unit 112 allocates at least one of a plurality of computational resources to each of the plurality of analysis processes executed by the analysis execution unit 120. More specifically, the resource allocation unit 112 allocates computational resources to the face analysis process executed by the face analysis execution unit 122 and the human body analysis process executed by the human body analysis execution unit 124. Details will be described later.
  • the image acquisition unit 110 acquires a frame image (step S102). Specifically, the image acquisition unit 110 acquires a frame image generated by the image pickup apparatus 30. The image acquisition unit 110 may acquire a frame image every time a frame image is generated by the image pickup apparatus 30. Alternatively, when the frame image from the image pickup apparatus 30 is temporarily stored in the storage unit 104 (buffer), the image acquisition unit 110 may acquire the frame image from the buffer. When the image pickup apparatus 30 continuously generates still images in time series, the image acquisition unit 110 may acquire still images.
  • the analysis execution unit 120 separately executes the face analysis process and the human body analysis process in parallel (step S104). That is, the analysis execution unit 120 separately executes the analysis processing for each of a plurality of types of objects included in the image in parallel. Specifically, the face analysis execution unit 122 performs face analysis processing. The human body analysis execution unit 124 performs the human body analysis process.
  • FIG. 7 is a diagram for explaining the face analysis process and the human body analysis process according to the first embodiment.
  • the analysis execution unit 120 executes the face analysis process and the human body analysis process in parallel. Then, when the face analysis process and the human body analysis process are completed in the same frame image, the analysis execution unit 120 integrates the result of the face analysis process and the result of the human body analysis process. This makes it possible to generate information that details the facial features and body features of a person captured in a frame image. Using the information generated in this way, it is possible to search for a suspicious person or the like.
  • the face analysis execution unit 122 performs face detection processing on the frame image.
  • the face analysis execution unit 122 detects the position of the face in the frame image. Then, the face analysis execution unit 122 extracts the detected facial features (features). Then, the face feature data indicating the face feature is output as the result of the face analysis process.
  • the face analysis execution unit 122 may extract facial features for a face whose face detection accuracy is higher than a predetermined value.
  • the human body analysis execution unit 124 performs human body detection processing on the frame image. In the human body detection process, the human body analysis execution unit 124 detects the position of the human body in the frame image. Then, the human body analysis execution unit 124 extracts the detected features (features) of the human body. Then, the human body characteristic data showing the characteristics of the human body is output as the result of the human body analysis processing. The human body analysis execution unit 124 may extract the characteristics of the human body for the human body whose accuracy of detecting the human body is higher than a predetermined value.
  • the human body detection process there is a high possibility that an object that is a human body cannot be detected (recognized) as a human body unless the whole body is shown in the frame image.
  • the face detection process even if the whole body is not shown in the frame image, if the face is shown, there is a high possibility that the object that is the face can be detected (recognized) as the face. Therefore, even in the same frame image, the number of detected faces and the number of human bodies may differ from each other.
  • the time required to analyze one object may differ depending on the type of object. For example, since the volume of the feature amount of the human body is larger than the volume of the feature amount of the face, the time required for the extraction process of the feature amount of the human body is often longer than the time required for the extraction process of the feature amount of the face. In the example of FIG. 7, the time required for the extraction process of facial features is 50 msec, and the time required for the extraction process of human body features is 250 msec.
  • the analysis status monitoring unit 130 acquires log information (analysis process log information) of each analysis process (step S106).
  • the analysis processing log information may be generated by the analysis status monitoring unit 130 or may be generated by the analysis execution unit 120.
  • the analysis status monitoring unit 130 monitors the execution status of the analysis process by the analysis execution unit 120 using the analysis process log information.
  • FIG. 8 is a diagram illustrating the analysis processing log information according to the first embodiment.
  • the analysis processing log information includes a camera ID, a frame ID, an object type (“face” or “human body”), an object ID, a processing start time, a processing end time, and processing hardware information. including.
  • the camera ID identification information of the image pickup apparatus 30
  • the frame ID identification information of the frame image
  • the ID of the object “face” is “face # 1” to “face # m”
  • the ID of the object “human body” is “human body # 1” to “human body # n”.
  • each analysis process is executed by the CPU.
  • the processing start time of the object "face # 1" is t_f1s, and the processing end time is t_f1e.
  • the processing start time of the object "face # 2" is t_f2s, and the processing end time is t_f2e.
  • the processing start time of the object "face #m” is t_fms, and the processing end time is t_fme.
  • the face analysis execution unit 122 first executes the analysis process for the object “face # 1”, and finally executes the analysis process for the object “face # m”. Then.
  • the processing start time of the object "human body # 1" is t_b1s, and the processing end time is t_b1e.
  • the processing start time of the object "human body # 2" is t_b2s, and the processing end time is t_b2e.
  • the processing start time of the object "human body #n” is t_bns, and the processing end time is t_bne.
  • the human body analysis execution unit 124 first executes the analysis process for the object “human body # 1”, and finally executes the analysis process for the object “human body # n”. Then.
  • the face analysis execution unit 122 may sequentially execute analysis processing on faces # 1 to face # m. In this case, the face analysis execution unit 122 starts the analysis process for the face # 2 after the analysis process for the face # 1 is completed. Therefore, the period from the processing start time t_f1s for the face # 1 to the processing end time t_f1e does not overlap with the period from the processing start time t_f2s for the face # 2 to the processing end time t_f2e.
  • the face analysis execution unit 122 may execute the analysis process on the faces # 1 to the face # m in parallel. In this case, the face analysis execution unit 122 may start the analysis process for the face # 2 before the analysis process for the face # 1 is completed.
  • the period from the processing start time t_f1s for the face # 1 to the processing end time t_f1e may overlap with the period from the processing start time t_f2s for the face # 2 to the processing end time t_f2e.
  • Such sequential processing or parallel processing can be appropriately selected depending on the amount of computational resources (CPU or the like) allocated to the face analysis processing.
  • the analysis status monitoring unit 130 calculates the frame processing time (image processing time; first processing time) of each analysis processing (step S108). Specifically, the image processing time calculation unit 132 calculates the frame processing time of the face analysis processing and the frame processing time of the human body analysis processing for the entire same frame image.
  • the frame processing time is a period from the processing start time of each analysis processing to the processing end time in the entire one frame image.
  • the frame processing time is the time required for processing all the objects in one frame image for each analysis processing.
  • the frame processing time is the period from the processing start time for the first executed object to the processing end time for the last executed object for each analysis process.
  • the analysis process will also be three or more.
  • the difference ⁇ Ti in the frame processing time may be the difference between the maximum frame processing time and the minimum frame processing time.
  • the allocation change determination unit 134 determines that the allocation of computational resources is not changed. In this case, the process of S20 described later is omitted, and the process proceeds to S116.
  • the allocation change determination unit 134 determines to change the allocation of the computational resources (step S112).
  • the object information calculation unit 136 calculates the object information (step S114).
  • the object information is information about the object, and includes information about the number of objects and the object processing time. Therefore, the object information calculation unit 136 calculates information regarding the number of objects and the object processing time. The number of objects and the processing time of the objects will be described later.
  • the analysis status monitoring unit 130 outputs the allocation change instruction to the allocation change unit 140.
  • the assignment change instruction may include object information.
  • the process of S114 is not limited to being executed only when the determination of S110 is YES, and may always be calculated when the analysis process log information is acquired.
  • FIG. 9 is a diagram illustrating object information according to the first embodiment.
  • the object information includes the average of the number of the latest objects and the average of the latest object processing time (second processing time).
  • the "number of objects” is the number of objects of each object type (face or human body) detected from one frame image. That is, the "number of objects” is the number of detected corresponding objects per image.
  • the number of objects on the face of frame # 1 is m
  • the number of objects on the human body is n.
  • the "object processing time” is the processing time required for the analysis processing per object.
  • the object processing time of the object “face # 1” is (t_f1et_f1s), and the object processing time of the object “face # 2” is (t_f2e-t_f2s).
  • the object processing time of the object “human body # 1” is (t_b1e-t_b1s), and the object processing time of the object “human body # 2” is (t_b2e-t_b2s).
  • the "average number of recent objects (average number of objects)" is a predetermined time before the current time (or the shooting time of the frame image to be processed) (for example, a few seconds ago; 5 seconds to 10 seconds). It is the average value of the number of objects for each type of object in the period up to (seconds ago).
  • the “average number of recent objects (average number of objects)” is M.
  • the “average number of recent objects (average number of objects)” is N.
  • the "average of the latest object processing time (average object processing time)" is a predetermined time before the current time (or the shooting time of the frame image to be processed) (for example, several seconds before; 5 seconds). It is the average value of the object processing time for each type of an object in the period up to (10 seconds before).
  • the "average of the most recent object processing time” may differ depending on the type of computational resource (for example, CPU, etc.) that has been processed.
  • the “average of the most recent object processing time (average object processing time)” of the analysis processing by the CPU is Tfc [msec / piece].
  • the "average of the latest object processing time (average object processing time)” of the analysis processing by the CPU is Tbc [msec / piece].
  • the allocation change unit 140 performs the allocation change process (step S20). Specifically, the CPU allocation determination unit 142 determines the amount of computational resources (for example, the number of CPU cores) to be allocated to each of the plurality of analysis processes (face analysis process and human body analysis process) using the object information. The CPU allocation determination unit 142 determines the amount of computational resources to be allocated to each of the plurality of analysis processes based on the processing required time (third processing time) described later for each of the plurality of analysis processes. The CPU allocation determination unit 142 determines the amount of the computational resource to be allocated to each of the plurality of analysis processes according to the ratio of the processing required times for the plurality of analysis processes. Details will be described later.
  • step S116 When the processing for all frame images is completed after the allocation change processing (S20) (YES in step S116), the processing is completed. On the other hand, when the processing is not completed for all the frame images (NO in S116), the processing returns to S102, and the above-mentioned processing is repeated.
  • FIG. 6 is a flowchart showing the allocation change process (S20) according to the first embodiment.
  • the allocation change unit 140 acquires object information from the analysis status monitoring unit 130 (step S22). Specifically, the CPU allocation determination unit 142 may acquire the object information by receiving the allocation change instruction including the object information from the analysis status monitoring unit 130. Alternatively, the analysis status monitoring unit 130 may store the object information in the database. In this case, the allocation change unit 140 acquires the object information from the database when the allocation change instruction is received.
  • the allocation change unit 140 calculates the processing required time (third processing time) of each analysis process using the object information (step S24). Specifically, the CPU allocation determination unit 142 calculates the processing required time by multiplying the average object processing time by the average number of objects for each analysis process.
  • the "processing required time” is the processing time required for each of a plurality of analysis processes for one image (frame image).
  • the "processing required time” is the processing time predicted to be required for each of the plurality of analysis processes for one image (frame image).
  • the processing time required for the face analysis processing is calculated as Tfc ⁇ M [msec].
  • the processing time required for the human body analysis process is calculated as Tbc ⁇ N [msec].
  • the allocation change unit 140 determines the amount of allocated resources for each analysis process according to the ratio of the processing required time for each analysis process (step S26). Specifically, the CPU allocation determination unit 142 determines the amount of allocated resources for each analysis process so that the ratio of the amount of computational resources to be allocated (the amount of resources) corresponds to the ratio of the processing required time of each analysis process. .. More specifically, in the CPU allocation determination unit 142, the ratio of the resource amount allocated to the face analysis process to the resource amount allocated to the human body analysis process is the processing time required for the face analysis process and the processing time required for the human body analysis process. The amount of resources allocated for each analysis process is determined so as to correspond to the ratio with.
  • the ratio of the processing required time of the face analysis processing to the processing required time of the human body analysis processing is Tfc ⁇ M: Tbc ⁇ N.
  • the number of CPU cores is Rc.
  • the allocation change unit 140 outputs the allocated resource amount for each analysis process (step S28). Specifically, the allocation change unit 140 outputs the allocated resource amount of each analysis process to the resource allocation unit 112. As a result, the resource allocation unit 112 allocates computational resources to each analysis process with the determined (changed) allocated resource amount. As a result, the ratio of the amount of resources allocated to each analysis process is changed to correspond to the ratio of the required processing time, so that the waiting time for processing can be reduced. Therefore, the throughput can be improved. That is, by performing the processing shown in FIG. 5 for a certain frame # 1, it is possible to improve the throughput of the analysis processing for the frame # 2 generated at the timing after the frame # 1.
  • the process according to the first embodiment described above will be described using specific numerical values.
  • the threshold value Tth1 200 msec.
  • the allocation change determination unit 134 determines that the allocation is changed (YES, S112 in S110).
  • the throughput before the allocation change is 1000 msec / max [202 msec, 1001 msec] ⁇ 1 frame / sec. Therefore, it can be seen that the throughput is improved by performing the allocation change processing.
  • the number of objects corresponds to the load of computational resources. Therefore, when the technique of Patent Document 1 is applied to the above-mentioned specific example, the average number of objects in the face analysis process (16) is larger than the average number of objects in the human body analysis process (8). More CPU cores are allocated to the face analysis process than to the process. However, as described above, regarding the processing required time, the processing required time of the human body analysis processing is longer than the processing required time of the face analysis processing. Therefore, in the technique of Patent Document 1, the face analysis process is completed much earlier than the human body analysis process for the analysis process of the same frame image, and a long waiting process occurs before the human body analysis process is completed. It may not be possible to improve the throughput.
  • the method according to the first embodiment can improve the throughput as compared with the technique according to the patent document 1.
  • the second embodiment is different from the first embodiment in that the computational resource for executing the analysis process includes not only the CPU but also the hardware accelerator. Since the configuration of the image processing system 20 according to the second embodiment is substantially the same as that according to the first embodiment, the description thereof will be omitted.
  • FIG. 10 is a diagram showing the configuration of the image processing apparatus 100 according to the second embodiment.
  • the image processing device 100 has a control unit 102, a storage unit 104, a communication unit 106, and an interface unit 108 as a main hardware configuration.
  • the control unit 102 includes at least one CPU (first computational resource) and at least one hardware accelerator (second computational resource).
  • a hardware accelerator is a computational resource with higher performance (processing capacity) than a CPU.
  • the "processing capacity" is, for example, a processing speed.
  • the hardware accelerator may include dedicated hardware such as GPU, FPGA, or deep learning.
  • the hardware accelerator hereinafter, may be simply referred to as “accelerator” is a GPU will be described.
  • the hardware other than the control unit 102 may be substantially the same as that of the first embodiment.
  • the image processing device 100 has an image acquisition unit 110, a resource allocation unit 112, an analysis execution unit 120, an analysis status monitoring unit 130, and an allocation change unit 240 as constituent elements.
  • the components other than the allocation change unit 240 are substantially the same as those in the first embodiment, and thus the description thereof will be omitted. That is, the image processing apparatus 100 according to the first embodiment performs the processing of S100 to S116 shown in FIG. 5 in the same manner as in the first embodiment.
  • the allocation change unit 240 has a function as an allocation change means.
  • the allocation change unit 240 has a CPU allocation determination unit 142 and an accelerator allocation determination unit 242.
  • the accelerator allocation determination unit 242 has a function as an accelerator allocation determination means.
  • the allocation change unit 240 according to the second embodiment determines the allocation of the CPU (first computational resource) and the accelerator (second computational resource).
  • the image processing method executed by the image processing apparatus 100 according to the second embodiment will be described.
  • the processing other than the processing of S20 in FIG. 5 is substantially the same as the processing according to the first embodiment, and thus the description thereof will be omitted.
  • the analysis processing log information acquired in the processing of S106 and the object information calculated in S114 are different from those of the first embodiment.
  • each analysis processing is executed by the CPU, but in the second embodiment, some or all the analysis processing may be executed by the accelerator (for example, GPU).
  • FIG. 11 is a diagram illustrating object information according to the second embodiment.
  • the object processing time (average object processing time) is calculated for each type of hardware (CPU and GPU) in which the analysis processing is executed.
  • the “average of the most recent object processing time (average object processing time)” of the analysis processing by the GPU is Tfg [msec / piece].
  • the “average of the most recent object processing time (average object processing time)” of the analysis processing by the GPU is Tbg [msec / piece].
  • Tbg [msec / piece
  • FIG. 12 is a flowchart showing the allocation change process (S20) executed by the image processing device according to the second embodiment.
  • the allocation change unit 240 performs substantially the same processing as S22 to S28 shown in FIG. 6 (step S200).
  • the CPU allocation determination unit 142 outputs the CPU allocation resource amount of each analysis processing to the accelerator allocation determination unit 242. That is, in the second embodiment, the resource allocation unit 112 does not allocate the computational resources by the allocated resource amount determined in S26.
  • the allocation change unit 240 acquires the allocated resource amount for each analysis process (step S202).
  • the amount of allocated resources acquired at this time is the amount of allocated resources of the CPU. That is, also in the second embodiment, when the allocation process is performed, first, as in the first embodiment, the process assuming that the CPU is allocated to each analysis process is performed. As a result, it is possible to suppress the complexity of the process of allocating not only the CPU but also the GPU to the analysis process.
  • the allocation change unit 240 selects an analysis process in which the amount of allocated resources per object is large (step S204). Specifically, the accelerator allocation determination unit 242 calculates the amount of allocated resources per object for each analysis process. More specifically, the accelerator allocation determination unit 242 calculates the amount of allocated resources per object (face) in the face analysis process as Rc_f / M. Similarly, the accelerator allocation determination unit 242 calculates the amount of allocated resources per object (human body) in the human body analysis process as Rc_b / N. The accelerator allocation determination unit 242 compares Rc_f / M and Rc_b / N and selects the analysis process corresponding to the larger one. For example, if Rc_f / M ⁇ Rc_b / N, the accelerator allocation determination unit 242 selects the human body analysis process.
  • the allocation change unit 240 determines that the GPU (accelerator) is allocated to the analysis process selected in S204 (step S206). For example, when the human body analysis process is selected in S204, the accelerator allocation determination unit 242 allocates the GPU to the human body analysis process. As a result, the accelerator can be preferentially assigned to the analysis process that is considered to have a high processing load. Therefore, it is possible to improve the throughput.
  • the allocation change unit 240 excludes the analysis processing in which the CPU conversion number of the allocated GPU is equal to or greater than the number of objects from the CPU allocation target (step S208).
  • the CPU conversion number corresponds to the conversion resource amount in which the amount of GPU (second computational resource) is virtually converted into the amount of CPU (first computational resource). Therefore, the allocation change unit 240 determines that the CPU is not allocated to the analysis process when the number corresponding to the converted resource amount is equal to or greater than the number of objects corresponding to the analysis process determined to allocate the GPU.
  • the accelerator allocation determination unit 242 calculates the CPU conversion number. Specifically, the accelerator allocation determination unit 242 calculates the CPU conversion number by dividing the object processing time of the CPU by the object processing time of the GPU for the analysis processing to which the GPU is assigned. For example, assuming that the GPU is assigned to the human body analysis process, the accelerator allocation determination unit 242 calculates the CPU conversion number as Tbc / Tbg [CPU / GPU]. Further, assuming that the GPU is assigned to the face analysis process, the accelerator allocation determination unit 242 calculates the CPU conversion number as Tfc / Tfg [CPU / GPU]. If the calculated value is not an integer, the accelerator allocation determination unit 242 may determine the integer closest to the calculated value as the CPU conversion number (conversion resource amount).
  • the accelerator allocation determination unit 242 compares the number of CPU conversions with the number of objects (average number of objects). For example, assuming that the GPU is assigned to the human body analysis process, Tbc / Tbg is compared with the average number of objects N in the human body analysis process. Then, the accelerator allocation determination unit 242 excludes the human body analysis process to which the GPU is assigned from the CPU allocation target when Tbc / Tbg ⁇ N. That is, the accelerator allocation determination unit 242 determines that the CPU is not allocated to the human body analysis process. Further, for example, assuming that the GPU is assigned to the face analysis process, Tfc / Tfg is compared with the average number of objects M in the face analysis process.
  • the accelerator allocation determination unit 242 excludes the face analysis process to which the GPU is assigned from the CPU allocation target when Tfc / Tfg ⁇ M. That is, the accelerator allocation determination unit 242 determines that the CPU is not allocated to the face analysis process.
  • the reason why the analysis process to which the GPU is assigned is excluded from the CPU allocation target is that even if the CPU is assigned to such an analysis process, it is highly likely that the assigned CPU will not be used for the analysis process. Is. That is, when the CPU conversion number of the GPU assigned to a certain analysis process is equal to or greater than the number of objects, the time for processing all the objects of one frame image using the GPU is the time for using the CPU for one object. Shorter than processing time. For example, when the CPU conversion number of the GPU assigned to the human body analysis process is equal to or greater than the number of objects, the time for processing all the human bodies in one frame image using the GPU is processed by using the CPU for one human body. Shorter than time. Therefore, it is faster to process the analysis using only the GPU. Therefore, under the above-mentioned conditions, the analysis process to which the GPU is assigned is excluded from the CPU allocation target.
  • the allocation change unit 240 determines the amount of CPU allocated resources to be allocated to the analysis process of the CPU allocation target (step S210). Specifically, the allocation change unit 240 determines the number of CPU cores to be allocated to each analysis process based on the total number of virtual CPU cores and the processing required time of each analysis process. Here, the "total number of virtual CPU cores" is the total of the CPU conversion number (converted resource amount) and the CPU core number (first computational resource amount) of the GPU. More specifically, the allocation change unit 240 determines the allocated resource amount (number of CPU cores) of each analysis process according to the ratio of the processing required time of each analysis process and the total number of virtual CPU cores.
  • the allocation change unit 240 determines the value obtained by subtracting the CPU conversion number of the GPU to be allocated from the number of virtual CPU cores allocated for each analysis process as the number of CPU cores allocated to the analysis process.
  • the allocation change unit 240 determines the number of CPU cores allocated to the face analysis process as Rv_f. Further, since one GPU is assigned to the human body analysis process, the allocation change unit 240 determines that the number of CPU cores assigned to the human body analysis process is Rv_b ⁇ (Tbc / Tbg).
  • the allocation change unit 240 outputs the allocated resource amount for each analysis process (step S212). Specifically, the allocation change unit 240 outputs information indicating which computational resources (CPU and GPU) are allocated and how much for each analysis process. As a result, the resource allocation unit 112 allocates computational resources to each analysis process with the determined (changed) allocated resource amount. As a result, the ratio of the number of virtual CPU cores assigned to each analysis process is changed to correspond to the ratio of the processing required time by the CPU, so that the processing waiting time can be reduced. Therefore, the throughput can be improved.
  • the processes of S204 to S210 may be repeated until all GPUs are assigned. In this case, for example, when the number of GPUs is 3, the processes of S204 to S210 are repeated three times. Alternatively, all GPUs may be allocated in the process of S206.
  • the threshold value Tth1 200 msec.
  • the number of objects corresponds to the load of computational resources. Therefore, when the technique of Patent Document 1 is applied to the above-mentioned specific example, the average number of objects in the face analysis process (16) is larger than the average number of objects in the human body analysis process (8).
  • the GPU is assigned to the face analysis process instead of the process.
  • the human body analysis process has a longer processing time than the face analysis process. Therefore, in the technique of Patent Document 1, the face analysis process is completed much earlier than the human body analysis process for the analysis process of the same frame image, and a long waiting process occurs before the human body analysis process is completed. It may not be possible to improve the throughput. On the other hand, in the second embodiment, it is possible to improve the throughput as described above.
  • the allocation change unit 240 determines that two CPU cores can be assigned to the face analysis process (S210).
  • the throughput before the allocation change is 1000 msec / max [202 msec, 1001 msec] ⁇ 1 frame / sec. Therefore, it can be seen that the throughput is improved by performing the allocation change processing.
  • Non-temporary computer-readable media include various types of tangible storage mediums.
  • Examples of non-temporary computer-readable media include magnetic recording media (eg, flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (eg, magneto-optical disks), CD-ROMs (ReadOnlyMemory), CD-Rs, Includes CD-R / W, semiconductor memory (eg, mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM (RandomAccessMemory)).
  • the program may also be supplied to the computer by various types of transient computer readable medium.
  • Examples of temporary computer readable media include electrical, optical, and electromagnetic waves.
  • the temporary computer-readable medium can supply the program to the computer via a wired communication path such as an electric wire and an optical fiber, or a wireless communication path.
  • (Appendix 1) An analysis execution means that executes analysis processing in parallel for each of multiple types of objects contained in an image, A resource allocation means for allocating at least one of a plurality of computational resources to each of the plurality of analysis processes.
  • a calculation means for calculating the first processing time which is a period from the processing start time to the processing end time of each of the plurality of analysis processes for the entire same image, and When the difference in the first processing time between the plurality of analysis processes becomes equal to or greater than a predetermined threshold value, the processing for changing the allocation of the computational resources so that the difference in the first processing time becomes small.
  • the resource allocation means allocates at least one of a plurality of computational resources to each of the plurality of analysis processes in response to the change process by the allocation change means.
  • Image processing device. (Appendix 2)
  • the allocation changing means has a second processing time, which is a processing time per object by each of the plurality of analysis processes, and the number of objects detected per image by each of the plurality of analysis processes. Based on, the amount of the computational resources allocated to each of the plurality of analysis processes is determined.
  • the image processing apparatus according to Appendix 1.
  • the allocation changing means is a third processing time required for each of the analysis processes for one image calculated by using the number of the objects and the second processing time for each of the plurality of analysis processes.
  • the image processing apparatus Determines the amount of computational resources to allocate to each of the plurality of analysis processes based on the processing time.
  • the image processing apparatus according to Appendix 2. (Appendix 4)
  • the allocation changing means determines the amount of computational resources allocated to each of the plurality of analysis processes according to the ratio of the third processing time for the plurality of analysis processes.
  • the image processing apparatus according to Appendix 3. (Appendix 5)
  • the plurality of computational resources include at least one first computational resource and at least one second computational resource having higher processing power than the first computational resource.
  • the allocation changing means determines the allocation of the first computational resource and the second computational resource.
  • the image processing apparatus according to any one of Supplementary note 1 to 4.
  • the allocation changing means has a long second processing time, which is the processing time per object by each of the plurality of analysis processes performed using the first computational resource among the plurality of analysis processes. It is determined that the second computational resource is allocated to the analysis process.
  • the image processing apparatus according to Appendix 5.
  • the allocation changing means includes a total of a converted resource amount obtained by virtually converting the amount of the second computational resource into the amount of the first computational resource and the amount of the first computational resource, and a plurality of the analyzes. A plurality of the above, based on a third processing time, which is a processing time required for each of the plurality of analysis processes for one image calculated by using the number of the objects and the second processing time for each processing.
  • the image processing apparatus Determining the amount of the first computational resource to be allocated to each analysis process, The image processing apparatus according to Appendix 6. (Appendix 8) When the number corresponding to the converted resource amount is equal to or greater than the number of objects corresponding to the analysis process determined to allocate the second computational resource, the allocation change means performs the first calculation in the analysis process. Decide not to allocate resources, The image processing apparatus according to Appendix 7. (Appendix 9) Allocate at least one of multiple computational resources to each of the analysis processes performed for each of the multiple types of objects contained in the image.
  • the first processing time which is the period from the processing start time to the processing end time of each of the analysis processings of the plurality of objects for the entire same image, is calculated.
  • the processing for changing the allocation of the computational resources so that the difference in the first processing time becomes small.
  • At least one of a plurality of computational resources is allocated to each of the plurality of analysis processes according to the change process.
  • Appendix 10 A plurality of said objects based on the number of objects detected per image by each of the plurality of analysis processes and the second processing time, which is the processing time per object by each of the plurality of analysis processes. Determine the amount of computational resources to allocate to each analysis process, The image processing method according to Appendix 9. (Appendix 11) For each of the plurality of analysis processes, based on the third processing time, which is the processing time required for each of the analysis processes for one image, calculated by using the number of the objects and the second processing time. Determines the amount of computational resources to allocate to each of the plurality of analysis processes. The image processing method according to Appendix 10.
  • the amount of computational resources allocated to each of the plurality of analysis processes is determined according to the ratio of the third processing time for the plurality of analysis processes.
  • the image processing method according to Appendix 11. The plurality of computational resources include at least one first computational resource and at least one second computational resource having higher processing power than the first computational resource. Determining the allocation of the first computational resource and the second computational resource.
  • the image processing method according to any one of Supplementary note 9 to 12. (Appendix 14) For the analysis process having a long second processing time, which is the processing time per object by each of the plurality of analysis processes performed using the first computational resource among the plurality of analysis processes. , Determines to allocate the second computational resource, The image processing method according to Appendix 13.
  • the image processing method according to Appendix 15. (Appendix 17) A step of allocating at least one of multiple computational resources to each of the analysis processes performed for each of the multiple types of objects contained in the image. A step of executing analysis processing in parallel for each of the plurality of types of objects, and A step of calculating a first processing time, which is a period from the processing start time to the processing end time of each of the analysis processes of a plurality of objects for the entire image of the same image, and When the difference in the first processing time between the plurality of analysis processes becomes equal to or greater than a predetermined threshold value, the processing for changing the allocation of the computational resources so that the difference in the first processing time becomes small. And the steps to do A step of allocating at least one of a plurality of computational resources to each of the plurality of analysis processes according to the change process.
  • a non-temporary computer-readable medium that contains a program that causes the computer to run.
  • Image processing unit 2 Analysis execution unit 4 Resource allocation unit 6
  • Calculation unit 8 Allocation change unit 20
  • Image processing system 30 Image processing device 100
  • Image processing unit 102 Control unit 104
  • Storage unit 106 Communication unit 108 Interface unit 110
  • Image acquisition unit 112 Resource allocation unit 120
  • Analysis execution unit 122 Face analysis execution unit 124
  • Human body analysis execution unit 130 Analysis status monitoring unit 132
  • Image processing time calculation unit 134 Allocation change judgment unit 136
  • Object information calculation unit 140
  • CPU allocation determination unit 240 Allocation change unit 242 Accelerator allocation decision unit

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

解析処理のスループットを向上させることが可能な画像処理装置を提供する。解析実行部(2)は、画像に含まれる複数の種類の対象物ごとに解析処理を並行して実行する。資源割当部(4)は、複数の種類の対象物の解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる。算出部(6)は、同一の画像の全体に対する複数の解析処理それぞれの第1の処理時間を算出する。割当変更部(8)は、複数の解析処理の間の第1の処理時間の差が予め定められた閾値以上となったときに、第1の処理時間の差が小さくなるように計算資源の割り当ての変更処理を行う。資源割当部(4)は、変更処理に応じて、複数の解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる。

Description

画像処理装置、画像処理方法及びコンピュータ可読媒体
 本発明は、画像処理装置、画像処理方法及びコンピュータ可読媒体に関する。
 映像等の画像に含まれる物体を解析の対象物として解析を行う技術がある。例えば、防犯カメラを用いて撮影され、防犯カメラによって生成された画像に含まれる対象物に対して解析処理を行って、不審人物等を検知することが行われている。このような技術に関連し、特許文献1は、入力された映像データから人の顔を検出し、さらに検出した顔の特徴を抽出する映像解析システムを開示する。特許文献1にかかる技術では、前段解析部で行われている解析処理の変化を観測した内容観測データを基に、後段解析部への計算資源の割り当てを動的に変更する。
国際公開第2018/097058号
 画像を用いて解析を行う場合に、例えば顔、人体及び物体(持ち物及び服装など)等といった複数の種類の対象物に対してそれぞれ解析処理を行い、それらの結果を統合することがある。このようにすることで、ある人物に持ち物、顔、服装などの情報を紐づけることができ、複数の対象物の情報が紐づけられた情報を不審人物の検知等に利用することができる。
 ここで、複数の種類の対象物に対する解析処理(以下、単に「複数の解析処理」と称することがある)の結果を統合するためには、同一の画像における複数の解析処理の結果が全て揃う必要がある。この場合において、複数の解析処理の処理時間が異なると、処理時間の短い解析処理が終了しても処理時間の長い解析処理が終了するまで処理待ちが発生する。したがって、スループットが低下するおそれがある。なお、特許文献1にかかる技術では、対象物の数が計算資源の負荷に対応している。しかしながら、複数の解析処理においては、対象物の数が少ない解析処理の処理時間よりも対象物の数が多い解析処理の処理時間が長いとは限らない。したがって、特許文献1にかかる技術では、複数の解析処理を行う場合にスループットを向上させることができないおそれがあった。
 本開示の目的は、このような課題を解決するためになされたものであり、解析処理のスループットを向上させることが可能な画像処理装置、画像処理方法及びプログラムを提供することにある。
 本開示にかかる画像処理装置は、画像に含まれる複数の種類の対象物ごとに解析処理を並行して実行する解析実行手段と、複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる資源割当手段と、同一の前記画像の全体に対する複数の前記解析処理それぞれの処理開始時刻から処理終了時刻までの期間である第1の処理時間を算出する算出手段と、複数の前記解析処理の間の前記第1の処理時間の差が予め定められた閾値以上となったときに、前記第1の処理時間の差が小さくなるように前記計算資源の割り当ての変更処理を行う割当変更手段と、を有し、前記資源割当手段は、前記割当変更手段による前記変更処理に応じて、複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる。
 また、本開示にかかる画像処理方法は、画像に含まれる複数の種類の対象物ごとに実行される解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当て、前記複数の種類の対象物ごとに解析処理を並行して実行し、同一の前記画像の全体に対する複数の対象物の前記解析処理それぞれの処理開始時刻から処理終了時刻までの期間である第1の処理時間を算出し、複数の前記解析処理の間の前記第1の処理時間の差が予め定められた閾値以上となったときに、前記第1の処理時間の差が小さくなるように前記計算資源の割り当ての変更処理を行い、前記変更処理に応じて、複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる。
 また、本開示にかかるプログラムは、画像に含まれる複数の種類の対象物ごとに実行される解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てるステップと、前記複数の種類の対象物ごとに解析処理を並行して実行するステップと、同一の前記画像の全体に対する複数の対象物の前記解析処理それぞれの処理開始時刻から処理終了時刻までの期間である第1の処理時間を算出するステップと、複数の前記解析処理の間の前記第1の処理時間の差が予め定められた閾値以上となったときに、前記第1の処理時間の差が小さくなるように前記計算資源の割り当ての変更処理を行うステップと、前記変更処理に応じて、複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てるステップと、をコンピュータに実行させる。
 本開示によれば、解析処理のスループットを向上させることが可能な画像処理装置、画像処理方法及びプログラムを提供できる。
本開示の実施の形態にかかる画像処理装置の概要を示す図である。 本開示の実施の形態にかかる画像処理装置によって実行される画像処理方法を示すフローチャートである。 実施の形態1にかかる画像処理システムの構成を示す図である。 実施の形態1にかかる画像処理装置の構成を示す図である。 実施の形態1にかかる画像処理装置によって実行される画像処理方法を示すフローチャートである。 実施の形態1にかかる画像処理装置によって実行される画像処理方法を示すフローチャートである。 実施の形態1にかかる顔解析処理及び人体解析処理を説明するための図である。 実施の形態1にかかる解析処理ログ情報を例示する図である。 実施の形態1にかかる対象物情報を例示する図である。 実施の形態2にかかる画像処理装置の構成を示す図である。 実施の形態2にかかる対象物情報を例示する図である。 実施の形態2にかかる画像処理装置によって実行される割り当て変更処理を示すフローチャートである。
(本開示にかかる実施の形態の概要)
 本開示の実施形態の説明に先立って、本開示にかかる実施の形態の概要について説明する。図1は、本開示の実施の形態にかかる画像処理装置1の概要を示す図である。
 画像処理装置1は、例えばサーバ等のコンピュータである。画像処理装置1は、解析実行部2と、資源割当部4と、算出部6と、割当変更部8とを有する。解析実行部2、資源割当部4、算出部6及び割当変更部8は、それぞれ、解析実行手段、資源割当手段、算出手段及び割当変更手段としての機能を有する。
 解析実行部2は、画像に含まれる複数の種類の対象物ごとに解析処理を別個に並行して実行する。ここで、「画像」は、動画像(映像)又は静止画像であってもよい。また、画像は、映像を構成するフレーム画像であってもよい。また、「対象物」は、解析処理の対象となる物体である。対象物は、例えば、人物の「顔」、人物の体全体である「人体」、及び、人物の持ち物又は服装等の「所有物」を含む。「計算資源」は、例えば、プロセッサ及びメモリ等を含む。プロセッサは、例えば、CPU(Central Processing Unit)及びハードウェアアクセラレータ(例えばGPU(Graphics Processing Unit))等を含んでもよい。
 資源割当部4は、複数の種類の対象物の解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる。算出部6は、同一の画像の全体に対する複数の解析処理それぞれの処理開始時刻から処理終了時刻までの期間である第1の処理時間(画像処理時間)を算出する。割当変更部8は、複数の解析処理の間の第1の処理時間の差が予め定められた閾値以上となったときに、第1の処理時間の差が小さくなるように計算資源の割り当ての変更処理を行う。資源割当部4は、割当変更部8による変更処理に応じて、複数の解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる。
 図2は、本開示の実施の形態にかかる画像処理装置1によって実行される画像処理方法を示すフローチャートである。資源割当部4は、複数の種類の対象物の解析処理それぞれに対して計算資源を割り当てる(ステップS10)。解析実行部2は、複数の種類の対象物ごとに解析処理を別個に並行して実行する(ステップS12)。例えば、複数の種類の対象物が対象物A(例えば「顔」)及び対象物B(例えば「人体」)である場合、解析実行部2は、対象物Aと対象物Bとで、解析処理を別個に並行して実行する。このとき、解析実行部2による解析処理の実行の前に、資源割当部4は、対象物Aに関する解析処理Aと対象物Bに関する解析処理Bそれぞれに対して計算資源を割り当てるものとする。
 算出部6は、同一の画像の全体に対する複数の解析処理それぞれの画像処理時間を算出する(ステップS14)。例えば、算出部6は、ある画像Xについて、解析処理Aの処理開始時刻から処理終了時刻までの期間である画像処理時間Aと、解析処理Bの処理開始時刻から処理終了時刻までの期間である画像処理時間Bとを算出する。
 割当変更部8は、画像処理時間の差が閾値以上である場合に、計算資源の割り当ての変更処理を行う(ステップS16)。資源割当部4は、割当変更部8による変更処理に応じて、複数の解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる(ステップS18)。ここで、割当変更部8は、画像処理時間の差が閾値以上である場合に、画像処理時間の差が小さくなるように、計算資源の割り当ての変更処理を行う。例えば、割当変更部8は、画像処理時間Aと画像処理時間Bとの差が閾値以上となったときに、計算資源の割り当ての変更処理を行う。なお、変更処理の具体例については後述する実施の形態において説明する。
 このように、本実施の形態では、複数の種類の対象物それぞれの解析処理の間の画像処理時間(第1の処理時間)の差が閾値以上である場合に、画像処理時間の差が小さくなるように計算資源の割り当ての変更処理を行うように構成されている。これにより、処理時間の短い解析処理が終了した後で処理時間の長い解析処理が終了するまで処理待ちの期間が短くなる。したがって、スループットを向上させることが可能となる。上記の例では、画像Xの次のタイミングで得られた画像Yについて、スループットを向上させることが可能となる。なお、上述した画像処理方法を実行するプログラムによっても、スループットを向上させることが可能となる。
(実施の形態1)
 以下、実施形態について、図面を参照しながら説明する。説明の明確化のため、以下の記載及び図面は、適宜、省略、及び簡略化がなされている。また、各図面において、同一の要素には同一の符号が付されており、必要に応じて重複説明は省略されている。
 図3は、実施の形態1にかかる画像処理システム20の構成を示す図である。画像処理システム20は、1つ以上の撮像装置30と、画像処理装置100とを有する。撮像装置30及び画像処理装置100は、インターネット等のネットワーク22を介して互いに通信可能に接続されている。なお、画像処理装置100は、例えばクラウドコンピューティングによって実現されてもよい。
 撮像装置30は、例えば、監視カメラ又は防犯カメラ等のカメラである。撮像装置30は、周囲の被写体(人、物、背景等)を撮影して、画像を示す画像データを生成する。ここで、「画像」は、動画像(映像)又は静止画像であってもよい。また、画像は、映像を構成するフレーム画像であってもよい。なお、以下、用語「画像」は、情報処理における処理対象としての、「画像を示す画像データ」も意味する。以下の説明では、画像がフレーム画像である例について説明する。
 画像処理装置100は、図1に示した画像処理装置1に対応する。画像処理装置100は、撮像装置30から画像を受信する。画像処理装置100は、受信された画像を解析して、画像に含まれる対象物を認識する。詳しくは後述する。なお、実施の形態1では、対象物として、人物の顔及び人体(体全体)を認識するとするが、対象物は、顔及び人体に限定されない。また、対象物の数は、2つに限られず、3つ以上の任意の数であってもよい。
 図4は、実施の形態1にかかる画像処理装置100の構成を示す図である。画像処理装置100は、主要なハードウェア構成として、制御部102と、記憶部104と、通信部106と、インタフェース部108(IF;Interface)とを有する。制御部102、記憶部104、通信部106及びインタフェース部108は、データバスなどを介して相互に接続されている。
 制御部102は、例えばCPU等のプロセッサである。制御部102は、解析処理、制御処理及び演算処理等を行う演算装置としての機能を有する。記憶部104は、例えばメモリ又はハードディスク等の記憶デバイスである。記憶部104は、例えばROM(Read Only Memory)又はRAM(Random Access Memory)等である。記憶部104は、制御部102によって実行される制御プログラム及び演算プログラム等を記憶するための機能を有する。また、記憶部104は、処理データ等を一時的に記憶するための機能を有する。記憶部104は、データベースを含み得る。
 通信部106は、撮像装置30等の他の装置とネットワーク22を介して通信を行うために必要な処理を行う。通信部106は、通信ポート、ルータ、ファイアウォール等を含み得る。インタフェース部108は、例えばユーザインタフェース(UI)である。インタフェース部108は、キーボード、タッチパネル又はマウス等の入力装置と、ディスプレイ又はスピーカ等の出力装置とを有する。インタフェース部108は、ユーザ(オペレータ)によるデータの入力の操作を受け付け、ユーザに対して情報を出力する。例えば、インタフェース部108は、解析処理の結果を出力してもよい。また、インタフェース部108は、各解析処理に割り当てられている計算資源の量を出力してもよい。
 実施の形態1にかかる画像処理装置100は、構成要素として、画像取得部110と、資源割当部112と、解析実行部120と、解析状況監視部130と、割当変更部140とを有する。解析実行部120は、顔解析実行部122と、人体解析実行部124とを有する。解析状況監視部130は、画像処理時間算出部132と、割当変更判定部134と、対象物情報算出部136とを有する。割当変更部140は、CPU割当決定部142を有する。なお、画像処理装置100は、物理的に1つの装置で構成されている必要はない。この場合、上述した各構成要素は、物理的に別個の複数の装置によって実現されてもよい。
 画像取得部110は、画像取得手段としての機能を有する。資源割当部112は、図1に示した資源割当部4に対応する。資源割当部112は、資源割当手段としての機能を有する。解析実行部120は、図1に示した解析実行部2に対応する。解析実行部120は、解析実行手段としての機能を有する。解析状況監視部130は、図1に示した算出部6に対応する。解析状況監視部130は、解析状況監視手段としての機能を有する。割当変更部140は、図1に示した割当変更部8に対応する。割当変更部140は、割当変更手段としての機能を有する。
 また、顔解析実行部122は、顔解析実行手段としての機能を有する。人体解析実行部124は、人体解析実行手段としての機能を有する。画像処理時間算出部132は、図1に示した算出部6に対応する。画像処理時間算出部132は、画像処理時間算出手段としての機能を有する。割当変更判定部134は、割当変更判定手段としての機能を有する。対象物情報算出部136は、対象物情報算出手段としての機能を有する。CPU割当決定部142は、CPU割合決定手段としての機能を有する。
 なお、上述した各構成要素は、例えば、制御部102の制御によって、プログラムを実行させることによって実現できる。より具体的には、各構成要素は、記憶部104に格納されたプログラムを、制御部102が実行することによって実現され得る。また、必要なプログラムを任意の不揮発性記録媒体に記録しておき、必要に応じてインストールすることで、各構成要素を実現するようにしてもよい。また、各構成要素は、プログラムによるソフトウェアで実現することに限ることなく、ハードウェア、ファームウェア、及びソフトウェアのうちのいずれかの組み合わせ等により実現してもよい。また、各構成要素は、例えばFPGA(field-programmable gate array)又はマイコン等の、ユーザがプログラミング可能な集積回路を用いて実現してもよい。この場合、この集積回路を用いて、上記の各構成要素から構成されるプログラムを実現してもよい。これらのことは、後述する他の実施の形態においても同様である。なお、各構成要素の具体的な機能については後述する。
 図5及び図6は、実施の形態1にかかる画像処理装置100によって実行される画像処理方法を示すフローチャートである。資源割当部112は、計算資源の割り当てを行う(ステップS100)。具体的には、資源割当部112は、解析実行部120によって実行される複数の解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる。さらに具体的には、資源割当部112は、顔解析実行部122によって実行される顔解析処理と、人体解析実行部124によって実行される人体解析処理とに、計算資源を割り当てる。詳しくは後述する。
 画像取得部110は、フレーム画像を取得する(ステップS102)。具体的には、画像取得部110は、撮像装置30によって生成されたフレーム画像を取得する。画像取得部110は、撮像装置30によってフレーム画像が生成されるごとにフレーム画像を取得してもよい。あるいは、撮像装置30からのフレーム画像が記憶部104(バッファ)に一時的に格納される場合、画像取得部110は、バッファからフレーム画像を取得してもよい。なお、撮像装置30が時系列的に連続して静止画像を生成する場合、画像取得部110は、静止画像を取得してもよい。
 解析実行部120は、顔解析処理と人体解析処理とを別個に並行して実行する(ステップS104)。つまり、解析実行部120は、画像に含まれる複数の種類の対象物ごとに解析処理を別個に並行して実行する。具体的には、顔解析実行部122は、顔解析処理を行う。人体解析実行部124は、人体解析処理を行う。
 図7は、実施の形態1にかかる顔解析処理及び人体解析処理を説明するための図である。フレーム画像が取得されると、解析実行部120は、顔解析処理と人体解析処理とを並行して実行する。そして、解析実行部120は、同じフレーム画像において顔解析処理及び人体解析処理が終了すると、顔解析処理の結果と人体解析処理の結果とを統合する。これにより、あるフレーム画像に写された人物の顔の特徴及び身体の特徴を詳細に示す情報を生成することができる。このようにして生成された情報を用いて、不審人物の探索等を行うことができる。
 顔解析実行部122は、フレーム画像に対して顔検出処理を行う。顔検出処理において、顔解析実行部122は、フレーム画像における顔の位置を検出する。そして、顔解析実行部122は、検出された顔の特徴(特徴量)を抽出する。そして、顔の特徴を示す顔特徴データを、顔解析処理の結果として出力する。なお、顔解析実行部122は、顔検出の精度が予め定められた値よりも高い顔に対して、顔の特徴の抽出を行ってもよい。
 人体解析実行部124は、フレーム画像に対して人体検出処理を行う。人体検出処理において、人体解析実行部124は、フレーム画像における人体の位置を検出する。そして、人体解析実行部124は、検出された人体の特徴(特徴量)を抽出する。そして、人体の特徴を示す人体特徴データを、人体解析処理の結果として出力する。なお、人体解析実行部124は、人体検出の精度が予め定められた値よりも高い人体に対して、人体の特徴の抽出を行ってもよい。
 ここで、人体検出処理では、フレーム画像に全身が写っていないと、人体である物体を人体と検出(認識)することができない可能性が高い。一方、顔検出処理では、フレーム画像に全身が写っていなくても、顔が写っていれば、顔である物体を顔と検出(認識)することができる可能性が高い。したがって、同じフレーム画像でも、検出される顔の数及び人体の数は互いに異なり得る。
 また、同じフレーム画像でも、対象物の種類によって、1つの対象物の解析に要する時間が異なり得る。例えば、人体の特徴量のボリュームは顔の特徴量のボリュームよりも大きいので、人体の特徴の抽出処理に要する時間は、顔の特徴の抽出処理に要する時間よりも長いことが多い。図7の例では、顔の特徴の抽出処理に要する時間は50msecであり、人体の特徴の抽出処理に要する時間は250msecである。
 図5の説明に戻る。解析状況監視部130は、各解析処理のログ情報(解析処理ログ情報)を取得する(ステップS106)。解析処理ログ情報は、解析状況監視部130によって生成されてもよいし、解析実行部120によって生成されてもよい。解析状況監視部130は、解析処理ログ情報を用いて、解析実行部120による解析処理の実行状況を監視する。
 図8は、実施の形態1にかかる解析処理ログ情報を例示する図である。解析処理ログ情報は、カメラIDと、フレームIDと、対象物の種類(「顔」又は「人体」)と、対象物のIDと、処理開始時刻と、処理終了時刻と、処理ハードウェア情報とを含む。図8の例では、カメラID(撮像装置30の識別情報)は「カメラ#1」であり、フレームID(フレーム画像の識別情報)は「フレーム#1」である。また、図8の例では、対象物「顔」のIDが「顔#1」~「顔#m」であり、対象物「人体」のIDが「人体#1」~「人体#n」である。つまり、図8の例では、フレーム#1のフレーム画像において、対象物「顔」の検出数はm個であり、対象物「人体」の検出数はn個である。また、図8の例では、各解析処理は全てCPUによって実行されている。
 また、対象物「顔#1」の処理開始時刻はt_f1sであり、処理終了時刻はt_f1eである。また、対象物「顔#2」の処理開始時刻はt_f2sであり、処理終了時刻はt_f2eである。また、対象物「顔#m」の処理開始時刻はt_fmsであり、処理終了時刻はt_fmeである。ここで、図8の例では、顔解析実行部122は、最初に、対象物「顔#1」についての解析処理を実行し、最後に、対象物「顔#m」についての解析処理を実行するとする。
 また、対象物「人体#1」の処理開始時刻はt_b1sであり、処理終了時刻はt_b1eである。また、対象物「人体#2」の処理開始時刻はt_b2sであり、処理終了時刻はt_b2eである。また、対象物「人体#n」の処理開始時刻はt_bnsであり、処理終了時刻はt_bneである。ここで、図8の例では、人体解析実行部124は、最初に、対象物「人体#1」についての解析処理を実行し、最後に、対象物「人体#n」についての解析処理を実行するとする。
 なお、顔解析実行部122は、顔#1~顔#mに対して、逐次的に解析処理を実行してもよい。この場合、顔解析実行部122は、顔#1に対する解析処理が終了してから顔#2に対する解析処理を開始する。したがって、顔#1についての処理開始時刻t_f1sから処理終了時刻t_f1eまでの期間は、顔#2についての処理開始時刻t_f2sから処理終了時刻t_f2eまでの期間と重なっていない。あるいは、顔解析実行部122は、顔#1~顔#mに対して並行して解析処理を実行してもよい。この場合、顔解析実行部122は、顔#1に対する解析処理が終了する前に顔#2に対する解析処理を開始してもよい。したがって、顔#1についての処理開始時刻t_f1sから処理終了時刻t_f1eまでの期間は、顔#2についての処理開始時刻t_f2sから処理終了時刻t_f2eまでの期間と重なってもよい。このような逐次処理又は並行処理は、顔解析処理に割り当てられた計算資源(CPU等)の量に応じて、適宜、選択され得る。なお、これらのことは、人体解析実行部124(人体解析処理)についても同様である。
 図5の説明に戻る。解析状況監視部130は、各解析処理それぞれのフレーム処理時間(画像処理時間;第1の処理時間)を算出する(ステップS108)。具体的には、画像処理時間算出部132は、同一のフレーム画像の全体に対する、顔解析処理のフレーム処理時間及び人体解析処理のフレーム処理時間を算出する。ここで、フレーム処理時間は、1つのフレーム画像の全体における各解析処理の処理開始時刻から処理終了時刻までの期間である。言い換えると、フレーム処理時間は、各解析処理について、1つのフレーム画像内の全ての対象物に関する処理を行うのに要した時間である。例えば、フレーム処理時間は、各解析処理について、最初に実行された対象物に関する処理開始時刻から、最後に実行された対象物に関する処理終了時刻までの期間である。
 図8の例において、「フレーム#1」のフレーム画像では、顔解析処理は、対象物「顔#1」の処理から開始し、対象物「顔#m」の処理で終了する。したがって、「フレーム#1」のフレーム画像の全体に対する顔解析処理の処理開始時刻は、対象物「顔#1」の処理開始時刻t_f1sである。また、「フレーム#1」のフレーム画像の全体に対する顔解析処理の処理終了時刻は、対象物「顔#m」の処理終了時刻t_fmeである。したがって、画像処理時間算出部132は、「フレーム#1」のフレーム画像の全体に対する顔解析処理のフレーム処理時間を、Tif=t_fme-t_f1sと算出する。
 また、図8の例において、「フレーム#1」のフレーム画像では、人体解析処理は、対象物「人体#1」の処理から開始し、対象物「人体#n」の処理で終了する。したがって、「フレーム#1」のフレーム画像の全体に対する人体解析処理の処理開始時刻は、対象物「人体#1」の処理開始時刻t_b1sである。また、「フレーム#1」のフレーム画像の全体に対する人体解析処理の処理終了時刻は、対象物「人体#n」の処理終了時刻t_bneである。したがって、画像処理時間算出部132は、「フレーム#1」のフレーム画像の全体に対する人体解析処理のフレーム処理時間を、Tib=t_bne-t_b1sと算出する。
 解析状況監視部130は、複数の解析処理の間のフレーム処理時間の差が予め定められた閾値以上であるか否かを判定する(ステップS110)。具体的には、割当変更判定部134は、顔解析処理のフレーム処理時間Tifと人体解析処理のフレーム処理時間Tibとの差ΔTi(=|Tif-Tib|)が予め定められた閾値Tth1以上であるか否かを判定する。つまり、割当変更判定部134は、ΔTi≧Tth1であるか否かを判定する。なお、フレーム処理時間の差ΔTiは、複数の解析処理の間の処理待ちの期間に対応する。したがって、閾値Tth1は、許容できる処理待ち期間(スループット)に応じて、適宜定められ得る。
 なお、対象物の種類が3つ以上である場合、解析処理も3つ以上となる。この場合、フレーム処理時間の差ΔTiは、最大のフレーム処理時間と、最小のフレーム処理時間との差としてもよい。例えば、対象物の種類が、顔、人体及び所有物であるケースで、所有物の解析処理のフレーム処理時間Tipが最も長く、顔解析処理のフレーム処理時間Tifが最も短い場合、ΔTi=Tip-Tifとなる。
 フレーム処理時間の差ΔTiが閾値Tth1以上でない場合(S110のNO)、処理待ちの期間は許容範囲内であり、スループットの許容できない程度の悪化は発生していない可能性が高い。したがって、割当変更判定部134は、計算資源の割り当ての変更を行わないと決定する。この場合、後述するS20の処理は省略され、処理はS116に進む。
 一方、フレーム処理時間の差ΔTiが閾値Tth1以上である場合(S110のYES)、処理待ちの期間は許容範囲を超え、スループットの許容できない程度の悪化が発生している可能性が高い。したがって、割当変更判定部134は、計算資源の割り当ての変更を行うと決定する(ステップS112)。この場合、対象物情報算出部136は、対象物情報を算出する(ステップS114)。ここで、対象物情報は、対象物に関する情報であって、対象物数と対象物処理時間とに関する情報を含む。したがって、対象物情報算出部136は、対象物数と対象物処理時間とに関する情報を算出する。対象物数及び対象物処理時間については後述する。解析状況監視部130は、割当変更指示を割当変更部140に出力する。割当変更指示は、対象物情報を含んでもよい。なお、S114の処理は、S110の判定がYESの場合のみに実行されることに限定されず、解析処理ログ情報が取得された場合に常に算出されてもよい。
 図9は、実施の形態1にかかる対象物情報を例示する図である。対象物情報は、直近の対象物数の平均と、直近の対象物処理時間(第2の処理時間)の平均とを含む。ここで、「対象物数」は、1つのフレーム画像から検出された各対象物の種類(顔又は人体)の対象物の数である。つまり、「対象物数」は、1つの画像当たりの検出された対応する対象物の数である。図8の例では、フレーム#1の顔の対象物数はm個であり、人体の対象物数はn個である。
 また、「対象物処理時間」とは、1つの対象物あたりの解析処理に必要な処理時間である。図8の例では、対象物「顔#1」の対象物処理時間は(t_f1e-t_f1s)であり、対象物「顔#2」の対象物処理時間は(t_f2e-t_f2s)である。また、対象物「人体#1」の対象物処理時間は(t_b1e-t_b1s)であり、対象物「人体#2」の対象物処理時間は(t_b2e-t_b2s)である。
 また、「直近の対象物数の平均(平均対象物数)」とは、現在時刻(又は処理対象のフレーム画像の撮影時刻)から予め定められた時間だけ前(例えば数秒前;5秒~10秒前)までの期間の、各対象物の種類ごとの対象物数の平均値である。図9の例では、「顔」については、「直近の対象物数の平均(平均対象物数)」はM個である。また、「人体」については、「直近の対象物数の平均(平均対象物数)」はN個である。
 また、「直近の対象物処理時間の平均(平均対象物処理時間)」とは、現在時刻(又は処理対象のフレーム画像の撮影時刻)から予め定められた時間だけ前(例えば数秒前;5秒~10秒前)までの期間の、各対象物の種類ごとの対象物処理時間の平均値である。「直近の対象物処理時間の平均」は、処理を行った計算資源の種類(例えばCPU等)によって異なり得る。図9の例では、「顔」については、CPUによる解析処理の「直近の対象物処理時間の平均(平均対象物処理時間)」はTfc[msec/個]である。また、「人体」については、CPUによる解析処理の「直近の対象物処理時間の平均(平均対象物処理時間)」はTbc[msec/個]である。
 図5の説明に戻る。割当変更部140は、割り当て変更処理を行う(ステップS20)。具体的には、CPU割当決定部142は、対象物情報を用いて、複数の解析処理(顔解析処理及び人体解析処理)それぞれに割り当てる計算資源の量(例えばCPUコア数)を決定する。CPU割当決定部142は、複数の解析処理それぞれについて、後述する処理必要時間(第3の処理時間)に基づいて、複数の解析処理それぞれに割り当てる前記計算資源の量を決定する。CPU割当決定部142は、複数の解析処理に関する処理必要時間の比に応じて、複数の解析処理それぞれに割り当てる前記計算資源の量を決定する。詳しくは後述する。
 割り当て変更処理(S20)の後、全てのフレーム画像について処理が終了した場合(ステップS116のYES)、処理は終了する。一方、全てのフレーム画像について処理が終了していない場合(S116のNO)、処理はS102に戻り、上述した処理が繰り返される。
 図6は、実施の形態1にかかる割り当て変更処理(S20)を示すフローチャートである。割当変更部140は、解析状況監視部130から対象物情報を取得する(ステップS22)。具体的には、CPU割当決定部142は、対象物情報を含む割当変更指示を解析状況監視部130から受信することで、対象物情報を取得してもよい。あるいは、解析状況監視部130は、対象物情報をデータベースに格納しておいてもよい。この場合、割当変更部140は、割当変更指示を受信した場合に、データベースから対象物情報を取得する。
 割当変更部140は、対象物情報を用いて各解析処理の処理必要時間(第3の処理時間)を算出する(ステップS24)。具体的には、CPU割当決定部142は、解析処理ごとに、平均対象物処理時間に平均対象物数を乗算することによって、処理必要時間を算出する。ここで、「処理必要時間」とは、1つの画像(フレーム画像)に対する複数の解析処理それぞれに必要な処理時間である。言い換えると、「処理必要時間」とは、1つの画像(フレーム画像)に対する複数の解析処理それぞれに必要と予測される処理時間である。図9の例では、顔解析処理の処理必要時間は、Tfc×M[msec]と算出される。また、人体解析処理の処理必要時間は、Tbc×N[msec]と算出される。
 割当変更部140は、各解析処理の処理必要時間の比に応じて各解析処理の割当資源量を決定する(ステップS26)。具体的には、CPU割当決定部142は、割り当てられる計算資源の量(資源量)の比が各解析処理の処理必要時間の比に対応するように、各解析処理の割当資源量を決定する。さらに具体的には、CPU割当決定部142は、顔解析処理に割り当てられる資源量と人体解析処理に割り当てられる資源量との比が、顔解析処理の処理必要時間と人体解析処理の処理必要時間との比に対応するように、各解析処理の割当資源量を決定する。
 ここで、図9の例では、顔解析処理の処理必要時間と人体解析処理の処理必要時間との比は、Tfc×M:Tbc×Nである。ここで、CPUコア数をRcとする。このとき、顔解析処理に割り当てられる資源量Rc_fは、Rc_f=Rc×(Tfc×M)/(Tfc×M+Tbc×N)と算出される。また、人体解析処理に割り当てられる資源量Rc_bは、Rc_b=Rc×(Tbc×N)/(Tfc×M+Tbc×N)と算出される。なお、算出された値が整数でない場合、算出された値に最も近い整数が、割り当てられる資源量(CPUコア数)として決定される。
 割当変更部140は、各解析処理それぞれの割当資源量を出力する(ステップS28)。具体的には、割当変更部140は、各解析処理それぞれの割当資源量を、資源割当部112に出力する。これにより、資源割当部112は、決定された(変更された)割当資源量で、各解析処理に計算資源を割り当てる。これにより、各解析処理に割り当てられる資源量の比が処理必要時間の比に対応するように変更されるので、処理待ちの時間が低減され得る。したがって、スループットが向上し得る。つまり、あるフレーム#1について図5に示した処理を行うことによって、フレーム#1の後のタイミングで生成されたフレーム#2に対する解析処理のスループットを向上させることが可能となる。
<具体例>
 上述した実施の形態1に係る処理を、具体的な数値を用いて説明する。顔解析処理のフレーム処理時間をTif=202msec、人体解析処理のフレーム処理時間をTib=1001msecとする。また、閾値Tth1=200msecとする。この場合、フレーム処理時間の差はΔTi=1001-202=799msec>200msecとなるので、割当変更判定部134は、割り当ての変更を行うと判定する(S110のYES,S112)。
 また、顔解析処理の平均対象物数をM=16個、人体解析処理の平均対象物数をN=8個とする。また、顔解析処理の対象物処理時間をTfc=50msec/個、人体解析処理の対象物処理時間をTbc=250msec/個とする。この場合、CPU割当決定部142は、顔解析処理の処理必要時間を、Tfc×M=50×16=800[msec]と算出する(S24)。また、CPU割当決定部142は、人体解析処理の処理必要時間を、Tbc×N=250×8=2000[msec]と算出する(S24)。
 また、CPU割当決定部142は、処理必要時間の比を、Tfc×M:Tbc×N=800:2000=2:5と算出する。また、解析処理に使用されるCPUコア数をRc=6個とする。この場合、CPU割当決定部142は、顔解析処理に割り当てられる資源量を、Rc_f=Rc×(Tfc×M)/(Tfc×M+Tbc×N)=6×(2/(2+5))≒2[個]と算出する。また、CPU割当決定部142は、人体解析処理に割り当てられる資源量を、Rc_b=Rc×(Tbc×N)/(Tfc×M+Tbc×N)=6×(5/(2+5))≒4[個]と算出する。
 この場合、割り当て変更後の1フレーム画像あたりの顔解析処理の処理時間は、Tfc×M/Rc_f=50×16/2=400[msec]となる。また、割り当て変更後の1フレーム画像あたりの人体解析処理の処理時間は、Tbc×N/Rc_b=250×8/4=500[msec]となる。したがって、処理待ちの時間は500-400=100msecとなり、割り当て変更後のスループットは、1000msec/max[400msec,500msec]=2フレーム/秒となる。一方、割り当て変更前のスループットは、1000msec/max[202msec,1001msec]≒1フレーム/秒となる。したがって、割り当ての変更処理を行うことによって、スループットが向上していることが分かる。
 なお、上述したように、特許文献1の技術では、対象物の数が計算資源の負荷に対応している。したがって、特許文献1の技術を上述した具体例に適用すると、顔解析処理の平均対象物数(16個)の方が人体解析処理の平均対象物数(8個)よりも多いので、人体解析処理よりも顔解析処理の方により多くのCPUコアを割り当ててしまう。しかしながら、上述したように、処理必要時間については、人体解析処理の処理必要時間の方が顔解析処理の処理必要時間よりも長い。したがって、特許文献1の技術では、同一のフレーム画像の解析処理について、顔解析処理が人体解析処理よりもはるかに早く終了してしまい、人体解析処理が終了するまでに長い処理待ちが発生し、スループットを向上させることができないおそれがある。具体的には、特許文献1にかかる技術では、対象物数の比から、6個のCPUコアのうち、顔解析処理に4個、人体解析処理に2個のCPUコアが割り当てられる。すると、顔解析処理の処理時間は、50×16/4=200msecとなり、人体解析処理の処理時間は、250×8/2=1000msecとなる。したがって、処理待ちの時間は1000-200=800msecとなり、割り当て変更後のスループットは、1000msec/max[200msec,1000msec]=1フレーム/秒となる。したがって、実施の形態1にかかる方法は、特許文献1にかかる技術よりもスループットを向上させることが可能となる。
(実施の形態2)
 次に、実施の形態2について説明する。実施の形態2では、解析処理を実行する計算資源が、CPUだけでなく、ハードウェアアクセラレータも含む点で、実施の形態1と異なる。なお、実施の形態2にかかる画像処理システム20の構成については、実施の形態1にかかるものと実質的に同様であるので、説明を省略する。
 図10は、実施の形態2にかかる画像処理装置100の構成を示す図である。画像処理装置100は、主要なハードウェア構成として、制御部102と、記憶部104と、通信部106と、インタフェース部108とを有する。ここで、制御部102は、少なくとも1つのCPU(第1の計算資源)と、少なくとも1つのハードウェアアクセラレータ(第2の計算資源)とを含む。ハードウェアアクセラレータは、CPUよりも性能(処理能力)が高い計算資源である。「処理能力」とは、例えば処理速度である。ハードウェアアクセラレータは、GPU、FPGA、又は、深層学習用等の専用ハードウェアを含んでもよい。実施の形態2では、ハードウェアアクセラレータ(以後、単に「アクセラレータ」と称することがある)がGPUである例について説明する。制御部102以外のハードウェアについては、実施の形態1と実質的に同様であってもよい。
 実施の形態2にかかる画像処理装置100は、構成要素として、画像取得部110と、資源割当部112と、解析実行部120と、解析状況監視部130と、割当変更部240とを有する。なお、割当変更部240以外の構成要素については、実施の形態1にかかるものと実質的に同様であるので、説明を省略する。つまり、実施の形態1にかかる画像処理装置100は、実施の形態1と同様に、図5に示したS100~S116の処理を行う。
 割当変更部240は、割当変更手段としての機能を有する。割当変更部240は、CPU割当決定部142と、アクセラレータ割当決定部242とを有する。アクセラレータ割当決定部242は、アクセラレータ割当決定手段としての機能を有する。実施の形態2にかかる割当変更部240は、CPU(第1の計算資源)及びアクセラレータ(第2の計算資源)の割り当てを決定する。
 次に、実施の形態2にかかる画像処理装置100によって実行される画像処理方法について説明する。ここで、実施の形態2にかかる画像処理方法について、図5のS20の処理以外の処理については実施の形態1にかかる処理と実質的に同様であるので、説明を省略する。但し、実施の形態2においては、S106の処理で取得される解析処理ログ情報、及び、S114において算出される対象物情報が、実施の形態1と異なる。解析処理ログ情報について、図8の例では、各解析処理は全てCPUによって実行されているが、実施の形態2では、一部又は全ての解析処理が、アクセラレータ(例えばGPU)によって実行され得る。
 図11は、実施の形態2にかかる対象物情報を例示する図である。図11に示すように、実施の形態2では、対象物処理時間(平均対象物処理時間)は、解析処理を実行したハードウェアの種類(CPU及びGPU)ごとに算出される。図11の例では、「顔」については、GPUによる解析処理の「直近の対象物処理時間の平均(平均対象物処理時間)」はTfg[msec/個]である。また、「人体」については、GPUによる解析処理の「直近の対象物処理時間の平均(平均対象物処理時間)」はTbg[msec/個]である。なお、各解析処理がCPUかGPUのいずれの計算資源で実行されたかについては、解析処理ログ情報に示されている。対象物情報のその他の情報については、図8に示した実施の形態1にかかるものと実質的に同様であるので、説明を省略する。
 図12は、実施の形態2にかかる画像処理装置によって実行される割り当て変更処理(S20)を示すフローチャートである。割当変更部240は、図6に示したS22~S28と実質的に同様の処理を行う(ステップS200)。なお、S28の処理については、CPU割当決定部142が、各解析処理それぞれのCPUの割当資源量を、アクセラレータ割当決定部242に出力する。つまり、実施の形態2では、資源割当部112は、S26で決定された割当資源量で計算資源の割り当てを行うわけではない。
 割当変更部240(アクセラレータ割当決定部242)は、各解析処理それぞれの割当資源量を取得する(ステップS202)。なお、このとき取得される割当資源量は、CPUの割当資源量である。つまり、実施の形態2においても、割り当て処理を行う際には、実施の形態1と同様に、まず、各解析処理にCPUを割り当てたと仮定した処理を行う。これにより、CPUだけでなくGPUを解析処理に割り当てる処理の複雑化を抑制することができる。
 割当変更部240は、対象物1つあたりの割当資源量が多い解析処理を選択する(ステップS204)。具体的には、アクセラレータ割当決定部242は、各解析処理について、対象物1つあたりの割当資源量を算出する。さらに具体的には、アクセラレータ割当決定部242は、顔解析処理の対象物(顔)1つあたりの割当資源量を、Rc_f/Mと算出する。同様に、アクセラレータ割当決定部242は、人体解析処理の対象物(人体)1つあたりの割当資源量を、Rc_b/Nと算出する。アクセラレータ割当決定部242は、Rc_f/MとRc_b/Nとを比較して、大きい方に対応する解析処理を選択する。例えば、Rc_f/M<Rc_b/Nであれば、アクセラレータ割当決定部242は、人体解析処理を選択する。
 割当変更部240(アクセラレータ割当決定部242)は、S204で選択された解析処理に対してGPU(アクセラレータ)を割り当てると決定する(ステップS206)。例えば、S204で人体解析処理が選択された場合、アクセラレータ割当決定部242は、人体解析処理にGPUを割り当てる。これにより、処理負荷が高いと考えられる解析処理に対して、優先的に、アクセラレータを割り当てることができる。したがって、スループットを向上させることが可能となる。
 なお、Rc_f/M=Rc×Tfc/(Tfc×M+Tbc×N)であり、Rc_b/N=Rc×Tbc/(Tfc×M+Tbc×N)である。したがって、対象物1つあたりの割当資源量が多い解析処理とは、CPUを用いて行った各解析処理に対応する平均対象物処理時間(Tfc,Tbc)が長い解析処理であると言える。したがって、アクセラレータ割当決定部242は、複数の解析処理のうち、CPUを用いて行った対象物処理時間が長い解析処理に対して、GPUを割り当てると決定する。
 割当変更部240(アクセラレータ割当決定部242)は、割り当てられたGPUのCPU換算数が対象物数以上の解析処理を、CPUの割り当て対象から除外する(ステップS208)。ここで、CPU換算数とは、GPU(第2の計算資源)の量をCPU(第1の計算資源)の量に仮想的に換算した換算資源量に対応する。したがって、割当変更部240は、換算資源量に対応する数がGPUを割り当てると決定された解析処理に対応する対象物の数以上となる場合に、当該解析処理にCPUを割り当てないと決定する。
 具体的には、アクセラレータ割当決定部242は、CPU換算数を算出する。具体的には、アクセラレータ割当決定部242は、GPUが割り当てられた解析処理について、CPUの対象物処理時間をGPUの対象物処理時間で除算することによって、CPU換算数を算出する。例えば、人体解析処理にGPUが割り当てられたとすると、アクセラレータ割当決定部242は、CPU換算数を、Tbc/Tbg[CPU/GPU]と算出する。また、顔解析処理にGPUが割り当てられたとすると、アクセラレータ割当決定部242は、CPU換算数を、Tfc/Tfg[CPU/GPU]と算出する。なお、算出された値が整数でない場合、アクセラレータ割当決定部242は、算出された値に最も近い整数を、CPU換算数(換算資源量)として決定してもよい。
 アクセラレータ割当決定部242は、CPU換算数と対象物数(平均対象物数)とを比較する。例えば、人体解析処理にGPUが割り当てられたとすると、Tbc/Tbgと人体解析処理の平均対象物数Nとを比較する。そして、アクセラレータ割当決定部242は、Tbc/Tbg≧Nである場合に、GPUが割り当てられた人体解析処理を、CPUの割り当て対象から除外する。つまり、アクセラレータ割当決定部242は、人体解析処理にCPUを割り当てないと決定する。また、例えば、顔解析処理にGPUが割り当てられたとすると、Tfc/Tfgと顔解析処理の平均対象物数Mとを比較する。そして、アクセラレータ割当決定部242は、Tfc/Tfg≧Mである場合に、GPUが割り当てられた顔解析処理を、CPUの割り当て対象から除外する。つまり、アクセラレータ割当決定部242は、顔解析処理にCPUを割り当てないと決定する。
 このように、GPUが割り当てられた解析処理をCPUの割り当て対象から除外するのは、このような解析処理にCPUを割り当てても、割り当てられたCPUは解析処理に使用されない可能性が極めて高いからである。つまり、ある解析処理に割り当てられたGPUのCPU換算数が対象物数以上の場合、1つのフレーム画像の全ての対象物についてGPUを用いて処理する時間は、1つの対象物についてCPUを用いて処理する時間よりも短い。例えば、人体解析処理に割り当てられたGPUのCPU換算数が対象物数以上の場合、1つのフレーム画像の全ての人体についてGPUを用いて処理する時間は、1つの人体についてCPUを用いて処理する時間よりも短い。したがって、その解析処理については、GPUだけを用いて処理した方が早い。したがって、上述した条件では、GPUが割り当てられた解析処理をCPUの割り当て対象から除外する。
 割当変更部240は、CPU割当て対象の解析処理に割り当てるCPUの割当資源量を決定する(ステップS210)。具体的には、割当変更部240は、仮想CPUコア総数と、各解析処理の処理必要時間とに基づいて、各解析処理に割り当てるCPUコア数を決定する。ここで、「仮想CPUコア総数」とは、GPUのCPU換算数(換算資源量)とCPUコア数(第1の計算資源の量)との合計である。さらに具体的には、割当変更部240は、各解析処理の処理必要時間の比と仮想CPUコア総数とに応じて各解析処理の割当資源量(CPUコア数)を決定する。
 ここで、図11の例において、CPUコア数をRc、GPUの数を1個とする。また、人体解析処理にGPUが割り当てられると決定されたとする。このとき、仮想CPUコア総数Rvは、Rv=Rc+(Tbc/Tbg)と算出される。また、顔解析処理のCPUの処理必要時間と人体解析処理のCPUの処理必要時間との比は、Tfc×M:Tbc×Nである。このとき、顔解析処理に割り当てられる仮想CPUコア数は、Rv_f=Rv×(Tfc×M)/(Tfc×M+Tbc×N)と算出される。また、人体解析処理に割り当てられる仮想CPUコア数は、Rv_b=Rv×(Tbc×N)/(Tfc×M+Tbc×N)と算出される。なお、算出された値が整数でない場合、算出された値に最も近い整数が、割り当てられる資源量(仮想CPUコア数)として決定される。
 そして、割当変更部240は、各解析処理について、割り当てられる仮想CPUコア数から割り当てられるGPUのCPU換算数を減算した値を、その解析処理に割り当てられるCPUコア数と決定する。上記の例では、顔解析処理にGPUが割り当てられないので、割当変更部240は、顔解析処理に割り当てられるCPUコア数を、Rv_fと決定する。また、人体解析処理には1個のGPUが割り当てられるので、割当変更部240は、人体解析処理に割り当てられるCPUコア数を、Rv_b-(Tbc/Tbg)と決定する。
 その後、割当変更部240は、各解析処理それぞれの割当資源量を出力する(ステップS212)。具体的には、割当変更部240は、解析処理ごとに、どの計算資源(CPU及びGPU)をそれぞれどれだけ割り当てるかを示す情報を出力する。これにより、資源割当部112は、決定された(変更された)割当資源量で、各解析処理に計算資源を割り当てる。これにより、各解析処理に割り当てられる仮想CPUコア数の比がCPUによる処理必要時間の比に対応するように変更されるので、処理待ちの時間が低減され得る。したがって、スループットが向上し得る。
 なお、GPUが複数ある場合、全てのGPUが割り当てられるまで、S204~S210の処理が繰り返されてもよい。この場合、例えばGPUの数が3個であるとき、S204~S210の処理が3回繰り返される。あるいは、全てのGPUが、S206の処理で割り当てられるようにしてもよい。
<第1の具体例>
 上述した実施の形態2に係る処理を、具体的な数値を用いて説明する。ここで、顔解析処理のフレーム処理時間をTif=202msec、人体解析処理のフレーム処理時間をTib=1001msecとする。また、閾値Tth1=200msecとする。また、顔解析処理の平均対象物数をM=16個、人体解析処理の平均対象物数をN=8個とする。また、顔解析処理の対象物処理時間をTfc=50msec/個、人体解析処理の対象物処理時間をTbc=250msec/個とする。したがって、図5に示したS102~S116の処理の具体例については、上述した実施の形態1の具体例と同じであるので、説明を省略する。
 アクセラレータ割当決定部242は、顔解析処理の対象物(顔)1つあたりの割当資源量を、Rc_f/M=2/16=1/8と算出する。同様に、アクセラレータ割当決定部242は、人体解析処理の対象物(人体)1つあたりの割当資源量を、Rc_b/N=4/8=1/2と算出する。したがって、1/8<1/2であるので、アクセラレータ割当決定部242は、人体解析処理を選択する(S204)。したがって、アクセラレータ割当決定部242は、人体解析処理にGPUを割り当てる(S206)。なお、このことと同義であるが、アクセラレータ割当決定部242は、Tfc(=50)<Tbc(=250)であるから、対象物処理時間が長い人体解析処理に対してGPUを割り当てると決定する(S204,206)。
 また、GPUによる顔解析処理の対象物処理時間をTfg=25msec/個、GPUによる人体解析処理の対象物処理時間をTbg=31msec/個とする。アクセラレータ割当決定部242は、人体解析処理に関するCPU換算数を、Tbc/Tbg[CPU/GPU]=250/31≒8[CPU/GPU]と算出する。そして、Tbc/Tbg≒8≧8(=N)であるから、アクセラレータ割当決定部242は、GPUが割り当てられた人体解析処理を、CPUの割り当て対象から除外する(S208)。また、割当変更部240は、人体解析処理にCPUを割り当てないので、顔解析処理に全てのCPUコアを割り当てると決定する。つまり、割当変更部240は、顔解析処理に、6個のCPUコアを割り当てると決定する(S210)。
 この場合、割り当て変更後の1フレーム画像あたりの顔解析処理の処理時間は、Tfc×M/Rv_f=50×16/6≒100[msec]となる。また、割り当て変更後の1フレーム画像あたりの人体解析処理の処理時間は、Tbc×N/Rv_b=250×8/8≒250[msec]となる。なお、このことは、GPUについて、Tbg×N/(割り当てられるGPUの個数)=31×8/1=248≒250を算出することと同義である。したがって、処理待ちの時間は250-100=150msecとなり、割り当て変更後のスループットは、1000msec/max[100msec,250msec]≒4フレーム/秒となる。一方、割り当て変更前のスループットは、1000msec/max[202msec,1001msec]≒1フレーム/秒となる。したがって、割り当ての変更処理を行うことによって、スループットが向上していることが分かる。
 なお、上述したように、特許文献1の技術では、対象物の数が計算資源の負荷に対応している。したがって、特許文献1の技術を上述した具体例に適用すると、顔解析処理の平均対象物数(16個)の方が人体解析処理の平均対象物数(8個)よりも多いので、人体解析処理ではなく顔解析処理の方にGPUを割り当ててしまう。しかしながら、上述したように、処理必要時間は人体解析処理の方が顔解析処理よりも長い。したがって、特許文献1の技術では、同一のフレーム画像の解析処理について、顔解析処理が人体解析処理よりもはるかに早く終了してしまい、人体解析処理が終了するまでに長い処理待ちが発生し、スループットを向上させることができないおそれがある。これに対し、実施の形態2では、上述したように、スループットを向上させることが可能となる。
<第2の具体例>
 次に、第2の具体例について説明する。第2の具体例では、S208の処理で人体解析処理をCPU割り当て対象から除外しない例について説明する。ここで、M=16、N=16とする。なお、Tfc=50msec/個、Tbc=250msec/個、Tfg=25msec/個、Tbg=31msec/個とする。この場合、CPU割当決定部142は、顔解析処理の処理必要時間を、Tfc×M=50×16=800[msec]と算出する(S24)。また、CPU割当決定部142は、人体解析処理の処理必要時間を、Tbc×N=250×16=4000[msec]と算出する(S24)。また、CPU割当決定部142は、処理必要時間の比を、Tfc×M:Tbc×N=800:4000=1:5と算出する。
 CPU割当決定部142は、顔解析処理に割り当てられるCPU資源量を、Rc_f=Rc×(Tfc×M)/(Tfc×M+Tbc×N)=6×(1/(1+5))=1[個]と算出する。また、CPU割当決定部142は、人体解析処理に割り当てられる資源量を、Rc_b=Rc×(Tbc×N)/(Tfc×M+Tbc×N)=6×(5/(1+5))=5[個]と算出する。
 アクセラレータ割当決定部242は、顔解析処理の対象物(顔)1つあたりの割当資源量を、Rc_f/M=1/16と算出する。同様に、アクセラレータ割当決定部242は、人体解析処理の対象物(人体)1つあたりの割当資源量を、Rc_b/N=5/16と算出する。したがって、1/16<5/16であるので、アクセラレータ割当決定部242は、人体解析処理を選択する(S204)。したがって、アクセラレータ割当決定部242は、人体解析処理にGPUを割り当てる(S206)。
 アクセラレータ割当決定部242は、人体解析処理に関するCPU換算数を、Tbc/Tbg[CPU/GPU]=250/31≒8[CPU/GPU]と算出する。そして、Tbc/Tbg≒8<16(=N)であるから、アクセラレータ割当決定部242は、GPUが割り当てられた人体解析処理を、CPUの割り当て対象から除外しない(S208)。
 このとき、割当変更部240は、仮想CPUコア総数Rvを、Rv=Rc+(Tbc/Tbg)=6+(250/31)≒6+8=14と算出する。割当変更部240は、顔解析処理に割り当てられる仮想CPUコア数を、Rv_f=Rv×(Tfc×M)/(Tfc×M+Tbc×N)=14×(1/(1+5))≒2と算出する。ここで、顔解析処理にはGPUが割り当てられないので、割当変更部240は、顔解析処理に、2個のCPUコアを割り当てられると決定する(S210)。また、割当変更部240は、人体解析処理に割り当てられる仮想CPUコア数を、Rv_b=Rv×(Tbc×N)/(Tfc×M+Tbc×N)=14×(5/(1+5))≒12と算出する。ここで、人体解析処理には1個のGPUが割り当てられ、Tbc/Tbg[CPU/GPU]=8個であるので、1個のGPUはCPUコアの8個分に対応する。したがって、割当変更部240は、人体解析処理に、1個のGPUと、4個(=12-8)のCPUコアを割り当てると決定する。
 この場合、割り当て変更後の1フレーム画像あたりの顔解析処理の処理時間は、Tfc×M/Rv_f=50×16/2≒400[msec]となる。また、割り当て変更後の1フレーム画像あたりの人体解析処理の処理時間は、Tbc×N/Rv_b=250×8/12≒170[msec]となる。したがって、処理待ちの時間は400-170=230msecとなり、割り当て変更後のスループットは、1000msec/max[400msec,170msec]=2.5フレーム/秒となる。一方、割り当て変更前のスループットは、1000msec/max[202msec,1001msec]≒1フレーム/秒となる。したがって、割り当ての変更処理を行うことによって、スループットが向上していることが分かる。
(変形例)
 なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。例えば、図5等に示したフローチャートの各処理の順序は、適宜、変更可能である。
 上述の例において、プログラムは、様々なタイプの非一時的なコンピュータ可読媒体(non-transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えばフレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば光磁気ディスク)、CD-ROM(Read Only Memory)、CD-R、CD-R/W、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュROM、RAM(Random Access Memory))を含む。また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(transitory computer readable medium)によってコンピュータに供給されてもよい。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバ等の有線通信路、又は無線通信路を介して、プログラムをコンピュータに供給できる。
 以上、実施の形態を参照して本願発明を説明したが、本願発明は上記によって限定されるものではない。本願発明の構成や詳細には、発明のスコープ内で当業者が理解し得る様々な変更をすることができる。
 上記の実施形態の一部又は全部は、以下の付記のようにも記載されうるが、以下には限られない。
 (付記1)
 画像に含まれる複数の種類の対象物ごとに解析処理を並行して実行する解析実行手段と、
 複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる資源割当手段と、
 同一の前記画像の全体に対する複数の前記解析処理それぞれの処理開始時刻から処理終了時刻までの期間である第1の処理時間を算出する算出手段と、
 複数の前記解析処理の間の前記第1の処理時間の差が予め定められた閾値以上となったときに、前記第1の処理時間の差が小さくなるように前記計算資源の割り当ての変更処理を行う割当変更手段と、
 を有し、
 前記資源割当手段は、前記割当変更手段による前記変更処理に応じて、複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる、
 画像処理装置。
 (付記2)
 前記割当変更手段は、複数の前記解析処理それぞれによって1つの画像あたりの検出された対象物の数と、複数の前記解析処理それぞれによる対象物の1つあたりの処理時間である第2の処理時間とに基づいて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
 付記1に記載の画像処理装置。
 (付記3)
 前記割当変更手段は、複数の前記解析処理それぞれについて、前記対象物の数と前記第2の処理時間とを用いて算出された、1つの画像に対する前記解析処理それぞれに必要な処理時間である第3の処理時間に基づいて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
 付記2に記載の画像処理装置。
 (付記4)
 前記割当変更手段は、複数の前記解析処理に関する前記第3の処理時間の比に応じて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
 付記3に記載の画像処理装置。
 (付記5)
 複数の前記計算資源は、少なくとも1つの第1の計算資源と、前記第1の計算資源よりも処理能力が高い少なくとも1つの第2の計算資源とを含み、
 前記割当変更手段は、前記第1の計算資源及び前記第2の計算資源の割り当てを決定する、
 付記1から4のいずれか1項に記載の画像処理装置。
 (付記6)
 前記割当変更手段は、複数の前記解析処理のうち、前記第1の計算資源を用いて行った複数の前記解析処理それぞれによる対象物の1つあたりの処理時間である第2の処理時間が長い前記解析処理に対して、前記第2の計算資源を割り当てると決定する、
 付記5に記載の画像処理装置。
 (付記7)
 前記割当変更手段は、前記第2の計算資源の量を前記第1の計算資源の量に仮想的に換算した換算資源量と前記第1の計算資源の量との合計と、複数の前記解析処理それぞれについて前記対象物の数と前記第2の処理時間とを用いて算出された1つの画像に対する複数の前記解析処理それぞれに必要な処理時間である第3の処理時間とに基づいて、複数の前記解析処理それぞれに割り当てる前記第1の計算資源の量を決定する、
 付記6に記載の画像処理装置。
 (付記8)
 前記割当変更手段は、前記換算資源量に対応する数が前記第2の計算資源を割り当てると決定された前記解析処理に対応する対象物の数以上となる場合に、当該解析処理に前記第1の計算資源を割り当てないと決定する、
 付記7に記載の画像処理装置。
 (付記9)
 画像に含まれる複数の種類の対象物ごとに実行される解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当て、
 前記複数の種類の対象物ごとに解析処理を並行して実行し、
 同一の前記画像の全体に対する複数の対象物の前記解析処理それぞれの処理開始時刻から処理終了時刻までの期間である第1の処理時間を算出し、
 複数の前記解析処理の間の前記第1の処理時間の差が予め定められた閾値以上となったときに、前記第1の処理時間の差が小さくなるように前記計算資源の割り当ての変更処理を行い、
 前記変更処理に応じて、複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる、
 画像処理方法。
 (付記10)
 複数の前記解析処理それぞれによって1つの画像あたりの検出された対象物の数と、複数の前記解析処理それぞれによる対象物の1つあたりの処理時間である第2の処理時間とに基づいて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
 付記9に記載の画像処理方法。
 (付記11)
 複数の前記解析処理それぞれについて、前記対象物の数と前記第2の処理時間とを用いて算出された、1つの画像に対する前記解析処理それぞれに必要な処理時間である第3の処理時間に基づいて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
 付記10に記載の画像処理方法。
 (付記12)
 複数の前記解析処理に関する前記第3の処理時間の比に応じて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
 付記11に記載の画像処理方法。
 (付記13)
 複数の前記計算資源は、少なくとも1つの第1の計算資源と、前記第1の計算資源よりも処理能力が高い少なくとも1つの第2の計算資源とを含み、
 前記第1の計算資源及び前記第2の計算資源の割り当てを決定する、
 付記9から12のいずれか1項に記載の画像処理方法。
 (付記14)
 複数の前記解析処理のうち、前記第1の計算資源を用いて行った複数の前記解析処理それぞれによる対象物の1つあたりの処理時間である第2の処理時間が長い前記解析処理に対して、前記第2の計算資源を割り当てると決定する、
 付記13に記載の画像処理方法。
 (付記15)
 前記第2の計算資源の量を前記第1の計算資源の量に仮想的に換算した換算資源量と前記第1の計算資源の量との合計と、複数の前記解析処理それぞれについて前記対象物の数と前記第2の処理時間とを用いて算出された1つの画像に対する複数の前記解析処理それぞれに必要な処理時間である第3の処理時間とに基づいて、複数の前記解析処理それぞれに割り当てる前記第1の計算資源の量を決定する、
 付記14に記載の画像処理方法。
 (付記16)
 前記換算資源量に対応する数が前記第2の計算資源を割り当てると決定された前記解析処理に対応する対象物の数以上となる場合に、当該解析処理に前記第1の計算資源を割り当てないと決定する、
 付記15に記載の画像処理方法。
 (付記17)
 画像に含まれる複数の種類の対象物ごとに実行される解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てるステップと、
 前記複数の種類の対象物ごとに解析処理を並行して実行するステップと、
 同一の前記画像の全体に対する複数の対象物の前記解析処理それぞれの処理開始時刻から処理終了時刻までの期間である第1の処理時間を算出するステップと、
 複数の前記解析処理の間の前記第1の処理時間の差が予め定められた閾値以上となったときに、前記第1の処理時間の差が小さくなるように前記計算資源の割り当ての変更処理を行うステップと、
 前記変更処理に応じて、複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てるステップと、
 をコンピュータに実行させるプログラムが格納された非一時的なコンピュータ可読媒体。
1 画像処理装置
2 解析実行部
4 資源割当部
6 算出部
8 割当変更部
20 画像処理システム
30 撮像装置
100 画像処理装置
102 制御部
104 記憶部
106 通信部
108 インタフェース部
110 画像取得部
112 資源割当部
120 解析実行部
122 顔解析実行部
124 人体解析実行部
130 解析状況監視部
132 画像処理時間算出部
134 割当変更判定部
136 対象物情報算出部
140 割当変更部
142 CPU割当決定部
240 割当変更部
242 アクセラレータ割当決定部

Claims (17)

  1.  画像に含まれる複数の種類の対象物ごとに解析処理を並行して実行する解析実行手段と、
     複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる資源割当手段と、
     同一の前記画像の全体に対する複数の前記解析処理それぞれの処理開始時刻から処理終了時刻までの期間である第1の処理時間を算出する算出手段と、
     複数の前記解析処理の間の前記第1の処理時間の差が予め定められた閾値以上となったときに、前記第1の処理時間の差が小さくなるように前記計算資源の割り当ての変更処理を行う割当変更手段と、
     を有し、
     前記資源割当手段は、前記割当変更手段による前記変更処理に応じて、複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる、
     画像処理装置。
  2.  前記割当変更手段は、複数の前記解析処理それぞれによって1つの画像あたりの検出された対象物の数と、複数の前記解析処理それぞれによる対象物の1つあたりの処理時間である第2の処理時間とに基づいて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
     請求項1に記載の画像処理装置。
  3.  前記割当変更手段は、複数の前記解析処理それぞれについて、前記対象物の数と前記第2の処理時間とを用いて算出された、1つの画像に対する前記解析処理それぞれに必要な処理時間である第3の処理時間に基づいて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
     請求項2に記載の画像処理装置。
  4.  前記割当変更手段は、複数の前記解析処理に関する前記第3の処理時間の比に応じて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
     請求項3に記載の画像処理装置。
  5.  複数の前記計算資源は、少なくとも1つの第1の計算資源と、前記第1の計算資源よりも処理能力が高い少なくとも1つの第2の計算資源とを含み、
     前記割当変更手段は、前記第1の計算資源及び前記第2の計算資源の割り当てを決定する、
     請求項1から4のいずれか1項に記載の画像処理装置。
  6.  前記割当変更手段は、複数の前記解析処理のうち、前記第1の計算資源を用いて行った複数の前記解析処理それぞれによる対象物の1つあたりの処理時間である第2の処理時間が長い前記解析処理に対して、前記第2の計算資源を割り当てると決定する、
     請求項5に記載の画像処理装置。
  7.  前記割当変更手段は、前記第2の計算資源の量を前記第1の計算資源の量に仮想的に換算した換算資源量と前記第1の計算資源の量との合計と、複数の前記解析処理それぞれについて前記対象物の数と前記第2の処理時間とを用いて算出された1つの画像に対する複数の前記解析処理それぞれに必要な処理時間である第3の処理時間とに基づいて、複数の前記解析処理それぞれに割り当てる前記第1の計算資源の量を決定する、
     請求項6に記載の画像処理装置。
  8.  前記割当変更手段は、前記換算資源量に対応する数が前記第2の計算資源を割り当てると決定された前記解析処理に対応する対象物の数以上となる場合に、当該解析処理に前記第1の計算資源を割り当てないと決定する、
     請求項7に記載の画像処理装置。
  9.  画像に含まれる複数の種類の対象物ごとに実行される解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当て、
     前記複数の種類の対象物ごとに解析処理を並行して実行し、
     同一の前記画像の全体に対する複数の対象物の前記解析処理それぞれの処理開始時刻から処理終了時刻までの期間である第1の処理時間を算出し、
     複数の前記解析処理の間の前記第1の処理時間の差が予め定められた閾値以上となったときに、前記第1の処理時間の差が小さくなるように前記計算資源の割り当ての変更処理を行い、
     前記変更処理に応じて、複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てる、
     画像処理方法。
  10.  複数の前記解析処理それぞれによって1つの画像あたりの検出された対象物の数と、複数の前記解析処理それぞれによる対象物の1つあたりの処理時間である第2の処理時間とに基づいて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
     請求項9に記載の画像処理方法。
  11.  複数の前記解析処理それぞれについて、前記対象物の数と前記第2の処理時間とを用いて算出された、1つの画像に対する前記解析処理それぞれに必要な処理時間である第3の処理時間に基づいて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
     請求項10に記載の画像処理方法。
  12.  複数の前記解析処理に関する前記第3の処理時間の比に応じて、複数の前記解析処理それぞれに割り当てる前記計算資源の量を決定する、
     請求項11に記載の画像処理方法。
  13.  複数の前記計算資源は、少なくとも1つの第1の計算資源と、前記第1の計算資源よりも処理能力が高い少なくとも1つの第2の計算資源とを含み、
     前記第1の計算資源及び前記第2の計算資源の割り当てを決定する、
     請求項9から12のいずれか1項に記載の画像処理方法。
  14.  複数の前記解析処理のうち、前記第1の計算資源を用いて行った複数の前記解析処理それぞれによる対象物の1つあたりの処理時間である第2の処理時間が長い前記解析処理に対して、前記第2の計算資源を割り当てると決定する、
     請求項13に記載の画像処理方法。
  15.  前記第2の計算資源の量を前記第1の計算資源の量に仮想的に換算した換算資源量と前記第1の計算資源の量との合計と、複数の前記解析処理それぞれについて前記対象物の数と前記第2の処理時間とを用いて算出された1つの画像に対する複数の前記解析処理それぞれに必要な処理時間である第3の処理時間とに基づいて、複数の前記解析処理それぞれに割り当てる前記第1の計算資源の量を決定する、
     請求項14に記載の画像処理方法。
  16.  前記換算資源量に対応する数が前記第2の計算資源を割り当てると決定された前記解析処理に対応する対象物の数以上となる場合に、当該解析処理に前記第1の計算資源を割り当てないと決定する、
     請求項15に記載の画像処理方法。
  17.  画像に含まれる複数の種類の対象物ごとに実行される解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てるステップと、
     前記複数の種類の対象物ごとに解析処理を並行して実行するステップと、
     同一の前記画像の全体に対する複数の対象物の前記解析処理それぞれの処理開始時刻から処理終了時刻までの期間である第1の処理時間を算出するステップと、
     複数の前記解析処理の間の前記第1の処理時間の差が予め定められた閾値以上となったときに、前記第1の処理時間の差が小さくなるように前記計算資源の割り当ての変更処理を行うステップと、
     前記変更処理に応じて、複数の前記解析処理それぞれに対して複数の計算資源の少なくとも1つを割り当てるステップと、
     をコンピュータに実行させるプログラムが格納された非一時的なコンピュータ可読媒体。
PCT/JP2020/037653 2020-10-02 2020-10-02 画像処理装置、画像処理方法及びコンピュータ可読媒体 WO2022070427A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP2020/037653 WO2022070427A1 (ja) 2020-10-02 2020-10-02 画像処理装置、画像処理方法及びコンピュータ可読媒体
JP2022553416A JPWO2022070427A5 (ja) 2020-10-02 画像処理装置、画像処理方法及びプログラム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2020/037653 WO2022070427A1 (ja) 2020-10-02 2020-10-02 画像処理装置、画像処理方法及びコンピュータ可読媒体

Publications (1)

Publication Number Publication Date
WO2022070427A1 true WO2022070427A1 (ja) 2022-04-07

Family

ID=80950434

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/037653 WO2022070427A1 (ja) 2020-10-02 2020-10-02 画像処理装置、画像処理方法及びコンピュータ可読媒体

Country Status (1)

Country Link
WO (1) WO2022070427A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011242898A (ja) * 2010-05-14 2011-12-01 Canon Inc データ処理装置及びデータ処理方法
JP2016207076A (ja) * 2015-04-27 2016-12-08 富士通株式会社 並列計算機、スレッド再割当判定方法及びスレッド再割当判定プログラム
WO2018097058A1 (ja) * 2016-11-22 2018-05-31 日本電気株式会社 解析ノード、リソース管理方法およびプログラム記録媒体

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011242898A (ja) * 2010-05-14 2011-12-01 Canon Inc データ処理装置及びデータ処理方法
JP2016207076A (ja) * 2015-04-27 2016-12-08 富士通株式会社 並列計算機、スレッド再割当判定方法及びスレッド再割当判定プログラム
WO2018097058A1 (ja) * 2016-11-22 2018-05-31 日本電気株式会社 解析ノード、リソース管理方法およびプログラム記録媒体

Also Published As

Publication number Publication date
JPWO2022070427A1 (ja) 2022-04-07

Similar Documents

Publication Publication Date Title
KR102315574B1 (ko) 데이터 분류 방법 및 장치와 관심영역 세그멘테이션 방법 및 장치
KR101780676B1 (ko) 트레이닝 이미지를 이용하여 분류 트리를 구성함으로써 rejector를 학습하고 상기 rejector를 이용하여 테스트 이미지 상의 객체를 검출하는 방법
JP7121353B2 (ja) 映像解析装置、映像解析方法、および映像解析プログラム
CN113780466A (zh) 模型迭代优化方法、装置、电子设备和可读存储介质
JP6981555B2 (ja) 群集推定手法の性能モデリング方法、システム、及びプログラム
CN111937003A (zh) 用于人群估计技术的集成和自动切换的方法、系统和计算机可读介质
US10691956B2 (en) Information processing apparatus, information processing system, information processing method, and storage medium having determination areas corresponding to waiting line
KR102191722B1 (ko) 딥러닝 모델의 취약점 판단 장치 및 방법
CN114937246B (zh) 一种行人识别方法、电子设备及存储介质
CN115829006A (zh) 神经网络模型的编译方法、装置、电子设备和存储介质
CN113850285A (zh) 基于边缘计算的输电线路缺陷识别方法及系统
KR102325629B1 (ko) 이상 탐지 방법 및 이상 탐지 장치
WO2022070427A1 (ja) 画像処理装置、画像処理方法及びコンピュータ可読媒体
EP3605338A1 (en) Apparatus, program, & computer-implemented image processing method for predicting execution performance metrics
US20180150382A1 (en) Determining similarities in computer software codes for performance analysis
JP2019159391A (ja) 物体検出装置、物体検出方法、およびプログラム
EP3293682A1 (en) Method and device for analyzing sensor data
KR102628058B1 (ko) 관심 영역 검출 방법 및 그 장치
KR102018443B1 (ko) 네트워크 침입 탐지 시스템 및 방법, 이를 수행하기 위한 기록매체
JP2020087463A (ja) 検出装置及び方法、画像処理装置及びシステム、並びに記憶媒体
KR20200067044A (ko) 악성 파일 탐지 방법 및 장치
JP5686548B2 (ja) 情報処理装置、情報処理方法、プログラム
JP7491379B2 (ja) データ処理装置およびデータ処理方法
KR102245896B1 (ko) 인공 지능 모형 기반의 어노테이션 데이터 검증 방법 및 그 시스템
CN111737371B (zh) 可动态预测的数据流量检测分类方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20956355

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022553416

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20956355

Country of ref document: EP

Kind code of ref document: A1