I'm trying to put any custom image on a blank t-shirt as done below
I'm using Python's CV2. Any idea how that could be done? I'm thinking cv2.inRange could point me to the white t-shirt and then I could resize the image to fit the shirt, but I'm not sure how to preserve the shadow and wrinkle effects. Maybe with edge detection?
you want to "blend" the overlay onto the image. open an image editor and explore the blend modes it has for layers. I would suggest trying the "multiply" and "overlay" modes.
OpenCV has some limited support for blending but I would suggest formulating the calculation yourself. the Wikipedia article should help. for a multiply, I would convert both pictures to CV_32F, scale them by 1/255 (so the range is 0.0 .. 1.0), then just multiply them elementwise.
getting a mask for the t-shirt is a useful step. that will let you place the overlay only on the t-shirt, not on the background or skin of the model.
edge detection is not at all applicable here.