Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
uvscada:gxs700 [2017/12/31 19:04] mcmasteruvscada:gxs700 [2017/12/31 19:19] – [Calibration] mcmaster
Line 170: Line 170:
 Takes raw, uncalibrated images.  I've been asked a few times if I could provide calibration files for the Windows driver or could even use their calibration files on my driver.  However, I'm not really interested in supporting their proprietary format. If someone submits a patch though I'll probably merge it in. Takes raw, uncalibrated images.  I've been asked a few times if I could provide calibration files for the Windows driver or could even use their calibration files on my driver.  However, I'm not really interested in supporting their proprietary format. If someone submits a patch though I'll probably merge it in.
  
-There is a a quick and dirty scheme though. First, take a dark field capture, that is a capture with no x-rays. Use something like:+===== cal.py flow ===== 
 + 
 +Quick scheme to get rid of the worst artifacts 
 + 
 +Basic idea: 
 +  - Capture dark field frame (no x-ray) to get the lowest possible pixel value 
 +  - Capture flat field frame (x-ray with no object) to get the highest possible pixel value 
 +  - Rescale images to range found above 
 + 
 +Notes: 
 +  * Decoded images invert pixel values (per x-ray industry convention), so high and low are relative 
 +  * As of late 2017 capture.py now spits out a sensor .json file with each image. Hopefully the scanner will add this soon as well 
 +  * As of this writing no bad pixel replacement is done 
 + 
 + 
 +==== 1: Capture dark field ==== 
 + 
 +First, take a dark field capture using something like:
  
   $ gxs700-capture -f -e   $ gxs700-capture -f -e
Line 176: Line 193:
 This should yield a raw picture that looks something like this: This should yield a raw picture that looks something like this:
  
-{{:uvscada:gxs700:cal:df.jpg?200|}}+{{:uvscada:gxs700:cal:df.jpg?300|}}
  
 And histogram equalized looks like this: And histogram equalized looks like this:
  
-{{:uvscada:gxs700:cal:dfe.jpg?200|}}+{{:uvscada:gxs700:cal:dfe.jpg?300|}} 
 + 
 + 
 +==== 2: Capture flat field ====
  
 Now make sure the sensor and the x-ray head have the exact same position and settings you will use to take your actual image capture. Make sure there is nothing in the beam and do a standard capture (and also firing the x-ray head): Now make sure the sensor and the x-ray head have the exact same position and settings you will use to take your actual image capture. Make sure there is nothing in the beam and do a standard capture (and also firing the x-ray head):
Line 188: Line 208:
 This produces a flat field image like this: This produces a flat field image like this:
  
-{{:uvscada:gxs700:cal:ff.jpg?200|}}+{{:uvscada:gxs700:cal:ff.jpg?300|}}
  
 Which might look like this when histogram equalized: Which might look like this when histogram equalized:
  
-{{:uvscada:gxs700:cal:ffe.jpg?200|}}+{{:uvscada:gxs700:cal:ffe.jpg?300|}} 
 + 
 +For best results you should also let the sensor and x-ray head sit a while to warm up. I'm not sure how long matters, but maybe 10 minutes would be good 
 + 
 + 
 +==== 3: Capture data ==== 
 + 
 +ie using capture.py or xray_plan_cli.py 
 + 
 +Put your sample in and use the exact setup as the flat field to capture data. Don't move the sensor or x-ray head 
 + 
 + 
 +==== 4: Correct images ==== 
 + 
 +run something like 
 + 
 +  $ python cal.py  df.png ff.png png cal 
 + 
 +Where: 
 +  * df.png is your dark field capture 
 +  * ff.png is your flat field capture 
 +  * png is a directory with your images to be corrected 
 +  * cal is the output directory with corrected images 
 + 
 +Here is a raw image as captured: 
 + 
 +{{:uvscada:gxs700:cal:ex_raw.jpg?300|}} 
 + 
 +And with histogram equalization: 
 + 
 +{{:uvscada:gxs700:cal:ex_raw_e.jpg?300|}} 
 + 
 +Now the corrected image: 
 + 
 +{{:uvscada:gxs700:cal:ex_out.jpg?300|}} 
 + 
 +And it with histogram equalization:
  
 +{{:uvscada:gxs700:cal:ex_out_e.jpg?300|}}
  
 ====== Quality ====== ====== Quality ======
 
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki