mirror of https://github.com/NaN-tic/nanscan.git
Important performance improvement: store images as BMP instead of PNG
before processing them with external tools. A sample image took 13 seconds to be stored as PNG while BMP took less than a second.
This commit is contained in:
parent
02241981b6
commit
4119ec747c
|
@ -81,7 +81,9 @@ class Barcode(Analyzer):
|
|||
self.dotsPerMillimeterY = float( image.dotsPerMeterY() ) / 1000.0
|
||||
|
||||
file = TemporaryFile.create()
|
||||
image.save( file, 'PNG' )
|
||||
# Use BMP format instead of PNG, for performance reasons.
|
||||
# BMP takes about 0.5 seconds whereas PNG takes 13.
|
||||
image.save( file, 'BMP' )
|
||||
command = '/home/albert/d/git/exact-image-0.5.0/objdir/frontends/bardecode'
|
||||
content = self.spawn( command, file )
|
||||
self.parseBardecodeOutput( content )
|
||||
|
|
|
@ -132,7 +132,9 @@ class DataMatrix(Analyzer):
|
|||
self.dotsPerMillimeterY = float( image.dotsPerMeterY() ) / 1000.0
|
||||
|
||||
file = TemporaryFile.create()
|
||||
image.save( file, 'PNG' )
|
||||
# Use BMP format instead of PNG, for performance reasons.
|
||||
# BMP takes about 0.5 seconds whereas PNG takes 13.
|
||||
image.save( file, 'BMP' )
|
||||
command = 'dmtxread'
|
||||
content = self.spawn( command, '-n', '-v', file )
|
||||
self.parseOutput( content )
|
||||
|
|
|
@ -167,7 +167,9 @@ class Ocr(Analyzer):
|
|||
#self.boxes = self.parseTesseractOutput(txt)
|
||||
|
||||
# Cuneiform Steps
|
||||
self.file = TemporaryFile.create( '.png' )
|
||||
# Use BMP format instead of PNG, for performance reasons.
|
||||
# BMP takes about 0.5 seconds whereas PNG takes 13.
|
||||
self.file = TemporaryFile.create( '.bmp' )
|
||||
image.save( self.file )
|
||||
txt = lower( self.cuneiform() )
|
||||
self.boxes = self.parseCuneiformOutput(txt)
|
||||
|
|
Loading…
Reference in New Issue