Skip to content

Exercise 3: A known field of view (PR113)

You will measure a spot that crosses a video in about a tenth of a second. Then you will tell mcdonald two facts about the picture: what the camera's own angle marks say, and how much the picture was stretched. From them it works out how wide the camera sees and how fast the spot turns across the view. It also gives what the spot's speed would be at each distance.

  • Time: about 10 minutes.
  • Space: a 67 MB download, and about 43 MB for the frames you open.
  • You need: mcdonald 0.4.2 or newer, installed and set up (Install).

The video

PR113 is three minutes of video, which the record says was likely filmed by a US military infrared camera in 1996. In it, "an area of contrast transits the sensor field-of-view, entering near the upper right corner and exiting near the lower left corner of the frame", at about 0:14. You can read the whole record on its DVIDS page. You will look at two seconds of it, from 0:12.63 to 0:14.63.

The camera draws lines with numbers on them across the picture: its angle marks. They form a ladder of lines 5 degrees apart, which tilts as the aircraft banks. Read up the picture, one degree spans 36.25 pixels on the screen. How wide the camera sees, in degrees from the left edge of the picture to the right, is its field of view. An earlier analysis of this video read about 35.4 pixels a degree and treated the pixels as square. So it took the picture's 1,920 pixels to span about 54 degrees.

But the pixels are not square. The video is a 1996 television tape: a picture 720 pixels wide by 480 tall, in the old 4:3 shape, blown up to fill a 1,920 by 1,080 frame. A 4:3 picture 1,080 pixels tall is only 1,440 wide. So the picture has been drawn 1.333 times wider than it is tall: 1,920 over 1,440. The angle marks say how much angle a pixel covers up the picture. A pixel up the picture covers a third more angle than a pixel across it. You will give mcdonald both numbers: the marks' 36.25 pixels a degree, and the stretch of 1.333. mcdonald's own reading of the stretch is 1.29, give or take 0.07, which is the same number. It reads that from how the ground turns in the picture as the aircraft banks.

In the window

  1. Start the window: type mcdonald-gui in a terminal, or use the mcdonald icon if mcdonald setup added one.
  2. On the first page, press Open by catalog name…, type PR113, and press OK.
  3. mcdonald asks whether to download PR113 from DVIDS. Press Yes.
  4. The page Select the video segment opens: a segment is the stretch of video you will measure. Click in the box beside Set start, type 380 and press Enter. Then click in the box beside Set end, type 440 and press Enter. The line under the boxes should say 0:12.63 to 0:14.63. The spot is there for only four frames, 408 to 411, so it is easy to miss when the video plays. Leave How many objects are you looking for? at I don't know, and press Open this segment.
  5. mcdonald saves those frames as pictures, with a bar on the right that shows how far it has got.
  6. In the Measure the object box on the right, press Begin. Three lights under the button show the steps: Find, Follow and Measure. Nothing is asked on the way. This takes about 3 minutes.
  7. The report appears on the right, under the button. Its first line gives a speed in pixels a second: a speed on the screen. Under it is a card called Measure the sound, which is another exercise, so you can leave it for now.
  8. Now give what you know of the picture. The angle marks and the stretch are not among the plain questions under the report, so press Advanced Mode (the button under the box) and then Measure (the third step). Open the fold Provide additional information about this video (optional). In the box graticule scale (px/deg) → k, type 36.25. In the box pixel aspect a = width / height, type 1.333,a 4:3 tape shown in 16:9: the number, a comma, and in your own words where it came from. Press Measure (it may say Measure again). It shows the track sheet and asks whether the track is on the object in every frame: press Yes, on the object in every frame. About 3 minutes later the first line has changed, and new rows are on the card.

On the command line

These are the same steps, for a terminal or an AI agent. First, find what moves in those frames:

mcdonald look PR113 --n0 380 --n1 440 --propose

This downloads PR113 the first time, saves the frames, and looks for spots that move against the background. It takes about 2 minutes. It lists 7 spots that move, best first, and draws them in the picture pr113/segment-380-440/pr113_look_proposals_380_440.png. All seven are "weak": Find is not sure of any of them, so look at the picture yourself. Spot 1 is the dark one seen on frames 408 to 411, moving 141 pixels each frame: the one the record describes.

Under the list, it prints a line that starts to take one:. Here it is, shortened:

to take one:  mcdonald mark PR113 --no-window --link --set object@408=1007.9,317.3 --set object@411=700.9,605.6 --why "proposal 1 of 7 from look --propose (…); I looked at its strip and it is the object because ..." --segment 380-440

Copy the command (everything after to take one:), replace the ... after "because" with your own reason, and run it. It puts marks on spot 1, the points that say where the object is in a frame, and follows it from frame to frame. Its --segment 380-440 puts the marks in that segment's folder, pr113/segment-380-440/, beside the picture: each segment of a video has a folder of its own. It should say "4 of 4 frames linked, 408–411". Marks set this way are recorded as an agent's choice, with your reason, and the report says so. That is expected.

Then measure it, over the same frames. This takes about 2 minutes:

mcdonald run PR113 --marks pr113/segment-380-440/pr113_marks.json --n0 380 --n1 440 --skip integrity

And give it the angle marks' scale and the picture's stretch, which the window's Measure form takes. This takes a few seconds, and nothing is measured again:

mcdonald report pr113/segment-380-440/pr113_case.json --graticule 36.25 --pixel-aspect "1.333,a 4:3 tape shown in 16:9"

To have an AI agent do it, you can give it this prompt:

Please use the mcdonald toolkit to analyze the PR113 video released under PURSUE, following https://github.com/haqqmisra/mcdonald/blob/main/docs/exercises/03-pr113.md. Run mcdonald readme to get started.

