|
From: Alex C. <ale...@ne...> - 2011-01-19 13:23:22
|
Yes, DMTX will be looking for the "best" of three channels. Also, if your camera delivers YUV, the price of color conversion to 32bpp RBG may be quite significant. Alex On Wed, Jan 19, 2011 at 9:00 PM, Jarda Kotesovec <jar...@gm...> wrote: > Thanks a lot for hints. Currently I am passing DmtxPack32bppXRGB image > to dmtxImageCreate. Apparently I can use YUV on iphone as well, but > the key questions is if libdmxt does the conversion to grayscale > before it look for barcode or does it try for each color channel > separately? In latter case it should speed up process 3 times. > > I tried to use O3 instead of Os, but speed is same. So it takes about > 2s to proceed one cycle (I claimed 3s yesterday - it was mistake - it > always takes about 2s when it doesn't recognise the barcode and > 0.1-1.5s if it is successful. And changing resolution from 300x300px > to 200x200px doesn't improve it, which is odd. > > Jarda > > On Wed, Jan 19, 2011 at 4:12 AM, Alex Cohn <ale...@ne...> wrote: >> With Android phones, I found that color conversion may take too much >> time. The "natural" format of preview picture on Android is YUV 4:2:0, >> which means you can simply consider it as grayscale (8 bpp). Working >> with grayscale instead of RGB helped us a lot. >> >> On the other hand, 2 sec is a reasonable time in our scenarios (we are >> working with VGA resolution usually, 640x480). >> >> Anyway, it is important to set a low timeout, as you already >> discovered. Why spend much time looking for the matrix on the current >> preview if maybe it will be easily detected on the next preview frame? >> >> Cheers, >> Alex >> >> On Wed, Jan 19, 2011 at 3:20 AM, Evan Nemerson <li...@co...> wrote: >>> I don't have any experience with the iPhone, or Apple development in >>> general, but most Linux distributions will use -O2 by default and my >>> guess is that this is what Xcode's release profile does. In the case of >>> libdmtx, however, using -O3 makes a *huge* difference, and I haven't >>> seen any errors. I've tried this on Linux AMD64, x86, and ARM. >>> >>> -Evan >>> >>> >>> >>> I haven't tried libdmtx on an iPhone (or xcode), but I have done a bit >>> of investigation of performance elsewhere. Most distributions >>> >>> On Tue, 2011-01-18 at 17:59 +0000, Jarda Kotesovec wrote: >>>> Hi >>>> >>>> I am experimenting with libdmtx on iPhone 3GS. I get image from video >>>> stream and then I pass it to libdmtx to recognise it and if it is not >>>> recognised I capture another image and so on. It works good - it reads >>>> quite small data matrix codes (about 8mm wide). I use timeout option >>>> to don't get stucked for long time when there is no data matrix on >>>> picture. >>>> >>>> Most time consuming is finding data matrix in picture >>>> (dmtxRegionFindNext(dmtxDecode, &timeout) ); >>>> - I can't get better time (setting lower timeout doesn't have affect) >>>> then 3s when there is no data matrix on picture and about 1.5s when >>>> datamatrix is detected. On macbook (2.4Ghz) it takes about 30ms on >>>> picture with same resolution. And surprised me that when I tried to >>>> capture image 200x200px instead of 300x300px it didn't improve >>>> performance - or at least no significantly (I will test this more >>>> tomorrow). I would expect that it will need only half of time when >>>> area is half. >>>> >>>> According to time profiler in xcode are following methods most time consuming: >>>> FindBestSolidLine - 19% >>>> dmtxMatrix3VMultiply - 18.5% >>>> ReadModuleColor - 14.3 % >>>> >>>> And I tried these tests with 'Release' profile in xcode which gives >>>> best performance. >>>> >>>> Have anyone idea how can I tweak performance little bit? Has anyone >>>> tried libdmtx on iPhone? >>>> >>>> Thanks! >>>> >>>> regards >>>> Jarda >>>> >>>> ------------------------------------------------------------------------------ >>>> Protect Your Site and Customers from Malware Attacks >>>> Learn about various malware tactics and how to avoid them. Understand >>>> malware threats, the impact they can have on your business, and how you >>>> can protect your company and customers by using code signing. >>>> http://p.sf.net/sfu/oracle-sfdevnl >>>> _______________________________________________ >>>> libdmtx-development mailing list >>>> lib...@li... >>>> https://lists.sourceforge.net/lists/listinfo/libdmtx-development >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Protect Your Site and Customers from Malware Attacks >>> Learn about various malware tactics and how to avoid them. Understand >>> malware threats, the impact they can have on your business, and how you >>> can protect your company and customers by using code signing. >>> http://p.sf.net/sfu/oracle-sfdevnl >>> _______________________________________________ >>> libdmtx-development mailing list >>> lib...@li... >>> https://lists.sourceforge.net/lists/listinfo/libdmtx-development >>> >> >> ------------------------------------------------------------------------------ >> Protect Your Site and Customers from Malware Attacks >> Learn about various malware tactics and how to avoid them. Understand >> malware threats, the impact they can have on your business, and how you >> can protect your company and customers by using code signing. >> http://p.sf.net/sfu/oracle-sfdevnl >> _______________________________________________ >> libdmtx-development mailing list >> lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libdmtx-development >> > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > libdmtx-development mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libdmtx-development > |