Leakage Current from Iseg: Difference between revisions

From HELIOS Digital DAQ
Jump to navigation Jump to search
(Created page with "= Overview = The iseg HV is controlled by the windowsXP machine with a software provided from Iseg. It may be impossible to get the HV reading directly (may be search for t...")
 
No edit summary
Line 6: Line 6:


Another way around is using OCR (optical Character Recognition) program to extract the leakage current.
Another way around is using OCR (optical Character Recognition) program to extract the leakage current.
= Require programs =
*The Google Tesseract-OCR Engine,
*python package Pillow, image processing program
*python pytesseract https://pypi.org/project/pytesseract/
in Mac, using brew can install the Tesseract, and using python3 pip for Pillow
= Program idea =
The program is called OCR.py, only work in python3
# remote desktop to the windowsXP, make it fullscreen (can be not fullscreen, but the code need modification)
# capture the screenshot of the remote desktop
# crop the Iseg control window
# find the position of the "C" in "Channel" using the OCR engine, use the coordinate of the "C" as an anchor.
# crop the leakage current for each channel
# save the leakage current into influxDB format
# push to the database
= Caution =
* the program only work in Mac
* The Iseg windows must be at the upper left corner of the windowsXP
* for the Mac to capture the screenshot, the window ID is needed. There is no easy way to find the window ID in Mac.
* the OCR may fail to recognize the number, or missed the "dot" for decimal place, in that case, the data will be discarded.
= find the window ID in Mac =
we have to use the Quartz Debug in the Additional tools for Xcode. I already downloaded it and put it in the Applications.
Once open the Quartz debug, on the manual bar -> Window -> Windows List
the window list will open, find the "Microsoft Emote Desktop". There should be two, convert the hex to dec, one of them is correct.

Revision as of 02:32, May 5, 2021

Overview

The iseg HV is controlled by the windowsXP machine with a software provided from Iseg.

It may be impossible to get the HV reading directly (may be search for the memory?)

Another way around is using OCR (optical Character Recognition) program to extract the leakage current.

Require programs

in Mac, using brew can install the Tesseract, and using python3 pip for Pillow

Program idea

The program is called OCR.py, only work in python3

  1. remote desktop to the windowsXP, make it fullscreen (can be not fullscreen, but the code need modification)
  2. capture the screenshot of the remote desktop
  3. crop the Iseg control window
  4. find the position of the "C" in "Channel" using the OCR engine, use the coordinate of the "C" as an anchor.
  5. crop the leakage current for each channel
  6. save the leakage current into influxDB format
  7. push to the database

Caution

  • the program only work in Mac
  • The Iseg windows must be at the upper left corner of the windowsXP
  • for the Mac to capture the screenshot, the window ID is needed. There is no easy way to find the window ID in Mac.
  • the OCR may fail to recognize the number, or missed the "dot" for decimal place, in that case, the data will be discarded.

find the window ID in Mac

we have to use the Quartz Debug in the Additional tools for Xcode. I already downloaded it and put it in the Applications.

Once open the Quartz debug, on the manual bar -> Window -> Windows List

the window list will open, find the "Microsoft Emote Desktop". There should be two, convert the hex to dec, one of them is correct.