Public Lab Research note

  • 3

Coded ground control points

by Jasja |

Ground control point targets are useful to stitch photos on uniform or repeatitive landscapes. They can be made from cardbord plates, cloth etc. See for example this note.

However, on very uniform areas, even ground control points may not help: photos of green patches of grass with identical control points are hard to tell apart. In such situations, a coded ground control point marker comes in handy.

A simple approach I thought up over coffee with Thomas Groen is to make a paper sheet with a 3x3 grid of black-or-white squares, forming a binary code of 9 positions. The codes in the photo above for example are numbers 000.000.001 and 000.000.101 (when white = 1, black = 0).

Paper sheets with codes can be generated easily with some easy code, such as this script for Processing:

#7E7E7E;">// Coded ground control points //

#CC6600;">import processing.pdf.*;

#CC6600;">size (297, 420,PDF, #006699;">"GCPs.pdf"); #7E7E7E;">// setup for A3 standard sheets
#7E7E7E;">// load font'
#CC6600;">PFont font;
font = #CC6600;">loadFont(#006699;">"Georgia-12.vlw");

#CC6600;">int achtergrond = 200; #7E7E7E;">// sets background

#CC6600;">for (#CC6600;">int teller = 0; teller <= 98; teller = teller +1) { 

  #CC6600;">String #CC6600;">str = #CC6600;">binary(teller, 9);
  #CC6600;">for (#CC6600;">int i = 0; i < 3; i = i+1) {
    #CC6600;">for (#CC6600;">int j = 0; j < 3; j = j+1) {
      #CC6600;">rect(4+96*j, 4+96*i, 95, 95);
  #7E7E7E;">// draw scalebar of 250 mm long
  #CC6600;">fill(1, 1, 1);
  #CC6600;">rect(23, 308, 250, 94);

  #7E7E7E;">// draw cross for GPS capture"
  #CC6600;">stroke (achtergrond);
  #CC6600;">line (149, 354-20,149, 354+20);

  #7E7E7E;">// add text 
  #CC6600;">textFont(font, 6);
  #CC6600;">text(#006699;">" ", 40,330);
  #CC6600;">text(#006699;">"Nr. "+teller, 40,350);
PGraphicsPDF pdf = (PGraphicsPDF) g;  #7E7E7E;">// Get the renderer
 pdf.nextPage();  #7E7E7E;">// Tell it to go to the next page

Files Size Uploaded
GCPs_A4.pdf 519 KB 2012-06-14 17:09:37 +0000
GCPs_11x17.pdf 772 KB 2012-06-14 17:09:47 +0000

Post your attempt to replicate this activity 

Replications (0)

None yet. Be the first to post one!

This is marked this as an activity for others to try.
Try it now   Click here to add some more details.

balloon-mapping kite-mapping ground-control-points registration



Interesting. Is it possible to include a north arrow scale?North arrow scale

Thank you Juan, yes, that would be possible, but it would be easiest to use the rectangle, the scale bar, as a north arrow. If you always point it north-south, with the code on the left (or right) consistently, it should work like that. I could upload a pdf of say the first 30 codes in A3 format if anyone is interested.

Yes, but for technical photography (archeology, for example) I think it's better explain the North.

And yes, I am interested.

Great idea with the coded ground control points-- I attached the rendered PDFs for folks who aren't comfortable with code, and made a modified version for USAians in our standard 11"x17" paper size (279mmx432mm).

One note, in the code it said the scale blocks were 200mm, but they're actually 250.

11x17 processing code:

// Coded ground control points //

import processing.pdf.*;

size (279, 432,PDF, "GCPs.pdf"); // setup for 11x17 standard sheets
// load font'
PFont font;
font = loadFont("Georgia-12.vlw");

int achtergrond = 200; // sets background

for (int teller = 0; teller background(achtergrond);
  String str = binary(teller, 9);
  for (int i = 0; i < 3; i = i+1) {
    for (int j = 0; j < 3; j = j+1) {
      rect(6+89*j, 6+89*i, 88, 88);  //modified for 11x17
  // draw scalebar of 250 mm long
  fill(1, 1, 1);
  rect(14, 308, 250, 94);

  // draw cross for GPS capture"
  stroke (achtergrond);
  line(139-20,354,139+20,354);//modified for 11x17
  line (139, 354-20,139, 354+20); //modified for 11x17

  // add text 
  textFont(font, 6);
  text(" ", 40,330);
  text("Nr. "+teller, 40,350);
PGraphicsPDF pdf = (PGraphicsPDF) g;  // Get the renderer
 pdf.nextPage();  // Tell it to go to the next page

Matthew, that is great, thanks. I did not know how to attach documents to the post yet.

I've changed the 200 mm error in the script comments.

Also note that you can replace my commercial message on the GCP's with anything you want by altering the line

text(" ", 40,330);

The text between " " is the text that is printed.

I'm interested in printing some of these nice panels, but don't know how to use this code. Is the PDF posted somewhere?

hmmm... the attachments are missing from this post. they are still on the old site. I'll file an issue. until then:

You must be logged in to comment.