...And Mexico will Pay for It! Donald Trump is very impressed with the work of the people on this site. He saw how amazing of a job you did helping Ben Carson, so he even hired you to build his wall. He thinks you're terrific. Now he needs your help again. While he has successfully built his wall, now he needs the Mexican government to pay for it. He wants to charge $1 million a mile, and he has told them that the U.S.-Mexico border is 1,989 miles long. However they are not quite sure this number is accurate, so they would like a to-scale visual representation as well. That's where you come in. You are to take this map:


and for every n (50 &lt;= n &lt;= 500) miles on the border draw a 25 pixel-length line, perpendicular to the slope of the border at that point. Using the scale on the right-hand side of the map, I've determined that 100 miles ~ 50 pixels. I've drawn a sample of the first 3 lines for n=60, but these are only approximate:



Notes:


The only input is n. Output should be the map image, with the lines added, drawn to the screen or saved in a raster image file (you can overwrite the original map file).
You can save the blank map file with whatever file name you want. It is a JPEG, but you can convert it to another common raster format if you prefer. Also, you can reduce the size of the image by up to 50%, as long as you keep the dimensions proportional, and your lines are still to scale.
Each line should be perpendicular to the slope of the border at that point. The slope should be calculated starting 50 miles before the point and ending 50 miles after the point.


Accuracy:


The slope of each line can have a margin of error of ±5°
The spacing between each line can have a margin of error of ±20 miles (10 pixels on the regular map).
Python 2 + numpy + OpenCV, 576 bytes


from cv2 import*
from numpy import*
n=input()/4
f=&quot;m.png&quot;
i=imread(f)
b=array([0]*3)
y=array([165,195,225])
j=inRange(i,b,b+120)
k=inRange(i,y,y+25)
for x,y in zip(*where(j)):j[x,y]=k[x+3,y]-j[x+1,y]&gt;1
j=j[506:732,152:557]
p=[array([11,9])]
for c in sorted(zip(*where(j)),key=lambda c:c[1]):r=range(p[-1][1]+1,c[1]+1);p+=map(array,zip(map(int,interp(r,*zip(p[-1],c)[::-1])),r))
for x,c in enumerate(p[25:-25:n]):s=-1/true_divide(*p[x*n+50]-p[x*n+25]);k=6/(1+s**2)**.5;line(i,*map(tuple,[(c+[int(k*s)+506,int(k)+152])[::-1],(c-[int(k*s)-506,int(k)-152])[::-1],b]))
imwrite(f,i)

This program is almost entirely ungolfed, and there are aspects of it that are somewhat inaccurate at the moment, but at least it works for the most part. Additionally, there is a little bit of hardcoding, but it's only for an approximate window enclosing the border and the coordinate of the first pixel on the border (the latter of which I will actually most likely remove later).
The image used by the program is halved in area (i.e. 1120 x 865), and so the length of lines drawn and the distance between lines is smaller.