討論區: English (Thread #11074)

Significant speed improvement (2006-05-15 04:36 by drhu00 #21884)

By remove all the set, get, translate method from Point.java, Axis.java and Line.java and set all the attribute to public, I rewrite all code using direct call to the attribute.
Guess how much speed we gain? Here is the my test results of decode:

cc3.jpg 640x480 before 43 sec reduce to 6 sec.
cc5.jpg 640x480 before 59 sec reduce to 7 sec.

For any image 200x200, the decode only take 1 sec.

I am very surprised by this improvement.
You can download the source code in http://www.drhu.org/QRCode/QRCode.html
and test yourself.

I also zipped the image test package and you can download that also.

For J2ME application, decode rate and speed are two most important features. Who care's about the public attribute or not.

Yanbe, maybe you can put my J2ME souce code in the download page, it is based on version 0.5.

回覆 #21884×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入

RE: Significant speed improvement (2006-05-15 05:02 by umbalaconmeogia #21885)

Get out the QR symbol image area from the input image if you can, and process the decoding on it instead of the entire image. It will improve the speed.
回覆: #21884

回覆 #21885×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入

RE: Significant speed improvement (2006-05-15 06:35 by drhu00 #21886)

But how do you get out the no QR symbol image area?
回覆: #21884

回覆 #21886×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入

RE: Significant speed improvement (2006-05-15 08:33 by 匿名 #21888)

On the black/white image, Just scan from the top, left, right, bottom to the opposite site until you reach the black point. Then you get "the frame" of the qr code image area. Decoding this area is slightly faster than decoding the entire image.
回覆: #21886

回覆 #21888×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入

RE: Significant speed improvement (2006-05-15 10:11 by drhu00 #21890)

Since we are dealing with camera captured image, it's hard to determine the opposite site unless you do a pre image processing
回覆: #21888

回覆 #21890×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入

RE: Significant speed improvement (2006-05-18 02:49 by umbalaconmeogia #21961)

I don't understand what you are saying but what I did to pre-rotate the image is following:
1. Binarize the image to get the black-white image (same as the thing you did in the QRCodeDecoder.java or by another binarization algorithm).
2. Scan to get the smallest FRAME that surrounds all the black pixels (what I said above).
3. I try to detect three PDP corner points (it needs some stricks here), and detect the rotating angle of the QR code image.
4. Rotate the FRAME and do as (2) above to get the QR code image are.

Notice that the FRAME at (2) not surrounds tightly the QR code image. All of its sides are parallel with the entire image's sides. After rotating, the QR code image's sides are parallel with the entire image's sides, and the sides of the FRAME at (2) turn to the same direction with the sides of the QR code image before.

This seems to work well. I display the pre-rotated image on the screen and its direction looks good. But all the image binarization that I tried is not good enough to deal with the rotated image, so the qr code could not be decoded. And I threw this pre-rotating away.
回覆: #21890

回覆 #21961×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入