Captcha Letter Extraction
Without some sample inputs I can only really comment on how the code reads, less on how it runs.


First, this should really be a few functions, I'll indicate below where might be good places to separate the code.
Why import os and os.path? Just import os then call os.path.&lt;something&gt;
You don't need to wrap i, captcha_image_file in brackets when using enumerate(); enumerate() also takes an optional start argument; so, using f-strings as well, you can write:


for count, captcha_image_file in enumerate(captcha_image_files, 1):
    print(f"[INFO] processing image {count}/{len(captcha_image_files)}")


count typically indicates starting from 1, where pos or index would indicate starting from 0. Avoid using short, non-descriptive variables like i.


The "Hack" can be shortened nicely with a ternary operator:


contours = contours[0] if imutils.is_cv2() else contours[1]



I would separate the block immediately following this into a function, which would yield, rather than append to a list. This will be faster, cleaner, and get rid of dummy variables.
I would use itemgetter rather than a lambda function here, entirely a style choice, though.
Contrary to what I said earlier, I actually think using x, y, w, h is fine here as they are commonly understood to be the x and y directions, width and height.
Again, this last block (for letter_bounding_box, letter_text ...) should be its own function.
Really, I think this whole piece of code should be a class, the globals can then be class variables, and you can have three methods. You can then have a main() function which calls these methods and keeps track of which file you're on etc. This main() should sit inside: 
if __name__ == '__main__':
Overall comments are good, somewhat excessive in parts but better than too sparse.


The bulk of the improvements would come from separating out your code into readable methods. Functions / methods should generally have one clear purpose. This also has the advantage of making generators easier to use as you can easily yield rather than constantly making lists.