What you should get

Both ways give the same conclusion and the same numbers. Before you give the marks and the stretch, the report starts:

No physical conclusion. The object moved about 4269 pixels a second across the picture. Its real speed and size cannot be found from this video alone.

After you give them, it starts:

Indeterminate, range needed. The object crossed the view at about 103° a second. It is 21 pixels across in the file, 0.43–0.58° in angle, because the picture is drawn 1.333 times wider than tall. What it is depends on how far away it is. As a bird (0.2–2 m), it would be 20–260 m away and moving at least 36–470 m/s across the line of sight. As a party balloon or a small drone (0.3–1 m), it would be 30–130 m away and moving at least 53–240 m/s. As a weather balloon (2 m), it would be 200–260 m away and moving at least 360–470 m/s. As a balloon cluster (2–5 m), it would be 200–660 m away and moving at least 360–1,200 m/s. As a tethered aerostat (a moored balloon or blimp, 5–20 m), it would be 490 m–2.6 km away and moving at least 890–4,700 m/s. As a fighter jet (17 m), it would be 1.7 km–2.2 km away and moving at least 3,000–4,000 m/s.

The window's report card also says it followed the spot on 4 frames (frames 408 to 411), at 142.3 pixels a frame. After you give the marks and the stretch, new rows are added: Field of view 39.7° by 29.8° up, Scale 2077 px/rad, Pixels, wide to tall 1.333 wide to tall, and Turn rate 1.80 rad/s. The question on the card changes to "Its real speed needs the distance to the object".

What it means

  • From pixels to angles. Once mcdonald knows how much angle a pixel covers, it can turn pixels into angles. The marks give the scale up the picture. The stretch says that a pixel up the picture covers a third more angle than a pixel across it. The spot moves 142 pixels a frame in the file, down and to the left at about 45 degrees. In square pixels, with the stretch taken out, that is about 125 a frame. At 36.25 pixels a degree, it turns across the view at about 103 degrees a second (1.80 radians a second): this is its turn rate. It crosses the whole picture in well under half a second. Read with one scale and square pixels, as the earlier analysis did, the same track gives about 121 degrees a second. It also gives a field of view of 54 degrees, where the picture really spans about 40 degrees across by 30 up.
  • A speed still needs a distance. How fast something turns across your view depends on how far away it is. A fly near your face and a plane far off can turn across it at the same rate. The speed is the turn rate times the distance, which mcdonald calls the range. The record gives no distance, so the first line says Indeterminate, range needed.
  • What it would be at each distance. The first line puts six kinds of object where their sizes would be, from a bird to a fighter jet. A bird would be 20 to 260 meters away. A 2-meter weather balloon would have to be 200 to 260 meters away, going 360 to 470 meters a second: faster than sound. A 17-meter fighter jet would be 1.7 to 2.2 kilometers away, going 3,000 to 4,000 meters a second. Each distance is a span rather than one number, because the spot's 21 pixels may have been counted across the stretched picture or up it. So its true size is between 16 and 21 square pixels. Unless the spot was small and close, it was very fast. The speeds are the least it could be going at each distance, because they count only the motion across your view. Press Full report and find the picture called "Size (left) and speed (right) against distance". Its one line shows the same at every distance.
  • Try a distance. Press Change on the card, type 3 in Distance to the object with kilometers beside it, and press Work out the speed. The first line now says Supersonic motion. At 3 kilometers the spot is about 23 to 30 meters across, about a fighter jet's size. There are two numbers because the stretch leaves open whether its 21 pixels were counted across or up. It is moving at least 5,400 meters a second across your view. That is the least it could be going, so it is faster than sound however it moved toward or away from the camera. Now try 0.1, which is 100 meters. The spot is then about 0.8 to 1 meter across and moving at least 180 meters a second, under the speed of sound. The first line says Indeterminate, angle needed, because motion toward or away from the camera could still make it faster. The record gives no distance: this only shows what one would tell you.
  • Why not 54 degrees. The earlier analysis gave a turn rate of 2.10 radians a second, about 121 degrees a second, and a field of view of 54 degrees. It used the same marks and the same track, with the pixels taken as square. You can see that number yourself: mcdonald report pr113/segment-380-440/pr113_case.json --graticule 35.4 --forget pixel-aspect gives 2.10. The difference is the stretch. The spot's motion across the picture is counted in the file's pixels, which cover less angle across than up, where the marks were read. The 142 pixels a frame is still right as a count of the file's pixels: it is the turn into degrees that needs the stretch. Where did 1.333 come from? Two places agree. One is the shape of the tape's picture, a 4:3 picture filling a 16:9 frame. The other is the ground itself, which turns in the picture as the aircraft banks, the way a picture stretched by 1.29, give or take 0.07, would. The camera's own drawn symbols are stretched more, 1.75 wide to tall, but that is the display's doing, not the picture's. Give --pixel-aspect 1.753,symbols and the rate comes out about 94 degrees a second: what the symbols' stretch would say if it were the picture's. The report records which number you gave and where you said it came from.
  • Check the track by eye. The track is the spot's position in each frame, joined up. The report card says Track not yet checked by eye. Press Full report and find the track sheet: a small picture of each frame, with a ring where mcdonald followed the spot. If the ring is on the spot in all four frames, press I looked. On the command line, open pr113/segment-380-440/pr113_all_frames.jpg, then run mcdonald report pr113/segment-380-440/pr113_case.json --i-looked.

Next, try Exercise 4: Six at once, where you tell mcdonald how many objects you are looking for.

Tell us how it went

Please send us your result, whether or not it matched. Tell us what the report's first lines said, how long it took, and anything that was hard to follow.