Cropping image into multiple images at certain coordinates, but the positions need verification first
Mostrar comentarios más antiguos
I have an image of a test chart that I scanned with a scanner. The thing I want to do is cut the image in to pieces (rectangles) at a coordinate with a given size. I've tried this:
imcrop();
this let's you make a rectangle that will crop out. (but it wont be the right size from the start)
imcrop([xpos, ypos, w, h);
this lets you define a size and a coordinate but it wont let you verify if it's the right place on the image.
Is there a way of combining both? I want to get the x,y,w,h out of a matrix and then it should show on a plot, if it covers the area I want it to cover I can go on to the next step. and when they are all in the right place (they should be initially but if they aren't I still want to change the position) I want to press a button and have it cut the pieces out. The cutting shouldn't be so hard but I can't think of a way to show all rectangles at the same time, and then press a button to do all cuts at the same time.
I hope you understand my problem, english isn't my main language so I understand it might be a little vague.
Kind regards,
Thomas
Respuestas (2)
Image Analyst
el 23 de Mzo. de 2015
0 votos
I'm not sure what you're talking about. Calling imcrop() with no arguments does let you click and drag out a box and give you handles for adjusting the sides. Then you can double click inside the box.
4 comentarios
Thomas Koelen
el 23 de Mzo. de 2015
Image Analyst
el 23 de Mzo. de 2015
Sorry, it appears that you can't "preload" the box with predefined coordinates. If the user confirms the box, then the user must click and drag it out initially. You can't get them started with some box in a predefined location and size. It's a good idea though - you can send that in as a request for enhancement.
Thomas Koelen
el 24 de Mzo. de 2015
Editada: Thomas Koelen
el 24 de Mzo. de 2015
Image Analyst
el 24 de Mzo. de 2015
I don't know - never tried. What if you do this:
h1 = imrect(gca, [10 10 100 100]);
h2 = imrect(gca, [120 120 100 100]);
h3 = imrect(gca, [230 230 100 100]);
wait(h1);
wait(h2);
wait(h3);
Not sure, though, if they're have to click on them in the same order they were put up. Would just have to try it and see.
Categorías
Más información sobre Lighting, Transparency, and Shading en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!