Image processing device, image processing method, and program
The image processing device maintains subject tracking by detecting and associating body parts across frames, allowing continuous focus on the same subject even when the primary tracking area is lost, using head or torso regions to ensure consistent tracking.
Patent Information
- Application Number
- JP2020061374
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-03-30
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2040-03-30
AI Technical Summary
Existing image processing systems struggle to maintain tracking of a subject in a video when multiple subjects are present, leading to the loss of the tracking target and subsequent switching to areas with higher evaluation values of other subjects.
An image processing device that detects multiple body parts of a subject in a video, associates these parts across frames, and uses tracking regions based on detected body parts to maintain focus on the same subject even if the initial tracking area is lost.
Enables continuous tracking of the same subject by switching to alternative body parts like the head or torso, ensuring the subject remains in focus despite temporary loss of the primary tracking area.
Smart Images

Figure 0007566481000001 
Figure 0007566481000002 
Figure 0007566481000003
Abstract
Description
[Technical field]
[0001] The present invention relates to an image processing device, an image processing method, and a program. [Background technology]
[0002] Conventionally, a subject in a video is tracked continuously in order to continuously focus an imaging device on the subject. For example, a face area in a video detected by face detection is set as a tracking target, and the face is continuously focused on. Also, a technology has been proposed in which multiple subject areas are detected from a video, an area near the center of the video is highly evaluated, and the area with a high evaluation value is tracked (see, for example, Patent Document 1). This makes it possible to continuously focus the imaging device on the subject. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2019-134438 A Summary of the Invention [Problem to be solved by the invention]
[0004] However, when multiple subjects are present in a video, if the area targeted by the subject being tracked is lost, the tracking target is switched to the area of another subject with a higher evaluation value, even if another area of the same subject is present in the video. Therefore, the present invention aims to provide an image processing device that makes it possible to continue tracking the same subject even if the area targeted by the subject being tracked cannot be found. [Means for solving the problem]
[0005] The image processing device according to the present invention includes a region detection unit that detects a plurality of part regions corresponding to a plurality of parts of a subject in a video, and a processing unit that converts the plurality of part regions detected by the region detection unit into a plurality of part regions corresponding to a plurality of parts of the subject. Every Correspond to ,centre The part area not detected in the frame image is the part area detected from the same subject in the previous frame image. and and a tracking means for setting a tracking area based on the plurality of part areas detected by the area detection means and tracking a predetermined subject, the tracking means tracking the object set in the tracking area. Tracking In the area In the current frame image The predetermined subject can be tracked. First, a region to be associated with the tracking region in the current frame image is Other part areas of the predetermined subject is not detected in the frame image immediately preceding the current frame image, if the matching means successfully matches the other part area with the part area in the past frame image that the area matching means has matched with the tracking part area in the immediately preceding frame image, the other part area is The present invention is characterized in that the predetermined subject is tracked by the camera. Effect of the Invention
[0006] According to the present invention, even if the tracking target area of the subject being tracked cannot be found in the current frame and tracking fails, it is possible to continue tracking the same subject. [Brief description of the drawings]
[0007] [Figure 1] FIG. 1 is a diagram illustrating an example of the configuration of an imaging device according to an embodiment of the present invention. [Diagram 2] 5 is a flowchart illustrating an example of a tracking process in the present embodiment. [Diagram 3] 5 is a flowchart illustrating an example of a tracking process in the present embodiment. [Figure 4] 11A to 11C are diagrams illustrating an example of region matching processing in the present embodiment. [Diagram 5] 11A to 11C are diagrams illustrating an example of processing by a region matching unit in the present embodiment. [Figure 6] 11A to 11C are diagrams illustrating an example of processing by an estimated area matching unit in the present embodiment. [Figure 7] 5A to 5C are diagrams illustrating an example of tracking AF processing in the present embodiment. [Figure 8]11A to 11C are diagrams illustrating an example of region matching processing in the present embodiment. [Figure 9] 11A to 11C are diagrams illustrating an example of processing by an estimated area matching unit in the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
[0009] (Embodiment 1) 1(a) is a block diagram showing an example of the configuration of an image capture device 100 to which an image processing device according to this embodiment is applied. The image capture device 100 includes a control unit 101, a ROM 102, a RAM 103, an external storage unit 104, a control key 105, an image capture unit 106, a display unit 107, a communication unit 108, a focusing unit 109, a clock unit 110, and a system bus 111. The control unit 101, the ROM 102, the RAM 103, the external storage unit 104, the control key 105, the image capture unit 106, the display unit 107, the communication unit 108, the focusing unit 109, and the clock unit 110 are communicatively connected via the system bus 111.
[0010] The control unit 101 controls the entire imaging device 100. The ROM (Read Only Memory) 102 is a memory for storing programs and data (parameters, etc.) that do not require modification. The RAM (Random Access Memory) 103 is a memory for temporarily storing working data for the control unit 101, data supplied from an external storage unit 104, etc.
[0011] The external storage unit 104 is a storage device such as a hard disk or a memory card that is fixedly installed in the imaging device 100. The external storage unit 104 may include an optical disk such as a Compact Disk (CD) or a memory card that is detachable from the imaging device 100. The control keys 105 are control keys such as a power button and an imaging button that are operated by the user. The shooting button can be pressed halfway, for example.
[0012] The imaging unit 106 converts light collected through a lens or the like into an electrical signal using an imaging element (image sensor) such as a CCD or CMOS, and creates image data by further performing image processing. The display unit 107 displays the image data captured by the imaging unit 106. The communication unit 108 transmits and receives data to and from external devices using a communication method such as WiFi (registered trademark) or Bluetooth (registered trademark).
[0013] The focusing unit 109 performs autofocus (AF) using a tracking area described later so that an image in the tracking area is focused. The autofocus may use a method such as phase difference AF or contrast AF, but is not limited to these. The clock unit 110a measures time and manages the current time.
[0014] In this embodiment, a program code for implementing the tracking process is stored in the ROM 102 or the external storage unit 104, and the control unit 101 reads out and executes the program code to implement the function of an image processing device that implements the tracking process. The configuration of the image processing device implemented in the imaging device in this embodiment will be described with reference to FIG. 1(b). FIG. 1(b) is a block diagram showing an example of the configuration of the image processing device in this embodiment. The image processing device in this embodiment has an area detection unit 121, an area association unit 124, and a tracking unit 125.
[0015] The area detection unit 121 detects body part areas of a subject in a video. The area detection unit 121 has a head detection unit 122 and a torso detection unit 123. The head detection unit 122 detects the head of a person in the video as a body part area of the subject. For example, the head detection unit 122 detects the head, such as the face or the back of the head, from the image. The torso detection unit 123 detects the torso of a person in the video as a body part area of the subject. For example, the torso detection unit 123 detects the torso, such as the waist, chest, or back, of a person from the image. Note that the methods and detected parts of the head and torso detection are not limited to these.
[0016] Furthermore, the torso detection unit 123 outputs position information of the head corresponding to the torso (estimated head position). Specifically, the torso detection unit 123 estimates and outputs the central coordinates of the head region of the person whose torso has been detected. In this embodiment, the region is output as a rectangle, so the central coordinates are the intersection of diagonals. Note that the head estimated position output by the torso detection unit 123 is not limited to this, and may be, for example, coordinates included in the head region that are not the central coordinates. Alternatively, it may be a region included in the head region, or a region that shares part of the head region, etc.
[0017] The results of head detection and torso detection by the area detection unit 121 are output, for example, as shown in Fig. 5(a). The head detection unit 122 outputs a head area 501a, and the torso detection unit 123 outputs a torso area 503a and an estimated head position 502a.
[0018] The region association unit 124 associates other regions of the same subject with the tracking region. For example, when the head is the tracking region, the region association unit 124 associates a body region including head position information (head estimated position) with the head. If there is no body region associated with the head, the region association unit 124 associates a body region that has been associated with a previous tracking region of the same head. Details of the region association process by the region association unit 124 will be described later with reference to FIG. 4(a).
[0019] The tracking unit 125 sets a tracking area for each frame. The tracking unit 125 obtains a corresponding area of the current frame based on the tracking area of the previous frame, and sets the area as the tracking area of the current frame. If the tracking unit 125 is unable to track the head while tracking the head, it switches the tracking area to the body and continues tracking. If the tracking unit 125 detects the head while tracking the body, it switches the tracking area to the head. Details of the head tracking process by the tracking unit 125 will be described later using FIG. 3(a). Details of the body tracking process by the tracking unit 125 will be described later using FIG. 3(b).
[0020] The tracking unit 125 has a detection area matching unit 126, an area search unit 127, and an estimated area matching unit 128 to obtain a tracking area of the current frame. The detection area matching unit 126 matches areas with each other. For example, the detection area matching unit 126 matches the tracking area of the previous frame with the area detected in the current frame, and determines that the areas correspond to each other if the similarity of the feature amounts is equal to or greater than a predetermined value, using color histograms, brightness histograms, and the like of both as feature amounts. In the case of a head area, facial organ positions and the like may be used for matching, and in the case of a torso area, joints and the like may be used for matching. For example, the detection area matching unit 126 may use image feature amounts of the peripheral areas of the facial organ positions and joint positions to match whether the feature amounts of the same organs or joints are similar. The method of matching the detection areas is not limited to these.
[0021] The region search unit 127 searches for the specified region from within the entire image, etc. For example, the region search unit 127 searches for where the tracking region of the previous frame appears in the current frame by template matching using the tracking region as a template. Note that the range to be searched may be the entire image, or may be limited to the vicinity of the tracking region. Also, the order of search may start from the vicinity of the tracking region. The method of region search is not limited to these.
[0022] The estimated region matching unit 128 searches for the head region in another frame using the estimated head position. Specifically, the estimated region matching unit 128 matches the estimated head position with the head region in another frame. For example, the estimated region matching unit 128 matches the estimated head position 602b in the previous frame with the head region 603b in the current frame as shown in FIG. 6(b). Alternatively, the estimated region matching unit 128 matches the estimated head position 602a in the current frame with the head region 601a in the previous frame as shown in FIG. 6(a). As a matching method, for example, the head region is used as a template and a search is performed with the estimated head position as the center. Specifically, a predetermined rectangular range is cut out with the estimated head position as the center, and the rectangular range is searched. Alternatively, the search order may be changed to search the entire image starting from the head center position.
[0023] Furthermore, the estimated region matching unit 128 may generate a region from the estimated head position, or if the estimated head position is obtained as a region, match both regions. Alternatively, if the region of the estimated head position is included in the head region, the region of the estimated head position may be used as a template to perform a search centered on the head region. Conversely, if the region of the estimated head position includes the head region, the head region may be used as a template to search within the estimated head region by template matching.
[0024] In the above, it is assumed that one head region is matched with the head estimated position, but there may be a case where multiple head regions are matched. In this case, the estimated region matching unit 128 repeatedly applies any of the above-mentioned processes to each head region, and adopts the result of the head region with the highest similarity. Note that the method of matching the head estimated position with the head region is not limited to these.
[0025] Furthermore, when there is no head region to be matched, the estimated region matching unit 128 searches for the head in another frame using the head estimated position. For example, the estimated region matching unit 128 searches for the head in the current frame using the head estimated position 601c in the previous frame as shown in FIG. 6(c) as an example. Alternatively, the head may be searched for in the previous frame using the head estimated position in the current frame. Here, the region searching unit 127 may be used for these searches. For example, a region may be generated from the head estimated position, or when the head estimated position is obtained as a region, the region of the head estimated position is searched for as a template. A partial region of the region of the head estimated position may be used as the template. Alternatively, a region including the region of the head estimated position may be used as the template. The method of searching using the head estimated position is not limited to these.
[0026] [AF Tracking Processing] The tracking AF process in this embodiment will be described with reference to Fig. 2(a). Fig. 2(a) is a flow chart showing an example of the tracking AF process in this embodiment. The tracking AF process is applied to each frame image obtained from the imaging unit 106 while the imaging button of the control key 105 is half-pressed. Hereinafter, the frame image to be processed is referred to as the current frame. When this process is started, information on the tracking area and its type (head or torso) set in the previous frame is also passed to this process. Information on the frame image and tracking area, etc. is stored in RAM 103 and passed to this process.
[0027] When the tracking AF process is started, in step S201, the head detection section 122 of the area detection section 121 performs head detection processing on the current frame. In addition, in step S202, the body detection section 123 of the area detection section 121 performs body detection processing on the current frame. Note that the processing order of steps S201 and S202 is not limited, and the head detection process may be performed after the body detection process. Also, the head detection process and the body detection process may be performed in parallel.
[0028] In step S203, the tracking unit 125 determines whether or not tracking is in progress. If the tracking unit 125 determines that tracking is not in progress, the process proceeds to step S204. If the tracking unit 125 determines that tracking is in progress, the process proceeds to step S205 if the tracking area is the head, and proceeds to step S206 if the tracking area is the torso. In steps S204 to S206, the tracking area is set for each current frame. Alternatively, if tracking has failed, a tracking interruption flag is set.
[0029] In step S204, the tracking unit 125 performs a tracking start process. In the tracking start process, the tracking unit 125 sets the head or torso located near the center of the current frame as an initial tracking region. Details of the tracking start process will be described later with reference to the flowchart shown in FIG. 2(b).
[0030] In step S205, the tracking unit 125 performs head tracking processing. In the head tracking processing, if the head being tracked is also present in the current frame, the tracking unit 125 continues to track the head. If the head being tracked cannot be found in the current frame, the tracking unit 125 performs processing such as switching the tracking region to the body corresponding to the head being tracked. Details of the head tracking processing will be described later using the flowchart shown in FIG. 3(a).
[0031] In step S206, the tracking unit 125 performs a body tracking process. In the body tracking process, if a head corresponding to the body being tracked appears in the current frame, the tracking unit 125 switches the tracking area to the head. If not, the tracking unit 125 continues tracking the body. Details of the body tracking process will be described later with reference to the flowchart shown in FIG. 3(b). After executing any one of the processes in steps S204 to S206, the process proceeds to step S207.
[0032] In step S207, the focusing unit 109 performs focusing control based on the tracking area of the current frame set in steps S204 to S206. However, when the tracking interruption flag is set, this process is skipped. In the focusing control, the focusing unit 109 performs autofocus using the tracking area so that the image in the tracking area is focused. It is not necessary to use all areas in the tracking area for focusing, and an area outside the tracking area may be used. The focusing method based on the tracking area is not limited to these.
[0033] Next, in step S208, the region matching unit 124 performs a region matching process. In the region matching process, the region matching unit 124 matches the tracking region of the current frame obtained in steps S204 to S206 with the region of another body part. That is, if the tracking region is a head region, the region matching unit 124 performs a process of matching the body region, and if the tracking region is a body region, the region matching unit 124 performs a process of matching the head region. Details of the region matching process will be described later with reference to the flowchart shown in FIG. 4(a).
[0034] Next, the tracking start process in step S204 shown in Fig. 2(a) will be described with reference to Fig. 2(b), which is a flowchart showing an example of the tracking start process in this embodiment.
[0035] In step S251, the tracking unit 125 determines whether or not a head region has been found in the current frame by the head detection process in step S201 in Fig. 2(a). If a head region has been detected, the tracking unit 125 proceeds to step S252, and if a head region has not been detected, the tracking unit 125 proceeds to step S253. In step S252, the tracking unit 125 sets the head region detected in the current frame as the tracking region. Note that if multiple head regions have been detected, the head region closest to the center of the frame is selected and set as the tracking region.
[0036] In step S253, the tracking unit 125 judges whether or not a body region has been found in the current frame by the body detection process in step S202 in FIG. 2(a). If a body region has been detected, the tracking unit 125 proceeds to step S254, and if a body region has not been detected, the tracking unit 125 proceeds to step S255. In step S254, the tracking unit 125 sets the body region detected in the current frame as the tracking region. Note that if multiple body regions have been detected, the body region closest to the center of the frame is selected and set as the tracking target. In step S255, the tracking unit 125 judges that there is no region to be tracked in the current frame and discontinues tracking. Specifically, a tracking discontinuation flag is set.
[0037] Next, the head tracking process in step S205 shown in Fig. 2(a) will be described with reference to Fig. 3(a). When the head is being tracked, the tracking region in the previous frame is called the tracked head. When the torso is being tracked, the tracking region in the previous frame is called the tracked torso. Fig. 3(a) is a flowchart showing an example of the head tracking process in this embodiment.
[0038] In step S301, the tracking unit 125 compares the head to be tracked with the head region of the current frame. If multiple head regions have been extracted from the current frame, each head region is compared with the head to be tracked, and the head region with the highest similarity is selected. This comparison in step S301 is performed by the detection region matching unit 126. If the head region corresponding to the head to be tracked is found (success), the tracking unit 125 proceeds to step S302, otherwise proceeds to step S303. In step S302, the tracking unit 125 sets the head region of the current frame corresponding to the head to be tracked obtained in step S301 as the tracking region of the current frame.
[0039] In step S303, the tracking unit 125 obtains a body region corresponding to the head to be tracked and compares it with the body region of the current frame. The body region corresponding to the head to be tracked is the region that was matched in step S208 of FIG. 2(a). This matching in step S303 is performed by the detection region matching unit 126. If the tracking unit 125 finds a body region of the current frame that corresponds to the body region corresponding to the head to be tracked (success), the tracking unit 125 proceeds to step S304, otherwise proceeds to step S307.
[0040] In step S304, the tracking unit 125 obtains the head estimated position in the body region specified in step S303 and compares it with the tracked head. Specifically, the estimated region matching unit 128 performs the matching. For example, as shown in FIG. 6(a), the estimated region matching unit 128 performs template matching using the tracked head 601a in the previous frame as a template and centering on the head estimated position 602a in the body region 603a in the current frame. However, other matching methods described in the description of the estimated region matching unit 128 may also be used, and the matching method is not limited to these. If the tracking unit 125 can find a region corresponding to the tracked head in the current frame (success), the tracking unit 125 proceeds to step S305, and otherwise proceeds to step S306.
[0041] In step S305, the tracking unit 125 sets the area estimated as the head area (estimated head area) obtained by matching in step S304 as the tracking area of the current frame. In step S306, the tracking unit 125 sets the body area obtained by matching in step S303 as the tracking area of the current frame.
[0042] In step S307, tracking unit 125 searches for the head region. Specifically, region search unit 127 searches for the head region from the current frame. If tracking unit 125 finds the head region by the search (success), the process proceeds to step S308, otherwise the process proceeds to step S309. In step S308, tracking unit 125 sets the discovered head region (discovered head region) obtained by the search in step S307 as the tracking region of the current frame. In step S309, tracking unit 125 determines that it was unable to find a tracking region in the current frame by either method, and discontinues tracking. Specifically, a tracking interruption flag is set.
[0043] Next, the torso tracking process in step S206 shown in Fig. 2(a) will be described with reference to Fig. 3(b). Fig. 3(b) is a flowchart showing an example of the torso tracking process in this embodiment.
[0044] In step S351, the tracking unit 125 compares the tracked torso with the torso region of the current frame. If multiple torso regions have been extracted from the current frame, these torso regions are compared with the tracked torso, and the torso region with the highest similarity is selected. This comparison in step S351 is performed by the detection region comparison unit 126. If the tracking unit 125 finds a torso region corresponding to the tracked torso (success), it proceeds to step S352, otherwise it proceeds to step S355.
[0045] In step S352, the tracking unit 125 obtains a head region of the current frame corresponding to the body region obtained in step S351. Specifically, from the head regions of the current frame, a head region associated with the estimated head position is selected. If multiple head regions are found, it may be determined that there is no corresponding head region. Alternatively, the head estimated position that matches the head region most closely may be selected. For example, the head center coordinate indicated by the estimated head position is selected to be closest to the center of the head region. Alternatively, the head region associated with the tracked body of the previous frame obtained in step S208 of FIG. 2(a) may be utilized. For example, the tracking unit 125 may compare the head region associated with the tracked body of the previous frame with the head region of the current frame, and if there is no similarity equal to or greater than a predetermined level, it may be determined in step S352 that there is no corresponding head region. If there are multiple head regions, the head region with the highest similarity may be selected.
[0046] If there is a head region corresponding to the body region obtained in step S351 (head present), tracking unit 125 proceeds to step S353, otherwise proceeds to step S354. In step S353, tracking unit 125 sets the head region obtained in step S352 as the tracking region of the current frame. In step S354, tracking unit 125 sets the body region obtained in step S351 as the tracking region of the current frame.
[0047] In step S355, the tracking unit 125 obtains a head region corresponding to the tracked torso and compares it with the head region of the current frame. The head region corresponding to the tracked torso is the region that was matched in step S208 of FIG. 2(a). This matching in step S355 is performed by the detection region matching unit 126. If the tracking unit 125 finds a head region of the current frame that corresponds to the head region corresponding to the tracked torso (success), the tracking unit 125 proceeds to step S356, otherwise the tracking unit 125 proceeds to step S357. In step S356, the tracking unit 125 sets the head region obtained by the matching in step S355 as the tracking region of the current frame.
[0048] In step S357, tracking unit 125 searches for a head region corresponding to the tracked torso using region search unit 107. The head region corresponding to the tracked torso is the region associated in step S208 of Fig. 2(a). If the head region is found by the search (success), tracking unit 125 proceeds to step S358, otherwise proceeds to step S359. In step S358, tracking unit 125 sets the discovered head region (discovered head region) obtained by the search in step S357 as the tracking region of the current frame.
[0049] In step S359, the tracking unit 125 obtains the head estimated position of the tracked torso and compares it with the head region of the current frame. Specifically, the estimated region matching unit 128 performs the comparison. For example, as shown in FIG. 6(b), the estimated region matching unit 128 performs template matching with the head region 603b of the current frame as a template and the head estimated position 602b of the tracked torso 601b of the previous frame as the center. If there are multiple head regions in the current frame, template matching is performed with each of them as a template, and the head region showing the highest similarity is selected. Alternatively, a rectangular region centered on the head estimated position 602b may be created and compared with the head region of the current frame. However, other matching methods described in the description of the estimated region matching unit 128 may also be used, and the matching method is not limited to these. If the tracking unit 125 obtains the head region by matching (success), the tracking unit 125 proceeds to step S360, and otherwise proceeds to step S361. In step S360, tracking unit 125 sets the head region obtained by the matching in step S359 as the tracking region of the current frame.
[0050] In step S361, tracking unit 125 searches for a body region. Specifically, region search unit 127 searches for the body region from the current frame. If tracking unit 125 is able to find a body region in the current frame by the search (success), the process proceeds to step S362, otherwise the process proceeds to step S363. In step S362, tracking unit 125 sets the discovered body region (discovered body region) obtained by the search in step S361 as the tracking region of the current frame.
[0051] In step S363, the tracker 125 obtains the head estimated position of the tracked torso and searches for the head in the current frame. Specifically, the estimated area matching unit 128 performs matching. For example, as shown in FIG. 6(c), the estimated area matching unit 128 creates an area based on the estimated head position 601c in the previous frame, and performs template matching on the current frame using this as a template. However, other matching methods described in the description of the estimated area matching unit 128 may also be used, and the matching method is not limited to these. If the tracker 125 obtains the head area by matching (success), the tracker 125 proceeds to step S364, and otherwise proceeds to step S365.
[0052] In step S364, tracking unit 125 sets the head region found in the search in step S363 as the tracking region of the current frame. In step S365, tracking unit 125 determines that a tracking region could not be found in the current frame by either method, and discontinues tracking. Specifically, a tracking discontinuation flag is set.
[0053] Next, the area matching process in step S208 shown in Fig. 2(a) will be described with reference to Fig. 4(a) Fig. 4(a) is a flowchart showing an example of the area matching process in this embodiment.
[0054] In step S401, the region association unit 124 judges whether or not there is a tracking region in the current frame. If there is no tracking region (absent), the region association unit 124 ends the process. If there is a tracking region and the tracking region is the head (head), the region association unit 124 proceeds to step S402, and if the tracking region is the torso (torso), the region association unit 124 proceeds to step S405. Here, the head includes the head region detected by the head detection unit 122, as well as the estimated head region obtained by the estimated region matching unit 128 and the discovered head region obtained by the region search unit 127. Furthermore, the torso includes the torso region detected by the torso detection unit 123 and the discovered torso region obtained by the region search unit 127. However, neither the head nor the torso may include any type of region.
[0055] In step S402, the region association unit 124 obtains a body region corresponding to the head to be tracked. In the same frame, a body region that can be associated with the head to be tracked is selected from the head estimated region of the body region. If only one body region is selected (1), the process proceeds to step S403. If no body region is obtained or multiple body regions are obtained, the process proceeds to step S404.
[0056] In step S403, the region association unit 124 associates the tracked head with the body region obtained in step S402. In step S404, the area matching unit 124 obtains the head to be tracked in the previous frame corresponding to the head to be tracked in the current frame, and further obtains the body area associated with the head to be tracked in the previous frame. Then, the area matching unit 124 matches the body area associated with the head to be tracked in the previous frame with the head to be tracked in the current frame. Note that if there is no body area in the head to be tracked in the previous frame, the area is obtained by going back further to the head to be tracked in the past. If no body area is obtained, it is also possible not to match the body area with the head to be tracked.
[0057] In step S405, the region association unit 124 obtains the tracking torso of the previous frame corresponding to the tracking torso of the current frame, and obtains the head region associated with the tracking torso of the previous frame. Then, the region association unit 124 associates the head region associated with the tracking torso of the previous frame with the tracking torso of the current frame. Note that when the head region cannot be obtained from the tracking torso of the previous frame, the head region may not be associated with the tracking torso.
[0058] Next, with reference to Figures 4(b) and 4(c), an example of matching areas in past frames in steps S404 and S405 in the area matching process shown in Figure 4(a) will be described. Figure 4(b) shows an example of matching the body area in a past frame with the tracked head in the current frame, and Figure 4(c) shows an example of matching the head area in a past frame with the tracked body in the current frame.
[0059] Fig. 4(b) is a diagram showing successive frames 1 to 3. An example will be described in which each frame is processed in sequence. In frame 1, the tracking region is head region 401b, and there is only one body region 402b that corresponds to head region 401b, so in step S403, head region 401b and body region 402b are associated as shown in 404b. Note that 403b is the estimated head position related to body region 402b.
[0060] In the next frame 2, the body region has not been detected, so the head region 405b cannot be associated with the body region in frame 2. However, in the association process described above, the body region 402b and head region 405b in frame 1 are associated with each other in step S404, as shown in 406b.
[0061] Then, when the next frame 3 is subjected to tracking AF processing in this associated state, head tracking is in progress, so head tracking processing is initiated in step S205. Then, in the processing shown in FIG. 3(a), since the head region is not in frame 3 in step S301, processing proceeds to step S303. In step S303, when matching the body region of the head to be tracked 405b in frame 2 with the body region 407b in frame 3, the body region 402b in frame 1 is matched with the body region 407b in frame 3. In frame 3, the head is hidden by the body, and the estimated head position is on the body. Therefore, processing fails in step S304, and body region 407b is set as the new tracking region in step S306.
[0062] In this way, matching the torso region of a previous frame enables matching with the previous torso region, which allows tracking to continue even when the head region cannot be detected or uniquely identified during head tracking.
[0063] FIG. 4(c) is also a diagram showing consecutive frames 1 to 3. An example will be described in which each frame is processed in sequence. Frame 1 is the same as FIG. 4(b). Frame 2 shows a case in which the head region is no longer detected. In this example, the person has fallen backwards and the head is no longer visible. At this time, the head region cannot be associated with the body region 402c in frame 2. However, in the association process described above, in step S405, the head region 401b in frame 1 and the body region 402c in frame 2 are associated as shown in 401c.
[0064] Then, when the next frame 3 is subjected to tracking AF processing in this associated state, the torso is being tracked, so torso tracking processing is initiated in step S206. Then, in the processing shown in Fig. 3(b), step S351 fails because there is no torso area in frame 3, and the processing moves to step S355. In step S355, head area 401b in frame 1 is referenced, and this is matched with head area 405c in frame 3. Then, if the match is successful, head area 405c can be set as the new tracking area.
[0065] In this way, matching the head region of a previous frame enables matching with the previous head region, which allows tracking to continue even when the body region cannot be detected or uniquely identified during body tracking in the current frame.
[0066] Next, an example of the process of tracking AF of the same subject by switching the tracking area to the head or torso by the tracking AF process shown in Fig. 2(a) will be described with reference to Fig. 7. Fig. 7 illustrates a case where the subject head 701 is covered by the torso due to a backflip or the like, and then the head reappears.
[0067] In frame 1, since tracking has not yet started at the start of the tracking AF process, the tracking start process is performed in step S204, and the head region is selected based on criteria such as being close to the center of the frame. As a result, the head region 701 is set as the tracking region as shown in frame 1. Then, in step S207, the tracking region is focused, and the tracked head 701 and body region 702 are associated with each other in step S208.
[0068] Next, when frame 2 is supplied from the imaging unit 106, the tracking AF process is executed again, and since the head is being tracked, the head tracking process is executed in step S205. In the process shown in FIG. 3(a), since there is no head region corresponding to the tracked head 701 in step S301, the process proceeds to step S303. In step S303, the process proceeds to step S304 to compare the body region 702 in frame 1 with the body region 703 in frame 2. Then, in step S304, the head region 701 is compared with the head estimated position 704, but the comparison fails, and the process proceeds to step S306, where the body region 703 is set as the new tracking region. Although the head region 707 of another subject is captured in frame 2, tracking of the same subject continues without switching to the head region of the other subject. Then, in step S207, focusing is performed on the new tracked torso 703, and in step S208, the tracked torso 703 and the head region 701 are associated with each other.
[0069] Next, when frame 3 is supplied from the imaging unit 106, AF processing is executed again, and since the torso is being tracked, torso tracking processing is executed in step S206. In the processing shown in FIG. 3B, in step S351, the tracked torso 703 is matched with the torso region 705, and the process proceeds to step S352. In step S352, the head region 706 corresponding to the torso region 705 is obtained, and the process proceeds to step S353, where the head region 706 is set as the new tracking region. Then, in step S207, focusing is performed on the new tracked head 706, and in step S208, the tracked head 706 is associated with the torso region 705.
[0070] According to this embodiment, even if there is no area corresponding to the head or torso being tracked, the same subject can be tracked by switching the tracking area to the head or torso. This makes it possible to continue tracking the same subject even when the head is covered by the subject itself due to a backflip or the like, without switching the tracking to another subject whose head is visible.
[0071] In addition, in the area matching process, by matching the other area of the past frame with the tracking area, it is possible to match it with the past area. This makes it possible to continue tracking even when the other area cannot be detected during tracking or there is a frame that cannot be uniquely identified. Also, as shown in steps S304, S359, S363, etc., by searching for the head using the head estimated position, even if detection of the area of the part being tracked is interrupted, the possibility of tracking the head of the same subject again increases.
[0072] In the above-described embodiment, in steps S252 and S254 in FIG. 2B, the tracking unit 125 selects the head region or body region close to the center as the tracking region. However, the head region or body region selected by the user using the control key 105 or the like may be adopted as the tracking region. Alternatively, when tracking is resumed after being interrupted, a head region close to the position where the previous tracking region was located may be selected. Alternatively, a head region with a similar size may be selected. This increases the possibility that the same subject can be tracked again when tracking is interrupted due to non-detection or the like, since the subject is likely to appear near the same location.
[0073] Also, in the above-described embodiment, in steps S255, S309, and S365, tracking is immediately interrupted and the tracking area is reset. However, tracking may be interrupted when tracking is interrupted a certain number of times. In the above description, processing is performed by referring to the previous frame and the current frame, but if tracking is not immediately interrupted, the current frame is not replaced with the previous frame when tracking fails, and the next frame is processed as the current frame while maintaining the previous frame. This allows tracking to continue even if tracking fails momentarily for several frames.
[0074] In the above-described embodiment, as a method for associating the head detection and torso detection regions, torso detection outputs head estimated position 502a as shown in Fig. 5(a). However, as shown in Fig. 5(b), head detection may output head region 501b and torso estimated position 502b. Then, torso detection outputs only torso region 503b. The torso region including the estimated torso position may be associated with the head region.
[0075] Alternatively, as shown in FIG. 5(c), corresponding point detection may be prepared separately from head detection and torso detection to output head estimated position 503c and torso estimated position 504c. Head detection outputs only head region 501c, and torso detection outputs only torso region 502c. Then, the head region including the head estimated position and torso estimated position output by corresponding point detection may be associated with the torso region. Alternatively, corresponding point detection may output the torso estimated position from the head region. Then, the torso region corresponding to the head region may be associated with the torso estimated position. Alternatively, corresponding point detection may output the head estimated position from the torso region. Then, the head region corresponding to the torso region may be associated with the head estimated position. The method of associating the head detection and torso detection regions is not limited to these.
[0076] Furthermore, when an estimated body position is obtained in addition to the estimated head position, the estimated area matching unit 128 may search for the body area using the estimated body position. For example, when step S307 of the head tracking process fails, the following process may be performed. As a first process, when a body area is detected in the current frame, as shown in Fig. 9(b), the estimated body position 902b of the head 901b to be tracked in the previous frame is used to match it with the body area 903b in the current frame. When the match is successful, the found body area is set as the tracking area.
[0077] In the second process, if the body region is not detected in the current frame, the current frame is searched for by template matching or the like using the estimated body position 902c of the head 901c to be tracked in the previous frame, as shown in Fig. 9(c). If the search is successful, the found body region is set as the tracking region. Note that if the first and second processes fail, the process may proceed to step S309.
[0078] Alternatively, when step S359 of the body tracking process fails, as shown in Fig. 9(a), the body estimated position 902a in the current frame may be used to compare with the tracked body 901a in the previous frame. If the comparison is successful, the discovered body region is set as the tracking region. If the comparison is unsuccessful, the process proceeds to step S361. The method of searching for a region using the estimated position is not limited to these.
[0079] In the above-described embodiment, the head region is tracked with priority over the torso region. However, the torso region may be tracked with priority over the head region. In addition to the two regions, the head region and the torso region, the region of another subject may be detected, and the other region may be tracked when the head or the torso cannot be detected. Alternatively, the head detection may be face detection or the like. Furthermore, the torso detection may be detection of the entire region of the subject, such as human body detection. The priority order of the regions to be tracked and the number and type of the regions to be tracked are not limited to these.
[0080] In the above-described embodiment, the frame images are stored in the RAM 103 in the tracking AF process. However, it is also possible to hold only the detection area and the search area without storing all the image data in the RAM 103. The search area is an area searched by the area search unit 127 or the template matching of the estimated area matching unit 128. In particular, the tracking area and the area corresponding to it may be left in the past frame. Alternatively, as shown in the previous frame of FIG. 6(b), when the body area is the tracking area, the image data may be left so as to include the tracked body and the head estimated position. In this case, too, the head can be searched using the head estimated position shown in steps S359 and S363. This can reduce the memory usage of the RAM, etc.
[0081] In the above-mentioned embodiment, the process proceeds to step S403 only when one body region is obtained for the head to be tracked in step S402, and the body region is associated with the head to be tracked. However, when multiple body regions are obtained in step S402, the one with the most consistent head estimated position may be selected. For example, the one with the head center coordinates indicated by the head estimated position closest to the center of the head region is selected. In this case, the process proceeds to step S404 only when no body region is obtained.
[0082] Alternatively, if multiple body regions are obtained in step S402, all of the body regions may be associated with the head to be tracked in step S403. In this case, when performing matching or searching using the body region of the head to be tracked, matching or searching using all of the body regions may be performed, and the result of the body region with the highest similarity may be used. For example, in the process of step S303, multiple body regions corresponding to the head to be tracked are obtained and matched with multiple body regions in the current frame. The determination of whether or not to associate a region with the head to be tracked is not limited to this. In addition, the number of regions to be associated with the head to be tracked is not limited to one.
[0083] (Embodiment 2) In the above-described first embodiment, in step S402 in the area matching process, the matching between the tracked head and the body area is determined based on the head estimated position. However, when the head estimated position is incorrect, the matching is incorrect. In this embodiment, the position of the body area and the similarity of the image are used to suppress incorrect matching. Since the second embodiment differs from the first embodiment in the area matching process but is otherwise similar, the following describes the area matching process in the second embodiment and omits other descriptions.
[0084] The region matching process in the second embodiment will be described with reference to Fig. 8(a). Fig. 8(a) is a flowchart showing an example of the region matching process in this embodiment, and the process shown in Fig. 8(a) is called and executed from step S208 shown in Fig. 2(a).
[0085] In step S801, the region association unit 124 determines whether or not there is a tracking region in the current frame. If there is a tracking region and the tracking region is the head (head), the region association unit 124 proceeds to step S802, and if the tracking region is the body (body), the region association unit 124 proceeds to step S807. If there is no tracking region (none), the region association unit 124 proceeds to step S808.
[0086] In step S802, the region matching unit 124 obtains a body region corresponding to the tracked head. The region matching unit 124 selects a body region that can be associated with the tracked head at the head estimated position in the same frame. When multiple head estimated positions are included, multiple body regions are selected.
[0087] In step S803, the region association unit 124 adds the body region obtained in step S802 to the body region previously processed in step S803 and clusters the body regions of the same subject into one cluster. The region association unit 124 clusters the body region using image features such as a color histogram of the body region. Specifically, if a cluster has not yet been formed, a cluster with one element is generated. If a cluster already exists, the average of the image features constituting the cluster is used as a representative value, and if the similarity with the representative value is equal to or greater than a predetermined value, the cluster is added to the existing cluster, otherwise a new cluster is generated. Other methods known as hierarchical clustering or k-means may be used for clustering. In addition, not only a clustering method of adding to an existing cluster, but also a method of recreating a cluster may be adopted. The clustering method is not limited to these.
[0088] In addition to the image feature of the torso region, the position within the image may be used. The torso region of the same subject is likely to appear at the same location within the image. Therefore, the image feature and the coordinates may be combined into a single vector to find the similarity.
[0089] In step S804, the region association unit 124 obtains an evaluation value for the cluster. For example, the number of body regions that make up the cluster is set as the evaluation value.
[0090] In step S805, the region association unit 124 selects a body region from a cluster with a high evaluation value. For example, the body region that exists in the most recent frame from the cluster is selected. Alternatively, the body region that is closest to the representative value of the cluster is selected. Alternatively, if there is a body region that has been previously associated, it may be selected. The method of selecting a body region from a cluster is not limited to these.
[0091] In step S806, the region association unit 124 associates the body region selected in step S805 with the head to be tracked.
[0092] In step S807, the region association unit 124 obtains the tracking torso of the previous frame corresponding to the tracking torso of the current frame, and obtains the head region associated with the tracking torso of the previous frame. Then, the region association unit 124 associates the head region associated with the tracking torso of the previous frame with the tracking torso of the current frame. Note that when the head region cannot be obtained from the tracking torso of the previous frame, the head region may not be associated with the tracking torso.
[0093] In step S808, the region association unit 124 initializes the clustering. This initialization resets the previous body region that was added to the previous body region in step S803 and clustered. This allows the clustering not to be initialized while the same subject is being tracked, but to be initialized when tracking is interrupted. Alternatively, the clustering may be initialized when a predetermined number of tracking regions cannot be set. This corresponds to initializing the clustering only when the tracking interruption flag is set. Note that the method of determining that tracking of the same subject has been interrupted is not limited to the above.
[0094] Next, an example of region matching processing in this embodiment will be described with reference to Fig. 8(b) and Fig. 8(c). Fig. 8(b) is a diagram showing consecutive frames 1 to 4. A case where each frame is processed in order will be described as an example. Fig. 8(c) shows an example of cluster evaluation values when each frame is processed.
[0095] In frame 1, the head is the tracking region 801b, so the process proceeds to step S802, where a body region 802b corresponding to the tracking region 801b at the estimated head position is obtained. Next, in step S803, the body region is clustered, and since this is the first time, one cluster is generated. In step S804, an evaluation value of the cluster is obtained as shown in FIG. 8(c). Since there is only one cluster and it contains only one element, the evaluation value obtained is 1. Next, in step S805, a body region is selected from cluster 1, and since there is only one element, body region 802b is selected. Then, in step S806, the tracking region 801b and body region 802b are associated with each other as shown in 803b.
[0096] In the next frame 2, similarly to frame 1, a tracking region 804b and a body region 805b corresponding to the estimated head position are obtained. In step S804, body region 802b in frame 1 and body region 805b obtained in frame 2 are clustered. Here, it is assumed that the body regions have a high similarity and form the same cluster. Next, in step S804, since the number of elements in the cluster is 2, a cluster evaluation value is calculated as shown in FIG. 8(c). In step S805, a body region is selected from cluster 1 with a high evaluation value, and body region 805b shown in the most recent frame is selected. Then, in step S806, tracking region 804b and body region 805b are associated as shown in 806b.
[0097] In the next frame 3, a body region 808b that corresponds to the tracking region 807b at the estimated head position is obtained. However, this is a false detection of the body and is not a correct result. This correspondence is corrected by the following process. Specifically, in step S803, body regions 802b and 805b in the previous frame and body region 808b in frame 3 are clustered. Here, since body region 808b is not the body of the subject, it does not have a high similarity with other body regions and forms a new cluster. In step S804, evaluation values of existing cluster 1 and new cluster 2 are obtained as shown in FIG. 8(c). Cluster 1 includes body regions 802b and 805b, and cluster 2 includes body region 808b, so their evaluation values are 2 and 1, respectively. In step S805a, body region 805b that appears in the most recent frame is selected from cluster 1 with the highest evaluation value. Then, in step S806, the tracking region 807b and the body region 805b are associated with each other as shown in 809b.
[0098] In the next frame 4, two body regions, body regions 811b and 812b corresponding to the tracking region 810b at the estimated head position, are obtained. Body region 812b is a false detection of the body, but the correspondence is corrected by the following process. Specifically, in step S803, body regions 802b, 805b, and 808b in the previous frame and body regions 811b and 812b in frame 4 are clustered. Here, body region 812b is not the body of the subject, but it happens to have a high similarity to 808b because it is in the same background region, etc. Therefore, body region 811b is added to cluster 1, and body region 812b is added to cluster 2. In step S804, an evaluation value is calculated as shown in FIG. 8(c). Cluster 1 includes body regions 802b, 805b, and 811b, while cluster 2 includes body regions 808b and 812b, with the respective evaluation values being 3 and 2. In step S805, a body region is selected from cluster 1 with a high evaluation value, and body region 811b shown in the most recent frame is selected. Then, in step S806, tracking region 810b and body region 811b are associated with each other as shown in 813b.
[0099] According to this embodiment, the same body region is grouped into a cluster based on the position of the body region or the image similarity, and the body region with a high frequency is selected and associated with the head to be tracked. This makes it possible to associate the correct body region with the head to be tracked even if the association based on the head estimated position is incorrect.
[0100] In the above-described embodiment, the number of body regions constituting a cluster is used when calculating the cluster evaluation value in step S804. However, the number of body regions appearing in a specified number of most recent frames may also be used as the evaluation value. Alternatively, the influence may be reduced the further back the frame. Specifically, a function is prepared that takes as input the difference between the frame number in which a body region appears and the frame number of the current frame and outputs a value that is inversely proportional to the input. The value of the function is calculated for each body region constituting a cluster, and the sum of the values is used as the evaluation value. This makes it possible to reduce the evaluation value over time even if clusters were formed in the past.
[0101] Alternatively, when a camera change that affects the appearance, such as zooming, occurs, the torso area before the change may not be included in the evaluation value. Alternatively, when attenuating the influence of frames that are earlier as described above, the influence may be attenuated more significantly before the camera change. This makes it possible to lower the evaluation value even when the areas of different subjects coincide by chance due to an appearance change caused by a camera change.
[0102] (Other embodiments) Although the embodiment has been described in detail above, the present invention is not limited to the above-described embodiment, and appropriate modifications can be made without departing from the spirit of the present invention. The present invention can be embodied, for example, as a system, an apparatus, a method, a program, or a storage medium, etc. Specifically, the present invention may be applied to a system composed of multiple devices, or may be applied to an apparatus composed of a single device. The present invention can also be realized by executing the following process: That is, software (programs) that realize the functions of the above-described embodiments are supplied to a system or device via a network or various storage media, and the computer (or CPU, MPU, etc.) of the system or device reads and executes the programs. [Explanation of symbols]
[0103] 100: Imaging device 101: Control unit 121: Area detection unit 122: Head detection unit 123: Body detection unit 124: Area matching unit 125: Tracking unit 126: Detection area matching unit 127: Area search unit 128: Estimated area matching unit
Claims
1. an area detection means for detecting a plurality of part areas respectively corresponding to a plurality of parts of a subject in an image; an area matching means for matching the plurality of body part areas detected by the area detection means for each of the subjects, and for matching a body part area not detected in a frame image with a body part area detected for the same subject in a previous frame image; a tracking means for setting a tracking area based on the plurality of part areas detected by the area detection means and tracking a predetermined subject, an image processing device characterized in that, when the tracking means is unable to track the specified subject in the current frame image using a tracking part area set in the tracking area, and another part area of the specified subject that should be associated with the tracking part area in the current frame image is not detected in the frame image immediately preceding the current frame image, if the tracking means successfully matches the other part area with the part area in a previous frame image that the area matching means has matched with the tracking part area in the immediately preceding frame image, the tracking means tracks the specified subject in the other part area.
2. 2. The image processing device according to claim 1, wherein the tracking means switches the tracking area to the other part area when the specified subject cannot be tracked in the tracking part area, and switches the tracking area to the tracking part area when the specified subject can be tracked in the tracking part area when the other part area is set as the tracking area.
3. 3. The image processing apparatus according to claim 1, wherein the tracking means sets the tracking area based on information on an estimated position of another part area associated with the part area.
4. 4. The image processing apparatus according to claim 3, wherein the tracking means searches for the other part area in the video using information on the estimated position of the other part area, and tracks the predetermined subject.
5. a means for selecting a part area of a part different from a tracking area of a subject being tracked from the part areas detected by the area detection means, and clustering the part areas by part; and an evaluation means for evaluating the cluster for each part, 5. The image processing apparatus according to claim 1, wherein the area association means associates part areas of clusters having high evaluation values for each part with the tracking area.
6. 6. The image processing apparatus according to claim 1, wherein the area detection means detects part areas corresponding to a head and a torso of a subject in an image.
7. 3. The image processing apparatus according to claim 2, wherein said region detection means detects a part region corresponding to a head of the subject as said tracking part region, and detects a part region corresponding to a torso of the subject as said other part region.
8. An imaging means; 8. The image processing device according to claim 1, further comprising: a focusing unit that performs focusing control for said imaging unit by using said tracking area for focusing.
9. a region detection step of detecting a plurality of part regions respectively corresponding to a plurality of parts of a subject in a video; a region matching step of matching the detected plurality of region regions for each of the subjects, and matching a region region not detected in a frame image with a region region detected for the same subject in a previous frame image; a tracking step of setting a tracking area based on the detected plurality of part areas and tracking a predetermined subject; In the tracking process, if the specified subject cannot be tracked in the current frame image using the tracking part area set in the tracking area, and another part area of the specified subject that should be associated with the tracking part area in the current frame image is not detected in the frame image immediately preceding the current frame image, if the other part area is successfully matched with the part area in the previous frame image that was associated with the tracking part area in the frame image immediately preceding the current frame image in the area matching process, the specified subject is tracked in the other part area.
10. A program for causing a computer to function as each of the means of the image processing device according to any one of claims 1 to 8.
Citation Information
Patent Citations
Imaging apparatus
JP2009268086A
Image data control device
JP2012209831A
Image processing apparatus, imaging apparatus, and image processing program
JP2019134438A
Tracking controller
JP2019201387A
