Python Numpy generate coordinates for X and Y values in a certain range
<p>I am trying to generate an array of coordinates that will lie on an image.
The image being used is a 640x480 pixel frame. I have been able to make an array of all the <strong>x</strong> and <strong>y</strong> points that I wish to use. I am trying to plot small circles at each of these points just for visualization and for later use so I am trying to get the coordinates into a form that can be entered into the OpenCV circle function. Below is what I have got so far:</p>

<pre><code>Ypts = np.arange(5, 480, 5)
Xpts = np.arange(5, 640, 5)
</code></pre>

<p>I have tried using </p>

<pre><code>[pts]= np.vstack([Xpts, Ypts]).T
</code></pre>

<p>and </p>

<pre><code>coordinate = []
for x in range(Xpts.size):
    for y in range(Ypts.size):
        coordinate.append((x, y))
</code></pre>

<p>With no success, the output I get for coordinate is <code>[0, 0], [0, 1], [0, 2], ...</code> instead of points relating to the values of <code>Xpts</code> and <code>Ypts</code>.</p>

<p>On a smaller scale this is an example of what the x and y arrays are:</p>

<pre><code>Xpts = [5, 10, 15, 20, 25, 30, 35]
Ypts = [5, 10, 15]
</code></pre>

<p>and what i am trying to get to as an answer is:</p>

<pre><code>Points = [[5, 5],
    [5, 10],
    [5, 15],
    [10, 5],
    [10, 10],
    [10, 15],
    [15, 5],
    [15, 10],
    ......,
    [35, 15]]
</code></pre>