Fixed issues with file formats and paths, now it looks like the issue comes down to there not being enough channels in the matrix that is ultimately derived from the vector of cv::Point2f that represents the pixel locations of a given contour.
Seems like OpenCV likes to parse white pixels as (nan, nan, nan) instead of (255, 255, 255) on .pbm, .pgm, and .bmp file formats. I got around this by detecting white pixels by checking if the color values were nan, but this is a hack at best. I wonder if it has to do with how Photoshop saves the file. This gets us past the assertion that fails on the number of channels in the matrix that OpenCV generates internally when computing a bounding box from a vector of Point2f, but we get another OpenCV error later.
Fixed the second OpenCV error, which was because I had used the wrong boolean matrix to black out area around a contour.