An image processing apparatus communicatively connected with an image pickup element, the image processing apparatus comprising: an acquisition unit configured to acquire a parallax image generated by the image pickup element based on signals from a first plurality of photoelectric converters among at least the first plurality of photoelectric converters and a second plurality of photoelectric converters, the at least first and second pluralities of photoelectric converters (301, 302) receive light beams passing through respective different partial pupil regions (501, 502) of an imaging optical system, and to acquire a captured image, wherein the captured image is an image generated by the image pickup element and comprising a plurality of pixel values, each captured image pixel value being generated by adding signals from all of the at least first and second pluralities of photoelectric converters (301, 302) to each other, for each associated pixel from a plurality of arrayed pixels comprising, per each pixel, one photoelectric converter of each of the at least first and second pluralities of photoelectric converters (301, 302); and an image processing unit configured to, if the parallax image contains a defect representing a dot flaw or a line flaw, correct the parallax image using the captured image as a reference image, wherein the image processing unit corrects a pixel value of the parallax image at a first position in the plurality of arrayed pixels that contains the defect, based on a pixel value of the captured image at the first position, wherein the image processing unit corrects the pixel value of the parallax image at the first position based on the pixel value of the captured image at the first position, a pixel value of the parallax image at a second position in the plurality of arrayed pixels that does not contain a defect, and a pixel value of the captured image at the second position, wherein when the pixel value of the parallax image or the captured image at the second position is lower than a predetermined luminance value, the image processing unit replaces the pixel value with the predetermined luminance value. an acquisition unit configured to acquire a parallax image generated by the image pickup element based on signals from a first plurality of photoelectric converters among at least the first plurality of photoelectric converters and a second plurality of photoelectric converters, the at least first and second pluralities of photoelectric converters (301, 302) receive light beams passing through respective different partial pupil regions (501, 502) of an imaging optical system, and to acquire a captured image, wherein the captured image is an image generated by the image pickup element and comprising a plurality of pixel values, each captured image pixel value being generated by adding signals from all of the at least first and second pluralities of photoelectric converters (301, 302) to each other, for each associated pixel from a plurality of arrayed pixels comprising, per each pixel, one photoelectric converter of each of the at least first and second pluralities of photoelectric converters (301, 302); and to acquire a parallax image generated by the image pickup element based on signals from a first plurality of photoelectric converters among at least the first plurality of photoelectric converters and a second plurality of photoelectric converters, the at least first and second pluralities of photoelectric converters (301, 302) receive light beams passing through respective different partial pupil regions (501, 502) of an imaging optical system, and to acquire a captured image, wherein the captured image is an image generated by the image pickup element and comprising a plurality of pixel values, each captured image pixel value being generated by adding signals from all of the at least first and second pluralities of photoelectric converters (301, 302) to each other, for each associated pixel from a plurality of arrayed pixels comprising, per each pixel, one photoelectric converter of each of the at least first and second pluralities of photoelectric converters (301, 302); and an image processing unit configured to, if the parallax image contains a defect representing a dot flaw or a line flaw, correct the parallax image using the captured image as a reference image, wherein the image processing unit corrects a pixel value of the parallax image at a first position in the plurality of arrayed pixels that contains the defect, based on a pixel value of the captured image at the first position, wherein the image processing unit corrects the pixel value of the parallax image at the first position based on the pixel value of the captured image at the first position, a pixel value of the parallax image at a second position in the plurality of arrayed pixels that does not contain a defect, and a pixel value of the captured image at the second position, wherein when the pixel value of the parallax image or the captured image at the second position is lower than a predetermined luminance value, the image processing unit replaces the pixel value with the predetermined luminance value.