c# - Convert color scan image to grayscale image for PDF417 decoder xzing -


i'm decoding pdf417 2d barcode in scanned image using zxing.net library. far, have found gray-scale scanned image(8bit depth) working fine , color scanned image(24 bit depth) not working. tried covert color scanned image gray-scale image using below method.

 private bitmapsource convertgray(bitmapsource bi)     {         formatconvertedbitmap newformatedbitmapsource = new formatconvertedbitmap();         newformatedbitmapsource.begininit();         newformatedbitmapsource.source = bi;         newformatedbitmapsource.destinationformat = pixelformats.gray8;         newformatedbitmapsource.endinit();          return newformatedbitmapsource;      } 

but, zxing.net not detect pdf417 2d barcode in converted gray-scale image. how can convert color scanned image gray-scale image same format gray-scale scanned image.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -