1. An X-ray imaging apparatus comprising: a kernel function setter configured to set a scatter kernel function in response to a scatter component included in first X-ray image data detected by an X-ray detector; and an image data corrector configured to generate second X-ray image data obtained by performing scatter correction on the first X-ray image data by using the scatter kernel function and a data consistency.