[SOLVED] Searching an program to simplify rotate, zoom and crop photos
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Searching an program to simplify rotate, zoom and crop photos
I would like to make an large number of photos from an oscilloscope screen. The photos will show the screen with its rectangular frame almost flat on, but will have some minor random deviations in size and angles.
Do you know an program that i can set up in such a way that it either automatically recognices the frame around the tube (can be easily set up for an clear contrast) or at least has an easy and comfortable way to manually select the four edges.
Then the program should automatically rotate, zoom and crop the photo that the new image is just the content of the frame in an standardized image size.
I'm not sure I understand exactly what you want, but you might take a look through this bunch of imagemagick scripts. It might contain something you can use.
Thank you very much for the link to the imagemagick scripts. Espically the "whiteboard" thing seems to be the right thing and i am trying to get it working as i need.
Let me try to explain what i want to do in this way:
I want to photograph the curves on the screen of my osciloscope. This will be something around 50 photos in the next months and possibly more than 100 next year.
My problem is that i can only aproximately aim the camera to the screen so every image will be something off. I attached an example (negative grayscale with some contrast enhancement) how this would look like.
The result should be an rectangular image of uniform size like the diagrams in an datasheet.
Now i would like to automatize the process of turning, cropping and zooming the image that i can run everything in an batch file. Raw photos in -> Diagrams out.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
Have a look at unpaper. It is actually intended for scanned pages, to get scanned artifacts like zoom, borders and rotation right. I don't think it can do image adjustment like ImageMagick, but it should be easy to put the two programs working in concert.
Unpaper has about 183 options. I think you should concentrate on the geometry and the automatic recognition of your frame and disable all other option which have to do with background removal etc.
The "whiteboard" script was an misunderstanding because it needs the coordinates manually but "unperspective" works.
If someone wants to do the same here is my workflow.
Make photos. Mask the area around the screen in black paper. There must be no bright part or "unperspective" calculates a lot of false peaks when trying to determine the image borders.
Run the line
convert *.JPG -colorspace gray -brightness-contrast -30% -normalize -negate bild%d.jpg
This clips the dark parts into solid black and stretches the bright parts to full white. It processes all photos in the current folder and numbers the output files as bild0.jpeg and so on
Type for every image
bash ../unperspective -M -a 1.22 -m deriv -w 640 bild0.jpg outputfilename.png
This assumes that the image has an aspect ration of 11:9 and you want the output with approximately 640 pixels width in the file outputfilename.png. Change the values as you want.
I have not tried the program "Unpaper" yet but i will take a look at it in the future.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.