Giter Site home page Giter Site logo

faxitron's People

Contributors

johndmcmaster avatar spirit532 avatar travisgoodspeed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

faxitron's Issues

Review bad pixel replace

Think it isn't working correctly near edges. Also performance could be significantly improved

Review histogram equalization

Observation: when bad pixel replace is enabled on a mostly white image, the resulting equalized image is basically white. I suspect this is due to a hot pixel throwing off the dynamic range, but should confirm (maybe related to the corner issue)

When I use ImageMagick's dynamic algorithm (mine is not) it produces good images though. Ex: convert 2019-12-27_23_1.png ( +clone -equalize ) -average 2019-12-27_23_1_ei.png

Also consider switching to ImageMagick entirely if it produces nicer images in general

2019-12-27_23_1_e
Above: no BPR, faxitron equalization

2019-12-27_23_1_ei
Above: no BPR, ImageMagick equalization

2019-12-27_23_bpr_e
Above: BPR, faxitron equalization

2019-12-27_23_bpr_ei
Above: BPR, ImageMagick equalization

New user report

Hi John,
While I have been working on reversing the USB comms for a while on my MX-20 with DC12 sensor, came across your work. Am impressed how far you've already got! Besides the easily fixable deprecated numpy issues, it all works except serial comms doesn't want to turn on the tube. I checked my code and it's the same sequence !B -> X then C -> P. Need to check what is going on with that, but just wanted to say Thanks :)
p.s.: if you need any pcap dumps or something else to develop the code further, let me know.

Improve high noise histogram equalization

When a sample is really thick, it signal becomes small and the workflow relies on the relatively high bit depth (native 14, averaged to 16) + histogram equalization to get decent images. However, its currently limited by, after averaging, the data is truncated to 16 bit during histogram equalization. To get the full sensor range, need to calibrate the sensor to higher precision. This may require hacks to get additional bits on image data, such as shifting up and/or creating a second image file with LSB

Numpy 1.24 Compatibility

As of 1.20, Numpy deprecated np.float, and in 1.24, Numpy dropped it entirely. Attempting to fix the problem with s/np.float/float/ resolves that problem, but then the normed parameter is not a part of np.histogram. Cutting the normed parameter out of the call to histogram then restores functionality.

As a temporary workaround, pip install "numpy<1.24" can downgrade the Numpy installation to the last compatible version.

Capture usb bulk transfer protocol instability

I quickly looked at the USB bulk transfer protocol and made a quick guess as to where the image vs metadata is. It seems to work for me so I decided it was good enough. However, Alexander Hude
is doing some early testing and can't use it reliably as is. Specifically I think an assertion failed reporting more data than we expect

The current code is very basic:

    pack2 = bulkRead(0x82, 0x4000)
    assert len(pack2) == 2, len(pack2)
    hexdump(pack2)
    
    buff = bytearray()
    while True:
        pack = bulkRead(0x82, 0x4000)
        if len(pack) == 6:
            return pack2, buff
        else:
            buff += pack

And then I truncate the resulting buffer, taking off the last two bytes. The very first packet might have the number of packets or something of that sort.

DC3 support

I've managed to obtain a DX-50 with the DC3 option (Hamamatsu C9266-03).

USB VID: 0x0661
USB PID: 0x3400

dmesg output:

[440265.698953] usb 1-2.4: New USB device found, idVendor=0661, idProduct=3400, bcdDevice= 0.00
[440265.698955] usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[440265.698957] usb 1-2.4: Product: HPK C9266-03
[440265.698958] usb 1-2.4: Manufacturer: HPK

Since it's not a DC5 or DC12, dump.py fails with the following:

Writing to dump/2021-07-14_03

Sensor
Traceback (most recent call last):
  File "dump.py", line 68, in <module>
    main()
  File "dump.py", line 38, in main
    h = ham.Hamamatsu(init=False)
  File "/home/arthur/PiSync/faxitron/faxitron/ham.py", line 754, in __init__
    self.dev = open_dev(self.usbcontext)
  File "/home/arthur/PiSync/faxitron/faxitron/ham.py", line 743, in open_dev
    raise Exception("Failed to find a device")
Exception: Failed to find a device

What changes are needed to add DC3 support? Is it just a matter of adding the USB PIDs to ham.py?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.