Results 1 to 4 of 4

Thread: Guide for sane support for Avision FB2280E

  1. #1
    Join Date
    Dec 2008
    Beans
    19

    Guide for sane support for Avision FB2280E

    Hello
    Update 21/3 2019. Only color mode are supported. Not gray or lineart. scanimage gives sane_start: Error during device I/O mode. And I have to unplug power on scanner.

    I picked up my new Avision FB2280E yesterday. I had googled a lot before and had hope it should be usable under linux. It can use the same driver as FB2080E but for some unknown reason it's not enabled in sane.

    So this is a note to self, that maybe others find usefull.

    It's based on this pages.

    https://forum.ubuntuusers.de/topic/u...nicht-erkannt/
    https://tovotu.de/blog/546-Buchkante...gitalisierung/


    First we install some tools and download sane-backends



    Code:
    mkdir ~/sane
    cd ~/sane
    sudo apt-get install autopoint autogen libtool shtool autoconf-archive
    sudo apt-get install libusb-dev
    sudo apt install git
    
    git clone https://gitlab.com/sane-project/backends.git
    
    cd backends
    Then I create a patch for avision.c

    Code:
    echo "    " |tee   avision-patch
    echo "    { NULL, NULL," |tee -a  avision-patch
    echo "      0x0638, 0x2a1f," | tee -a  avision-patch
    echo "      \"Avision\", \"FB2280E\"," | tee -a  avision-patch
    echo "      0}," | tee -a  avision-patch
    echo "    /* comment=\"1 pass, 600 dpi, zero-edge\" ASIC 7 */" | tee -a  avision-patch
    echo "    " |tee  -a avision-patch
    Next step are a little hack. I find a linenumber just above the FB2080E
    and insert the patch there.

    Code:
    line=`cat -n backend/avision.c| grep -B 3 FB2080 |head -n1|tr -d ' '`
    insert above patch at linenumber(be carefull here)
    printf "%s\n" "${line}r avision-patch" w |ed -s  backend/avision.c
    Time to built. Look out for error on missing dependencies.
    Code:
    ./autogen.sh
    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
    make
    sudo make install
    The libearies libsane-avi* needs to be accessible by sane. I just copy all of them.
    Code:
    sudo cp -v -a /usr/lib/sane/* /usr/lib/x86_64-linux-gnu/sane/
    Check that they are linking correct. The should now link like this (there are a few more files here)
    Code:
    ls -l /usr/lib/x86_64-linux-gnu/sane/libsane-avi* 
    /usr/lib/x86_64-linux-gnu/sane/libsane-avision.so.1 -> libsane-avision.so.1.0.29
    #check also libsane-dll*
    ls -l /usr/lib/x86_64-linux-gnu/sane/libsane-dll*
    /usr/lib/x86_64-linux-gnu/sane/libsane-dll.so -> libsane-dll.so.1.0.29
    Test scanimage -V
    Code:
    scanimage -V
    scanimage (sane-backends) 1.0.29-293-g1ed4c7d8-dirty; backend version 1.0.29

    Now I was able to scan as sudo user!
    Code:
    sudo scanimage -d 'avision' --format pnm > out.pnm
    But, not as normal user. I add a few more steps.

    Making a new patch. I'm still in the same folder.

    Code:
    echo '' |  tee  patch.txt
    echo ':model "FB2280E"' |  tee -a patch.txt
    echo ':interface "USB"' |  tee -a patch.txt
    echo ':usbid "0x0638" "0x2a1f"' |  tee -a patch.txt
    echo ':comment "1 pass, 600 dpi, zero-edge" ASIC 7' |  tee -a patch.txt
    echo ':status :basic' |  tee -a patch.txt

    Patching
    Code:
    sed -i '/:mfg "Avision"/ r patch.txt'  doc/descriptions/avision.desc
    Generating hwdb file
    Code:
    tools/sane-desc -s doc/descriptions -m hwdb |sudo tee /lib/udev/hwdb.d/20-sane.hwdb

    Creating udev-rules
    Code:
    echo 'ATTRS{manufacturer}=="AVISION", DRIVERS=="usb", SUBSYSTEM=="usb", ATTRS{idVendor}=="0638", ATTRS{idProduct}=="2a1f", ENV{libsane_matched}="yes", MODE="0777"' | sudo tee -a /etc/udev/rules.d/55-udev-avision.rules

    Some add the device to /etc/sane.d/avision.conf
    #usb 0x0638 0x2a1f
    Don’t do that. it will give a warning like this when running scanimage
    [avision] attach: "AVISION" - "FB2280E" not yet in whitelist!”

    #reboot or
    Code:
    sudo udevadm control --reload-rules 
    sudo udevadm trigger
    And we can now scan
    Code:
    scanimage -d 'avision' --format pnm > out.pnm
    At least until next update.
    I had some problems when I tried to figure out this. I set this debug variable, and it was great help.
    Code:
    export SANE_DEBUG_DLL=255
    I have not tested the scanner much yet. I just had to document everything when it was fresh in mind. Hope someone find this usefull.
    Last edited by lt_gustavsen; 3 Days Ago at 06:30 AM.

  2. #2
    Join Date
    Dec 2008
    Beans
    19

    Re: Guide for sane support for Avision FB2280E

    I primarily bought this scanner for book scanning. But I had to test the photo capabilities.Straight out of the scanner the photos are washed out. Fortunately have I a scan target and a spectrometer somewhere....
    Output from command
    Code:
    scanimage -d 'avision'  --resolution 600 --format tiff    --mode "16bit Color"    | convert -   -rotate 90 albumsheet.jpg

    Full size

    After scanning the target and creating a profile with argyllcms, I got this output. No other processing applied.
    Code:
    scanimage -d 'avision'  --resolution 600 --format tiff    --mode "16bit Color"  -i Avision_FB2280E.icc   | convert - -intent Relative -black-point-compensation -profile  /usr/share/color/icc/colord/sRGB.icc  -rotate 90 albumsheet-color-corrected.jpg

    Full size

    This color profile may work with FB2080E also.
    You can find it here.

  3. #3
    Join Date
    Dec 2008
    Beans
    19

    Re: Guide for sane support for Avision FB2280E

    Scanning time
    Just some more info:
    Scanning time in seconds for color scan:
    Code:
    Resolution   Full page   Novel page
    100          3.42        3.12
    200          3.44        3.12
    300          3.46        3.11
    301          9.78        7.77
    350          9.79        7.78
    400          9.82        7.78
    500          9.85        7.78
    600          9.87        7.78

    Scanned quality
    I scanned 11 page from a novel where I found a sample chapter at the publisher. Then I was able to compare the quality. For the quality control I used ocrevalutf8 from https://github.com/ryanfb/ancientgre...aluation-tools I created my groundtruth file like this: It was a two colum paged file.
    Code:
    k2pdfopt -mode 2col sample_chapter.pdf
    ~/Downloads/xpdf-tools-linux-4.02/bin64/pdftotext   -layout  -enc UTF-8 sample_chapter_k2opt.pdf - > groundtruth.txt
    Accuracy check was done like this:
    Code:
    ocrevalutf8 accuracy  groundtruth.txt 100pbm.txt |head -n 5
    ocrevalutf8 wordacc groundtruth.txt 100pbm.txt |head -n 5


    Code:
    Reolution UT*    TT*              pbm            pgm            ppm
                                       Accuracy/
                                                      A/W            A/W
                                       Wordaccuracy
    100       3.2    6/5.5/6.3        98.44/ 94.44   99.35/ 98.52   99.29/ 98.23
    200       11.2   9.6/10/13.2      99.48/ 99.06   99.49/ 99.09   99.47/ 99.06
    300       23.2   10.7/13.1/18.6   99.47/ 99.02   99.49/ 99.14   99.49/ 99.14
    400       38.7   12.5/16.4/27.9   99.48/ 99.11   99.50/ 99.16   99.58/ 99.16
    500       58     14.8/21.5/35.6   99.48/ 99.14   99.49/ 99.11   99.48/ 99.14
    600       87.7   18/26.2/44       99.48/ 99.16   99.48/ 99.16   99.48 / 99.11
    UT. Average unpaper processing time all 11 sheets from a novel. Ppm time was the fastest, but newer more than 1sec faster.
    TT. Average tesseract processing time

    I'm very impressed by the quality of tesseract.

    My full processing workflow was like this:

    #unpaper step
    Code:
    $ls -d */
    $100/  200/  300/  400/  500/  600/
    $ls 100/
    page006.tif  page008.tif  page010.tif  page012.tif  page014.tif  page016.tif
    page007.tif  page009.tif  page011.tif  page013.tif  page015.tif  page017.tif
    
    mkdir 100/pbm 100/pgm 100/ppm
    #Next line 3 times for every resolution, pbm,pgm and ppm
    alias unptime="unpaper -t pgm  -start 6 100/page%03d.tif 100/pgm/unpaper%03d.pgm"
    time unptime
    Ocr was done like this:
    Code:
    ls 100/pbm/un* > files
    alias tesstt="tseseract -l nor --dpi 100 files 100pbm txt"
    time tesstt

    Just a little update. Quite exited with the results from tseseract I had to test it against a couple of competitors. I have access to Adobe Acrobat DC (not pro) at work. I only testedt the 300 dpi pgm source.
    The results where
    accuracy 98.05%
    wordacc 95.18%

    I also found out there was somthing called Azure Cognitive Services from microsoft with Computer Vision API , it was free for one year. The problem was it outputed json file, and not one of the knowen ocr formats. So I hacked together something. It's very basic and only ment for my whises to convert scanned novel pages. The script extract all the json lines boundingBoxes and creates a fig file (xfig package). This file are converted to pdf and text are extracted. Very basic, and use with care.
    Scrip as txt or zip.

    Anyway results are:
    accuracy 99.10% Accuracy
    wordacc 99.10% Accuracy
    Last edited by lt_gustavsen; April 1st, 2020 at 09:30 AM.

  4. #4
    Join Date
    Dec 2008
    Beans
    19

    Re: Guide for sane support for Avision FB2280E

    Just a simple video describing the scanning process. Sorry for missing English.
    https://www.youtube.com/watch?v=15qR8KUzVa4&

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •