Forums: English (Thread #11179)

Improve image process (2006-05-22 01:00 by drhu00 #22178)

When examining the image process, I find that it not efficient. There are so many entire image loop. The first one is in QRCodeUtility parseImage. The second one is in imageToGrayScale. The third one is in findAreaMiddle. The fourth is in grayScaleToBitmap. The basic idea convert from image RGB value to bitmap is to a good halftone. Since QR image is black (RGB value =0) and white (RGB value = 255), therefore the default halftone is 255/2=127 which is good enough for most image. When doing snapshot, the minRGB value is always 0, and the maxRGB value is most likely around 200. And therefore a good guess of halftone is 100. It's too time-consuming to execute grayScaleToBitmap, especially with a large value of numSqrtArea. Using the logical of findAreaMiddle of an image is not help too much for QR decoding in my experience.

I am thinking of give the end user the option to choice the halftone which is fit to the category pre-image processing (including the rotation, cut edge etc). In this way, we can reduce the loop to one. I tested to set the halftone =100, and it works great. The speed improved.

Répondre à 22178×

You can not use Wiki syntax
Vous n'êtes pas connecté. Pour distinguer vos messages en provenance du reste, vous devez choisir un surnom. (L'unicité du surnom est pas réservé. Il est possible que quelqu'un d'autre pourrait utiliser exactement le même surnom. Si vous voulez l'assurance de votre identité, nous vous recommandons de vous connecter avant de poster.) Connexion