This is a gerrymander project for Precal (Shaun)
Gene Wicaksono
Rocky Shao
Lucas Matthingly
input an image and determine:
(1) the compactness of this district
(2) the solidity of this district
1.download python 3 at https://www.python.org/downloads/
2.download an IDE that supports python
3.create a new empty folder
4.click on the folder once, then right click the folder, select "open in terminal"
5.type in the following commands in the terminal:
(1): git clone https://github.com/Rocky0Shao/GerrymanderProject.git
(2): pip install opencv-python
The second is the display window. Upon filtering districts, ideal circles will be drawn along with contiguousness and solidity values. You also have the ability to select different districts by clicking on them. Finally, there is a filtering window. Our filter method relies on an HSV filter for colors. The filter window assists the user in finding their desired HSV thresholds for the districts they wish to analyze.
Here is our program that can detect the factors of voting districts that contribute to gerrymandering.
Gerrymandering, the manipulation of district boundaries to benefit a particular political party or group,
is a serious issue that undermines the integrity of democratic elections.
It can result in the unfair representation of certain communities, the suppression of minority voices,
and the consolidation of power in the hands of a select few.
Our program aims to allow the user to input an image of a voting district and establish the values of the contiguous, compactness and solidity of the district.
We define solidity as the area of a contour subtracted by the areas of all child contours, divided by the area of the parent contour's
onvex hull.
If we have parent contour
A convex hull is a boundary which a line segment connecting any two points within the boundary does not intersect the boundary.
Compactness of a voting district is measured in a different way. If the shape of the voting district is a perfect circle, the compactness will be 100%. The general formula for compactness is: 4π * (A/P²), where A is the area of the district and P is the parameter of the district. For visualizatoin, a circle that has the same area as the distric will appear upon the district
These values will allow the user to then calculate whether or not the district has fallen victim to political gerrymandering or not.
In addition, the program can aid the user in determining what group or groups have been suppressed.
We hope that our program can lead to the removal of gerrymandered voting districts and the unfair representation of minority groups and communities.
In turn, this will allow us to hold fair and impartial elections and promote greater transparency and acountability in the political process.
We believe that developing a reliable and accurate tool to detect gerrymandering,
we can ensure that all voices are heard and all communities are represented fairly in our democracy.