Detecting 1D barcodes at an angle

I’m using the M7 board for reading 1D barcodes, specifically the CODE39 type.
I have got the find_barcodes sample working but it only catches barcodes that are at 0 or 90 degree orientations. I’m assuming this is because the zbar algorithm only scans along the rows then columns of the image matrix.

How can I detect 1d barcodes that are at any orientation?
I’ve tried applying rotation_corr(z_rotation=45) but I get memory error on VGA and QVGA is too low for barcode reading.

Hmm, well, zbar does the scan multiple times across the whole image. How small is the bar code? It does a scan for every row and then every column of the image. This should catch the barcode. It would only not be seen if the code had low vertical height on the lines which would force the scan to be done in the direction of the bar code.

Can you post an image so I know what to do?

Yeah, the barcodes are not high. They are 50mm wide and only 8mm high. I can’t increase the height for this application.
I was hoping there was an algorithm to scan the image for 1D barcodes at multiple angles, such as diagonally or at 30 degrees from the pixel row direction.
Is there any alternate 1D barcode scanning algorithm I could try that would do that?

That’s an artificially hard problem. Yeah, image rotation is the only thing you can do. However, this requires two copies of the image in RAM.

Um, if you know the barcode location or just only need the VGA pixel size but don’t need very pixel in the image use the sensor.set_windowing(x,y,w,h) method to shrink the image window to make the image smaller while keeping the VGA quality resolution. Then you can rotate the image.