Convert a video of a power monitor into a CSV file containing a frame per row and the following columns:
- Frame number
- Timestamp (seconds)
- Voltage (V)
- Current (A)
- Power (W)
- Power Factor (%)
- Total Power Usage (kWh)
- Oneshot Power Usage (kWh)
- Total Electricity Bill ($)
- Oneshot Electricity Bill ($)
- A ZHURUI PR10 Power Recorder which can be found here
- Note: To use a different device/user interface, modify the regular expression in Step 3
- A camera to capture a video of the screen
- A 64-bit Windows machine
- Install Python3 and Tesseract (64-bit) (from here)
- Record the video and save it as
video.mp4
- Double click on
step1_video_to_frames.bat
to generate theframes
folder containing each frame in .jpg format - Double click on
step2_frames_to_readtext.bat
to convert the frames intoreadtext
.txt files using Tesseract - Double click on
step3_readtext_to_csv.bat
to process the text files using a regular expression, generatingoutput.csv
- The script will skip invalid frames
- Double click on
step4_cleanup_output_file.bat
to the top and bottom X percentile of the data, generatingfinalOutput.csv
- Repeat this step, tweaking
percentileAmount
to be as low as possible to maintain the data quality (by looking at the minimum and maximum values after running the script), andcolumnsToInclude
which enumerated the columns in the data, and only considers those marked as "1".
- Repeat this step, tweaking
- You will have now generated
finalOutput.csv
.