Or there's the simple way in Photoshop of using the Filter --> Distort --> Lens Correction and then press the button that looks kind of like /_ and drag the line along something that should be straight. That will straighten it out for you. From there, crop it. Easy as pie