Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
An image processing apparatus comprises a detection unit configured to detect a specific portion of a subject before detecting the subject in a search region of a first frame image, and a processing unit configured to perform tracking processing to track the subject in the first frame image after the detection unit has detected the specific portion.
1 . An image processing apparatus comprising:
at least one processor; and
at least one memory having stored thereon instructions which, when executed by the at least one processor, cause the image processing apparatus at least to:
detect a specific portion of a subject in a first search region of a first frame image before detecting the subject from the first frame image;
perform tracking processing to track the subject in the first frame image after the specific portion is detected from the first search region; and
specify a second search region in a second frame image following the first frame image based on the first search region in the first frame image, a result of the tracking processing performed on a frame image preceding the first frame image, and a result of the tracking processing performed on the first frame image,
wherein
in the detecting, the specific portion of the subject in the specified second search region of the second frame image is detected before detecting the subject from the second frame image,
in the performing of the tracking processing, the tracking processing to track the subject in the second frame image is performed after the specific portion is detected from the specified second search region, and
in the specifying, a third search region in a third frame image following the second frame image is specified based on the specified second search region in the second frame image, a result of the tracking processing performed on the first frame image, and a result of the tracking processing performed on the second frame image,
wherein the specific portion includes a first portion and a second portion that includes the first portion,
an image in the first search region is acquired as a cropped image,
the first portion is detected based on a likelihood map for the first portion in the cropped image,
the second portion is detected based on a likelihood map for the second portion in the cropped image, and
the tracking processing is determined to be performed in a case where a score based on the likelihood map for the first portion or a score based on the likelihood map for the second portion is smaller than a threshold.
2 . The image processing apparatus according to claim 1 , wherein
a likelihood map for the specific portion in the cropped image is generated, and the specific portion is detected based on the generated likelihood map.
3 . The image processing apparatus according to claim 2 , wherein
the specific portion is detected based on a filtered likelihood map that is the likelihood map in which a region other than the specific portion has been filtered.
4 . The image processing apparatus according to claim 1 , wherein
the first portion is detected based on a filtered likelihood map that is the likelihood map for the first portion in which a region other than the first portion has been filtered, and the second portion is detected based on a filtered likelihood map that is the likelihood map for the second portion in which a region other than the second portion has been filtered.
5 . The image processing apparatus according to claim 1 , wherein
the second search region is obtained based on a region of the second portion in the first frame image, a result of the tracking processing performed on a frame image preceding the first frame image, and a result of the tracking processing performed on the first frame image.
6 . The image processing apparatus according to claim 1 , wherein
a frame image captured by an image capture device is acquired.
7 . The image processing apparatus according to claim 6 , wherein
the specific portion of the subject detected in the first search region or a feature value of the specific portion is transmitted to the image capture device and the image capture device is caused to perform autofocus processing and/or zoom processing on the specific portion.
8 . The image processing apparatus according to claim 1 , wherein in a case where the score based on the likelihood map for the first portion and the score based on the likelihood map for the second portion is not smaller than a threshold, a variance of distance from a centroid position of the second portion to a position at which likelihood is larger than or equal to a fixed value in the likelihood map for the second portion is obtained,
the tracking processing is determined to be performed in a case where the variance is larger than a threshold, and
the tracking processing is determined not to be performed in a case where the variance is smaller than or equal to a threshold.
9 . An image processing method to be performed by an image processing apparatus, the method comprising:
detecting a specific portion of a subject in a first search region of a first frame image before detecting the subject from the first frame image;
performing tracking processing to track the subject in the first frame image after the specific portion has been detected in the detection from the first search region; and
specifying a second search region in a second frame image following the first frame image based on the first search region in the first frame image, a result of the tracking processing performed on a frame image preceding the first frame image, and a result of the tracking processing performed on the first frame image,
wherein
in the detecting, the specific portion of the subject in the specified second search region of the second frame image is detected before detecting the subject from the second frame image,
in the performing of the tracking processing, the tracking processing to track the subject in the second frame image is performed after the specific portion is detected from the specified second search region, and
in the specifying, a third search region in a third frame image following the second frame image is specified based on the specified second search region in the second frame image, a result of the tracking processing performed on the first frame image, and a result of the tracking processing performed on the second frame image,
wherein the specific portion includes a first portion and a second portion that includes the first portion,
an image in the first search region is acquired as a cropped image,
the first portion is detected based on a likelihood map for the first portion in the cropped image,
the second portion is detected based on a likelihood map for the second portion in the cropped image, and
the tracking processing is determined to be performed in a case where a score based on the likelihood map for the first portion or a score based on the likelihood map for the second portion is smaller than a threshold.
10 . A non-transitory computer-readable storage medium for storing a computer program for causing a computer to execute an image processing method comprising:
detecting a specific portion of a subject in a first search region of a first frame image before detecting the subject from the first frame image;
performing tracking processing to track the subject in the first frame image after the specific portion has been detected in the detection from the first search region; and
specifying a second search region in a second frame image following the first frame image based on the first search region in the first frame image, a result of the tracking processing performed on a frame image preceding the first frame image, and a result of the tracking processing performed on the first frame image,
wherein
in the detecting, the specific portion of the subject in the specified second search region of the second frame image is detected before detecting the subject from the second frame image,
in the performing of the tracking processing, the tracking processing to track the subject in the second frame image is performed after the specific portion is detected from the specified second search region, and
in the specifying, a third search region in a third frame image following the second frame image is specified based on the specified second search region in the second frame image, a result of the tracking processing performed on the first frame image, and a result of the tracking processing performed on the second frame image,
wherein the specific portion includes a first portion and a second portion that includes the first portion,
an image in the first search region is acquired as a cropped image,
the first portion is detected based on a likelihood map for the first portion in the cropped image,
the second portion is detected based on a likelihood map for the second portion in the cropped image, and
the tracking processing is determined to be performed in a case where a score based on the likelihood map for the first portion or a score based on the likelihood map for the second portion is smaller than a threshold.