Skip to content

Homographies, Scan Lines and Cameras…Oh My!

This week there were two things I was working on simultaneously - getting the homography pipeline working with our automated method of finding markers and starting to generate the images of scan lines that we will later use for glitter characterization.

Homographies

End-to-end I can now:

  • take a picture of the glitter sheet with the markers attached (which have finally been permanently affixed to the four corners),
  • find the four points associated with each of the four markers (16 points total),
  • use these 16 points to compute the homography to map our image to a 3000x3000 image (I hand measured where the markers are on the glitter sheet and scaled these measurements up to 3000x3000)

Below is an example of an image taken in our setup of the glitter sheet, and the 3000x3000 image I get when I compute and apply the homography mapping the markers to the corners (also applied a slight zoom-out):

 

 

 

 

 

 

 

 

 

In order to test how accurate the homography is, I used the above image as a "base" image, found the four markers in the post-homography image (on the right), and then used these as control points to compute a new homography mapping a series of other images (tilted at various angles) to that base image. I then computed the distance between the markers in each of the post-homography images and the markers in the post-homography base image.

Below are the results for error calculations per marker over a series of images I took. Each image is at more and more of an angle w.r.t. the camera. For the first row, I compute the error if I compute and apply the homography from the base image to itself.

Image Upper Left Marker Upper Right Marker Lower Right Marker Lower Left Marker
Base 0.0548 0.0806 0.0036 0.0303
Tilted Back 1 0.3457 0.1485 0.1646 0.2493
Tilted Back 2 0.8675 0.5837 0.7798 0.4999
Tilted Back 3 0.8253 0.4140 0.3949 0.3547
Tilted Back 4 1.1967 0.5119 0.4784 0.2572
Tilted Back 5 N/A N/A N/A N/A
Tilted Right 1 0.3293 0.2611 0.2982 0.4730
Tilted Right 2 N/A N/A N/A N/A
Tilted Right 3 N/A N/A N/A N/A
Tilted Right 4 N/A N/A N/A N/A

Some images have N/A as the error for the markers - either the markers were not found in the original image and I was unable to apply the homography, or I was able to apply the homography, but the image post-homography was too blurry to find the markers and compute the error. Such images were at too much of an angle w.r.t. the camera, so we wouldn't use such images in our experiments anyway.

For example, the following images are results from Tilted Right 2. The four markers were correctly located in the original image, and so I was able to apply the homography to get the top-right image. However, when I tried to locate the markers in the post-homography image, only the top two markers were found (bottom image). The bottom two markers are not as in-focus and look a little more like blobs, so they were not detected.

 

Scan Lines

Generating the scan line images has been the other task I have spent some time on this week. In doing this, there are a couple of parameters we have to play with, I think the idea being that we go with the smallest size lines that are still 'bright enough'. I am generating images with lines of a given width, and then applying a gaussian filter to them. I am testing different line-widths as well as different gaussian standard deviations. Below are some examples images I have generated with 2 different line widths, and 4 different gaussians for each line width.

The next task will be to actually try taking some pictures of the glitter uses some of these scan lines, and look at those images to determine which line width-gaussian combination is best.

Camera

I have been having some trouble focusing this current Nikon camera, but I think the new camera will work better for this. Once the new camera comes in, I will actually test out some of these scan lines in order to figure out which set of parameters we want to use for our experiments. I also have started working through some of the centroid-detection code, and will test this once I am able to take proper, focused pictures of the glitter!

Leave a Reply

Your email address will not be published. Required fields are marked *