If your yard has a lot of slope or undulation, that's an easy problem to work around.
First, select the method of using Pickets vs. Fence Panels. Next, and On the uneven ground - lay a scrap piece of 2x4 or 2x6 lumber (about 4 ft long) on the ground directly below your pickets before you nail each one in place.
Set each picket "directly on top of the scrap lumber," and continue this method as you nail each picket in place.
The scrap 2x4 lays flat and follows the ground's contour- so will your pickets. The height of each picket will also be set accordingly.