Reputation: 79
Has anyone had success using a recent version of ZXing under C#?
I'm attempting to use ZXing to process images I'm pulling in from the webcam, ideally in "real"time, but all the examples I can find for using ZXing to decode appear to be outdated. Starting to go a little nuts.
As far as I can tell, if I can get my cam image to be a BinaryBitmap I'll be fine, but none of the methods/classes used for converting in the examples I can find seem to exist anymore.
Here's the code currently causing me a headache:
Binarizer barney = new HybridBinarizer(new LuminanceSource(image));
Result result = reader.decode(new BinaryBitmap(barney));
LuminanceSource seems to be my speed bump right now. I can't find the appropriate class to instantiate under C#, BufferedLuminance and AWTImageLuminanceSource don't seem to exist under C#.
Anyone able to point out what I should be doing...?
I'm running Win7 64b, ZXing 1.7, VS2008.
Upvotes: 4
Views: 11282
Reputation: 324
Take a look to my project
It can scan qr codes from a webcam and it uses zxing from the qr decodification.
Upvotes: 1
Reputation: 15885
I've used the C# port recently. LuminanceSource
is an abstract class.
You need to either:
LuminanceSource
and implement its methods, or RGBLuminanceSource
class instead.I've used the latter to success.
Upvotes: 5