1. An image processing apparatus comprising: an obtaining unit that obtains a captured image of a test piece including a target cell having a nucleus; a first extraction unit that extracts pixels which are candidates for the nucleus from pixels included in the captured image; a second extraction unit that extracts a connected-pixel group which is a candidate for the target cell from connected-pixel groups in which adjacent pixels among the pixels extracted by the first extraction unit are connected to each other; a setting unit that sets rectangular regions in the captured image, each of the rectangular regions being a region whose center is positioned at a pixel included in the connected-pixel group extracted by the second extraction unit and which has a given size; a filter setting unit that sets a filter which includes first to N-th regions and which is configured so that an i-th region does not extend outside an (i+1)-th region, where N is an integer that is equal to or larger than two and i is any integer in a range of 1 to N−1; a generating unit that, in a case where the filter set by the filter setting unit is disposed in each of the rectangular regions set by the setting unit, generates an image feature value on the basis of a difference between the sum of pixel values of pixels included in the odd-numbered regions of the filter and the sum of pixel values of pixels included in the even-numbered regions of the filter; and a determination unit that determines, on the basis of whether or not the image feature value generated by the generating unit satisfies an image-feature-value condition for the image feature value, whether or not the target cell is included in the rectangular region, the image-feature-value condition being predetermined.