resize to lower resolutions to preprocess for CV app

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
allomorphy
Posts: 9
Joined: 2017-10-29T14:15:04-07:00
Authentication code: 1151

resize to lower resolutions to preprocess for CV app

Post by allomorphy »

We have a CV application that runs on images produced on various smartphones.
Our image sets have various native pixel sizes, for example 3024x4032 with iphone 11.
USers may capture with other devices lower resolutions like for example:
1080x1920 or 1440x2960

We want to use a command to emulate the way an image would look at the lower pixel density and then use this as input to our CV routine.
So this is a form of image augmentation if you like to test our CV app under alternative challenges.
This command looks fit for this purpose:

Code: Select all

-verbose -strip -resize 1080x1920 -quality 75 -density 72x72 -units pixelsperinch 
But why would I change quality or density or units?

Best wishes

snibgo
Posts: 12904
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: resize to lower resolutions to preprocess for CV app

Post by snibgo »

"-quality" affects the image compression in the output file. See https://www.imagemagick.org/script/comm ... hp#quality

"-density" and "-units" change metadata, so software that that cares about physical dimensions (inches, centimetres or whatever) correctly processes the image.

Incidentally, "-strip" is a bad idea if your input may have an embedded ICC profile.
snibgo's IM pages: im.snibgo.com

Post Reply