I have a script that requires a bit of user input at various stages, and requires an image to be visually checked by the user before carrying on. The user has to create a viewing box in an image (ie just to look at a specific area) and then check the binary image output. Sometimes though, the viewing box is input wrong, so the X Y parameters have to be put in again. Here is the code to be cycled through when necessary:
Y1 = input('Enter the first Y value (Top of image): \n');
Y2 = input('Enter the second Y value (Bottom of image): \n');
X1 = input('Enter the first X value (Left of image): \n');
X2 = input('Enter the second X value (Right of image): \n');
i = myImage(Y1:Y2, X1:X2, 1);
bi = (i<80);
So at this point, the Binary image is shown - but if its wrong, I want to cycle back to the first user input so the X Y extents can be entered again. I want a stop/checkpoint with something like this:
input('Is the binary image correct? Y/N: \n');
To make the user confirm this is OK to proceed - but I have not been able to write the loop so that it goes back to the start point that I want.
Does anyone have any ideas on how to write the necessary loop for this please?