The ImageTest GUI ----------------- On the left-hand side of the window, you manipulate the models. on the right-hand side of the window, you put the image that is to be matched against the models. Models/test images are 8-bit greyscale images with exactly one region in white on a black background. Think of them as presegmented images. Walk-through: 1) Drag circle_big.png into the left ImageView. It will get the name "Model 1" and appear in the ImageView. 2) Drag circle_medium.png into the right ImageView. It will be matched against all the models, and the best matching model will be displayed on the left side (in this case, the only one that's there). Under the model, you can see that it says "Diff: 0.004". This is the difference between the model and the test image. 3) Now click on the "<" button under the test image. This adds the test image as a new model named "Model 2" and rematches the test image against all models. Of course, now it matches the model that is itself exactly. The difference you see is 0. (The ">" button is the reverse. It sets the test image to the currently displayed model.) 4) When there is more than one model, only the best match will be displayed. You can, however, choose another model in the ComboBox above the model image. Choose "Model 1". Note the difference. 5) Drag cross.png into the model window. The model display switches back to the best match, because every time you add or remove a model, the test image is rematched against all models. 6) Now click around on the small arrows next to the difference display. This will scroll through the list of models ordered by their difference to the test image. 7) You can name the models differently by simply entering the new name into the ComboBox and pressing . If it's a new name, the currently displayed model will be renamed to it, if not, you are taken to the model with this name. Rename the big circle to "Big circle", the smaller circle to "Medium circle" and the cross to "Cross". 8) Clicking on the "Remove" button will---surprise, surprise---remove the currently displayed model. Remove the smaller circle. The test image is rematched. Rematching can also be done via the "Rematch" button, but since it is done every time you change something significant, the button is really superfluous. 9) Now add rect_vert.png as model "Rect". 10) Match rect_horiz.png by dragging it onto the test image window. You'll see that it matches "Rect" best. Now take a look at the standard output. (This can be seen in a window of the Xcode IDE entitled "Run - ImageTest - ImageTest - ImageTest".) The relevant line reads Model 4 (Rect) matches with 0.146711, rel. orient: -1.5708, rel. size: 1.3138 This tells us that the match is pretty good and that the test image is rotated about -pi/2 or 90 degrees in respect to the model. 11) The "Clear" button clears the test image. Hit it. 12) Now match cross_rotated.png by dragging it onto the test image window. It matches "Cross" best with an orientation of 1.10984, which is about 64 degrees. 13) You may be wondering what this "#Points: 23" means. This is the number of equally spaced points around the region's circumference that are used in the profile. The significance of this number can be demonstrated as follows: You should have the models big_circle.png, cross.png, and rect_vert.png as "Big circle", "Cross", and "Rect", respectively, and cross_rotated.png as the test image. The number of points should be 23. If this isn't the case, make it so. Now, change the number of points to 5. The image will be rematched and we see: "Big circle" matches best! Change the number of points to 6. Now "Cross" matches best, as expected. Change the number of points to 7. Guess what? "Rect" matches best. What's going on? This exercise is left to the reader. ;-)