Barcode pre-processing for zbar
<p>I'm using a raspberry pi camera to read barcodes from an image, and the object needs to be relatively far from the camera in my application. The barcode before processing: <a href="https://i.stack.imgur.com/pHVvA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pHVvA.png" alt="Before"></a> </p>

<p>Zbar was unable to decode anything from this image, and I decided to try and edit the image manually to get it to decode. After drawing clear white lines between the single lines of the barcode and changing the contrast of the image, this result was decoded by ZBar: <a href="https://i.stack.imgur.com/fUtcX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fUtcX.png" alt="After"></a></p>

<p>How can I programmatically go from the first image to the second image (I am using OpenCV with python right now)? </p>