LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 07-03-2013, 05:24 AM   #1
A-Freak
LQ Newbie
 
Registered: Dec 2012
Posts: 10

Rep: Reputation: Disabled
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.


Thank you for your suggestions.
 
Old 07-03-2013, 04:33 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.

http://www.fmwconcepts.com/imagemagick/index.php
 
Old 07-04-2013, 02:19 PM   #3
A-Freak
LQ Newbie
 
Registered: Dec 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.
Attached Thumbnails
Click image for larger version

Name:	DSCF1121-mod.JPG
Views:	25
Size:	33.1 KB
ID:	12859  
 
Old 07-04-2013, 03:03 PM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
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.

jlinkels
 
Old 07-05-2013, 08:56 AM   #5
A-Freak
LQ Newbie
 
Registered: Dec 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
SOLVED

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.
 
Old 07-05-2013, 12:18 PM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Oh yeah, unpaper. Good call!

At the very least it can likely correct for rotation and trim off the border. Then imagemagick can do the final tweaks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Mencoder yields 2GB output without crop, 2MB output with crop porphyry5 Linux - Software 2 01-11-2012 06:44 AM
LXer: Searching and Filtering Photos in digiKam -- Part 2 LXer Syndicated Linux News 0 01-09-2010 04:30 PM
LXer: Searching and Filtering Photos in digiKam -- Part 1 LXer Syndicated Linux News 0 12-16-2009 07:00 AM
LXer: HP announces program to simplify integration of commercial and open source LXer Syndicated Linux News 0 04-06-2006 07:03 PM
A Program That Does the Mac Zoom Thing Animortis Linux - Software 2 03-18-2006 01:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration