zoukankan      html  css  js  c++  java
  • 车牌识别--S5PV210測试第二次优化

    优化:

    1、RGB转HSV 浮点运算改成定点运算;

    2、匹配模板由图片改成C语言数组;

    3、优化測试BMP车牌图片读取(两层for循环改为一层for循环)。

    总体相比优化之前时间降低110ms左右。

    640x480: 160ms 左右

    320x240: 55ms 左右

    [liujia@210]#./car test/1.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ A F Q 7 8 7
    
    
    
    
    Total Time: time use:158ms
    [liujia@210]#./car test/2.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ A 8 S 3 0 8
    
    
    
    
    Total Time: time use:162ms
    [liujia@210]#./car test/3.bmp
    BMP Size:230454, Info_length:54, H:320, W:240
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ A G F 7 5 1
    
    
    
    
    Total Time: time use:57ms
    [liujia@210]#./car test/4.bmp
    BMP Size:230454, Info_length:54, H:320, W:240
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ A 8 S 3 0 8
    
    
    
    
    Total Time: time use:55ms
    [liujia@210]#./car test/5.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ M 0 7 3 6 9
    
    
    
    
    Total Time: time use:141ms
    [liujia@210]#./car test/6.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ A 6 Y 2 6 8
    
    
    
    
    Total Time: time use:163ms
    [liujia@210]#./car test/7.bmp
    BMP Size:230454, Info_length:54, H:320, W:240
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ A 9 X 6 6 7
    
    
    
    
    Total Time: time use:59ms
    [liujia@210]#./car test/8.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ A P 6 8 3 8
    
    
    
    
    Total Time: time use:186ms
    [liujia@210]#./car test/9.bmp
    BMP Size:879414, Info_length:54, H:640, W:458
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ A F N 5 5 3
    
    
    
    
    Total Time: time use:167ms
    [liujia@210]#./car test/10.bmp
    BMP Size:1004214, Info_length:54, H:640, W:523
    
    
    
    
    
    
    The Car ID IS:
    Íî J 0 8 0 3 6
    
    
    
    
    Total Time: time use:169ms
    [liujia@210]#./car test/11.bmp
    BMP Size:1035978, Info_length:54, H:665, W:519
    
    
    
    
    
    
    The Car ID IS:
    ËÕ B H 6 0 8 2
    
    
    
    
    Total Time: time use:172ms
    [liujia@210]#./car test/12.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ A F Z 9 0 5
    
    
    
    
    Total Time: time use:172ms
    [liujia@210]#./car test/13.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    
    
    
    The Car ID IS:
    ÔÁ A A D 2 6 3
    
    
    
    
    Total Time: time use:172ms
    

    眼下影响时间的问题,已经不是浮点了。而是大量的for循环中的运算,60%的时间都使用在车牌定位中。 一旦车牌定位后。后面的字符切割和匹配使用10ms左右时间。就能够完毕。


    对照測试使用的笔记本I3-380cpu,虚拟机执行结果

    640X480:27ms左右

    320x240:    9ms左右

    root@lj:/work/carid/0532# ./car test/1.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    ▒▒ A F Q 7 8 7
    
    
    Total Time: time use:27ms
    root@lj:/work/carid/0532# ./car test/2.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    ▒▒ A 8 S 3 0 8
    
    
    Total Time: time use:103ms
    root@lj:/work/carid/0532# ./car test/3.bmp
    BMP Size:230454, Info_length:54, H:320, W:240
    
    
    
    The Car ID IS:
    ▒▒ A G F 7 5 1
    
    
    Total Time: time use:9ms
    root@lj:/work/carid/0532# ./car test/4.bmp
    BMP Size:230454, Info_length:54, H:320, W:240
    
    
    
    The Car ID IS:
    ▒▒ A 8 S 3 0 8
    
    
    Total Time: time use:9ms
    root@lj:/work/carid/0532# ./car test/5.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    ▒▒ M 0 7 3 6 9
    
    
    Total Time: time use:23ms
    root@lj:/work/carid/0532# ./car test/6.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    ▒▒ A 6 Y 2 6 8
    
    
    Total Time: time use:33ms
    root@lj:/work/carid/0532# ./car test/7.bmp
    BMP Size:230454, Info_length:54, H:320, W:240
    
    
    
    The Car ID IS:
    ▒▒ A 9 X 6 6 7
    
    
    Total Time: time use:9ms
    root@lj:/work/carid/0532# ./car test/8.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    ▒▒ A P 6 8 3 8
    
    
    Total Time: time use:28ms
    root@lj:/work/carid/0532# ./car test/9.bmp
    BMP Size:879414, Info_length:54, H:640, W:458
    
    
    
    The Car ID IS:
    ▒▒ A F N 5 5 3
    
    
    Total Time: time use:25ms
    root@lj:/work/carid/0532# ./car test/10.bmp
    BMP Size:1004214, Info_length:54, H:640, W:523
    
    
    
    The Car ID IS:
    ▒▒ J 0 8 0 3 6
    
    
    Total Time: time use:27ms
    root@lj:/work/carid/0532# ./car test/11.bmp
    BMP Size:1035978, Info_length:54, H:665, W:519
    
    
    
    The Car ID IS:
    ▒▒ B H 6 0 8 2
    
    
    Total Time: time use:27ms
    root@lj:/work/carid/0532# ./car test/12.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    ▒▒ A F Z 9 0 5
    
    
    Total Time: time use:27ms
    root@lj:/work/carid/0532# ./car test/13.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    ▒▒ A A D 2 6 3
    
    
    Total Time: time use:25ms
    


    对照ME865(OMAP4430)

    640x480:130ms左右

    320x240:50ms左右

    root@edison:/data # ./car /sdcard/test/1.bmp
    ./car /sdcard/test/1.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    粤 A F Q 7 8 7
    
    
    Total Time: time use:122ms
    root@edison:/data # ./car /sdcard/test/2.bmp
    ./car /sdcard/test/2.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    粤 A 8 S 3 0 8
    
    
    Total Time: time use:125ms
    root@edison:/data # ./car /sdcard/test/3.bmp
    ./car /sdcard/test/3.bmp
    BMP Size:230454, Info_length:54, H:320, W:240
    
    
    
    The Car ID IS:
    粤 A G F 7 5 1
    
    
    Total Time: time use:50ms
    root@edison:/data # ./car /sdcard/test/4.bmp
    ./car /sdcard/test/4.bmp
    BMP Size:230454, Info_length:54, H:320, W:240
    
    
    
    The Car ID IS:
    粤 A 8 S 3 0 8
    
    
    Total Time: time use:42ms
    root@edison:/data # ./car /sdcard/test/5.bmp
    ./car /sdcard/test/5.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    粤 M 0 7 3 6 9
    
    
    Total Time: time use:94ms
    root@edison:/data # ./car /sdcard/test/6.bmp
    ./car /sdcard/test/6.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    粤 A 6 Y 2 6 8
    
    
    Total Time: time use:134ms
    root@edison:/data # ./car /sdcard/test/7.bmp
    ./car /sdcard/test/7.bmp
    BMP Size:230454, Info_length:54, H:320, W:240
    
    
    
    The Car ID IS:
    粤 A 9 X 6 6 7
    
    
    Total Time: time use:51ms
    root@edison:/data # ./car /sdcard/test/8.bmp
    ./car /sdcard/test/8.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    粤 A P 6 8 3 8
    
    
    Total Time: time use:132ms
    root@edison:/data # ./car /sdcard/test/9.bmp
    ./car /sdcard/test/9.bmp
    BMP Size:879414, Info_length:54, H:640, W:458
    
    
    
    The Car ID IS:
    粤 A F N 5 5 3
    
    
    Total Time: time use:124ms
    root@edison:/data # ./car /sdcard/test/10.bmp
    ./car /sdcard/test/10.bmp
    BMP Size:1004214, Info_length:54, H:640, W:523
    
    
    
    The Car ID IS:
    皖 J 0 8 0 3 6
    
    
    Total Time: time use:171ms
    root@edison:/data # ./car /sdcard/test/11.bmp
    ./car /sdcard/test/11.bmp
    BMP Size:1035978, Info_length:54, H:665, W:519
    
    
    
    The Car ID IS:
    苏 B H 6 0 8 2
    
    
    Total Time: time use:207ms
    root@edison:/data # ./car /sdcard/test/12.bmp
    ./car /sdcard/test/12.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    粤 A F Z 9 0 5
    
    
    Total Time: time use:204ms
    root@edison:/data # ./car /sdcard/test/13.bmp
    ./car /sdcard/test/13.bmp
    BMP Size:921654, Info_length:54, H:640, W:480
    
    
    
    The Car ID IS:
    粤 A A D 2 6 3
    
    
    Total Time: time use:138ms


  • 相关阅读:
    ***:做人的基本原则(看完终身受益)
    ref和out的相同和不同的讨论
    关于继承和虚函数的入门讨论
    C#中利用ArrayList来对索引器访问越界情况进行内容的扩充处理
    [C#]实现IEnumerable接口来使用foreach语句的一个实例
    浅谈MSSQL锁机制
    jQuery图片分屏加载技术插件
    SET IDENTITY_INSERT [Table] [ON|OFF]
    SQL Server DATEPART() 函数
    常用的SQL语句对数据库进行操作
  • 原文地址:https://www.cnblogs.com/gcczhongduan/p/5145609.html
Copyright © 2011-2022 走看看