1. An X-ray imaging apparatus comprising: a processor 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 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; and a display configured to display an X-ray image reconstructed from the second X-ray image data, wherein the processor is further configured to generate corrected image data obtained by performing scatter correction on the first X-ray image data by using the scatter kernel function, determine whether a parallel-beam type corrected image converted from the corrected image data by performing fan-parallel rebinning satisfies the data consistency and determine whether to update the scatter kernel function based on a data consistency of the parallel-beam type corrected image data.