!7 sbool firstTime = true; static int maxOriginalImageSize = 500; p-experiment-tt { framesBot(); centerFrameWithWidth(700, setFrameTitle( firstTime ? "Select picture of magic wand" : "There - I put the wand upright for you! Select another picture?", selectSnippetID_v1(#1101217, vf1(f go)))); firstTime = false; } svoid go(S imageID) { Class recognizer = hotwire(#1015046); int lineWidth = 0; /*if (eq(imageID, #1101218)) lineWidth = 4; else if (eq(imageID, #1101222)) lineWidth = 4; else lineWidth = 10;*/ set(recognizer, aiTitle := "Finding Wand..."); set(recognizer, thresholdRounds := 20000); focusConsole(); set(recognizer, showRepro := true); Pair p = cast quickImport(call(recognizer, 'imageToCode, imageID, 1, lineWidth)); BackgroundPlus s = shallowCloneToClass(BackgroundPlus, unstruct(p.a)); printStruct(s); double angle = sortLineByY((LineWithColor) first(s.things)).angle(); moveToTopCenter(showImage_centered("Wand facing up (or down)!", rotateImageInSameSize( scaleBufferedImageToMax(maxOriginalImageSize, (BufferedImage) get(recognizer, 'fullSizeImage)), 180-angle))); callMain(); }