Surprise ending: the Dominion Voting Co. source code I viewed has over 2.5 million lines of code. Instantly that told me Dominion is using their machines to cheat and steal elections. From a recent conversation with the extraordinary Jeff O'Donnell (The Lone Racoon), quoting "If I ever take more than 50,000 lines of code to do anything, fire me". I went ahead and did it; below is my coding using Python language. This code reads the marked ovals on a scanned paper ballot image. It can process up to 100,000 ballots, tally up the responses, and generate a report summarizing the results. It uses the pandas' library to create a DataFrame for the report and then saves it to a CSV file. Then I would adjust the answer_key dictionary according to test sheet layout and provide the paths to the test sheet images in the test_sheet_paths list. Here is the code, (mine, not Dominion's):
import cv2
import numpy as np
import pandas as pd
from collections import defaultdict
def detect_ovals(image):
# Convert image to grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Apply Gaussian blur to reduce noise
blurred = cv2.GaussianBlur(gray, (5, 5), 0)
# Detect edges using Canny edge detector
edges = cv2.Canny(blurred, 50, 150)
# Find contours
contours, _ = cv2.findContours(edges.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
ovals = []
# Loop over contours
for contour in contours:
# Approximate the contour to a polygon
peri = cv2.arcLength(contour, True)
approx = cv2.approxPolyDP(contour, 0.02 * peri, True)
# If the contour has 4 vertices (approximation for oval) if len(approx) == 4:
ovals.append(approx.reshape(-1, 2))
return ovals
def read_marked_ovals(test_sheet_path, answer_key):
image = cv2.imread(test_sheet_path)
ovals = detect_ovals(image)
responses = defaultdict(int)
for oval in ovals:
x, y, w, h = cv2.boundingRect(oval)
oval_center = (x + w // 2, y + h // 2)
# Check if the oval is marked
# Assuming marked ovals are detected by some thresholding technique
if is_marked(image[y:y+h, x:x+w]):
# Find the closest answer option based on the center of the oval
closest_option = min(answer_key.keys(), key=lambda option: abs(answer_key[option][0] - oval_center[0]))
# Increment the count for the selected option
responses[closest_option] += 1
return responses
def is_marked(oval_image):
# Perform some thresholding or other technique to determine if the oval is marked
# For simplicity, let's assume if the oval area is not too bright, it's marked
return cv2.mean(oval_image)[0] < 200
def generate_report(responses):
report = pd.DataFrame.from_dict(responses, orient='index', columns=['Count'])
report.index.name = 'Option'
report.sort_index(inplace=True)
return report
def process_test_sheets(test_sheets, answer_key):
total_responses = defaultdict(int)
for test_sheet_path in test_sheets:
responses = read_marked_ovals(test_sheet_path, answer_key)
for option, count in responses.items():
total_responses[option] += count
return total_responses
# Example usage
answer_key = {
'A': (100, 200), # Coordinates of the center of the oval representing option A
'B': (200, 200), # Coordinates of the center of the oval representing option B
# Add more options as needed } test_sheet_paths = ['test_sheet_{}.jpg'.format(i) for i in range(1, 100001)] # Example test sheet paths
responses = process_test_sheets(test_sheet_paths, answer_key)
report = generate_report(responses)
print(report)
report.to_csv('test_results.csv') # Save report to a CSV file You know how many lines of code these tasks took? 77 lines. I did it in 77 lines yet Dominion has 2,500,000+ lines of code in its software/firmware. Citizens: send a question in writing to your local, county and state level election clerks/Sec. of States. Ask them if they have ever seen the source code for their tabulators, for their voting machines, for their EMS (Election Management System at the county). 100% guaranteed none of them - repeat none - of them have. So private companies are counting our votes who won't let us see the source code. (side comment: a few states require source code testing such as Texas, California - at least the did). But here is the real truth: ES&S and Dominion have several sets of source code. Which one do you think they supply to the states who require testing by outside IT people? Yep, the source code they WANT the outside IT experts to see. A very important word which will be at the center of attention in the future: lab.