Anything faster than ImageMagick? - image-processing

Is there anything faster to ImageMagick ? I'm processing images with different kind of filters so to create effects like old photo, oil paint etc.

Check GraphicsMagick. It is based on IM, but faster and less complicated.
Performance copmarison (GraphicsMagick vs ImageMagick):
http://www.graphicsmagick.org/benchmarks.html

Related

Create/Apply grunge-vintage-worn- old-scratchy filters in iOS

Does anybody knows how to create/apply grunge or vintage-worn filters? I'm creating an iOS app to apply filters to photos, just for fun and to learn more about CIImage. Now, I'm using Core-Image to apply CIGaussianBlur, CIGloom, and the like through commands such as ciFilter.setValue(value, forKey:key) and corresponding commands.
So far, core image filters such as blur, color adjustment, sharpen , stylize work OK. But I'd like to learn how to apply one of those grunge, vintage-worn effects available in other photo editing apps, something like this:
Does anybody knows how to create/apply those kind of filters?
Thanks!!!
You have two options.
(1) Use "canned" filters in a chain. If the output of one filter is the input of the next, code things that way. It won't waste any resources until you actually call for output.
(2) Write your own kernel code. It can be a color kernel that mutates a single pixel independently, a warp kernel that checks the values of a pixel and it's surrounding ones to generate the output pixel, or a general kernel that isn't optimized like the last two. Either way, you can use GLSL pretty much for the code (it's pretty much C language for the GPU).
Okay, there's a third option - a combination of the two above options. Also, in iOS 11 and above, you can write kernels using Metal 2.

convert a normal map to height map with imagemagick: how to recreate/integrate following algorithm

I'm trying to convert a tangent space normal map to a height/displacement map. For sure this will be not 100% accurate speaking in terms of "exact height" for each pixel. But the relative height from each pixel to the next is more than enough.
Available Algorithm + Info's:
http://www.cournia.com/devnull/n2h/n2h.pdf
Questions:
1. How to convert a normal-to-height map in Photoshop/Gimp? Is there a way using these tools? Beside; I don't wan't to use CrazyBump or any other Texture-Tools. This has to run via CL later on. A Photoshop solution is more or less just a pre-step to understand workflow a bit better.
If not possible with PS/Gimp; how to include the algorithm in an imagemagick process?
I've checked already Doom3:-Normal2Height; Crazybump & all other texture tools like Nvidia's PS-Plugin, xNormal, Awesomebump, SSBump, etc. I'd need this function working with Imagemagick.
Any help is very much welcome. Python preferable.
thx
There are a couple of possibilities for doing that with ImageMagick.
Firstly, you could implement your own process module. When running configure to install ImageMagick, you would then do:
./configure --with-modules=yes
Then, when you want to apply your bumpmap processing on the command-line, you would do:
convert input.png -process analyse <param1> <param2> result.png
Your processing needs to be written in C/C++ and the best description I know of is on Alan Gibson's webpages here.
Secondly, you could write your entire processing using Magick++ which is the C++ binding to ImageMagick. Best description I know of is here with sample code here.

Content-based image retrieval features

I'm trying to implement Content-based image retrieval in my application. I found a LIRE library that look pretty good.
I need to analyze my image collection for similar(from human point of view) images. In my catalog I have a big amount of absolutely different uncategorized/unstructured images
In order to analyze images LIRE contains following list of algorithms:
CEDD,
AutoColorCorrelogram,
BinaryPatternsPyramid,
ColorLayout,
EdgeHistogram,
FCTH,
FuzzyColorHistogram,
Gabor,
JCD,
JointHistogram,
JpegCoefficientHistogram,
LocalBinaryPatterns,
LuminanceLayout,
OpponentHistogram,
PHOG,
RankAndOpponent,
RotationInvariantLocalBinaryPatterns,
ScalableColor,
SimpleCentrist,
SimpleColorHistogram,
SPACC,
SpatialPyramidCentrist,
SPCEDD,
SPFCTH,
SPJCD,
SPLBP,
Tamura
Based on your experience, could you please recommend one of them that can be most suitable(from human point of view) for such kind of image suite(mix of uncategorized images) in order to find a similar images?
I think JCD is the best one because combine two approach at the same time, and each approach is combining two features (color & texture).

Can someone explain the parameters of OpenCV Stitcher?

I'm trying to reduce the calculation time of my stitching algorithm. I got some images which I want to stitch in a defined order but it seems like cv::stitcher.stitch() function tries to stitch every image with every other image.
I feel like I might find the solution in the parameters of OpenCV Stitcher. If not maybe I have to modify the function or try something else to reduce calculation time. But since I'm pretty much a beginner, I don't know how. I know that using GPU might be a possibility but I just don't get CUDA running on Ubuntu at the moment.
It would be great if you could give me some advice!
Parameters for OpenCV Stitcher module:
Stitcher Stitcher::createDefault(bool try_use_gpu) {
Stitcher stitcher;
stitcher.setRegistrationResol(0.6);
stitcher.setSeamEstimationResol(0.1);
stitcher.setCompositingResol(ORIG_RESOL);
stitcher.setPanoConfidenceThresh(1);
stitcher.setWaveCorrection(true);
stitcher.setWaveCorrectKind(detail::WAVE_CORRECT_HORIZ);
stitcher.setFeaturesMatcher(new detail::BestOf2NearestMatcher(try_use_gpu));
stitcher.setBundleAdjuster(new detail::BundleAdjusterRay());
from stitcher.cpp:
https://code.ros.org/trac/opencv/browser/trunk/opencv/modules/stitching/src/stitcher.cpp?rev=7244
I want to stitch in a defined order but it seems like
cv::stitcher.stitch() function tries to stitch every image with every
other image.
cv::stitcher does not have a parameter to fulfil your requirement.
However, in the stitching_detailed.cpp sample you have the --rangewidth parameter. By setting it to 1, the algorithm will only consider adjacent image pairs (e.g. for pair 1-2 matches would be computed but not for pair 1-3)

How to make texts in images sharper using PIL?

I was working with PIL, OpenCV and OCR readers to read texts from Images. The biggest problem I faced is when it comes to Image processing to make texts sharp enough for easier/accurate extraction by the OCR reader.
For that, I thought of increasing the contrast/brightness and do a histogram equlization using PIL but that didn't help the cause either.
So, what would you suggest to do to make the texts appear sharper for better text extraction?
PIL has sharpen and edge enhancing filters. Is this what you want? An example image showing what you are dealing with would be helpful.
Your image has an uneven background color which may be causing problems. Try looking at this solution to create a nice leveled b&w image.
But the black collar is also going to cause problems and you should look at ways of cropping it out.
That said, I get reasonable improvements with a simple PIL SHARPEN filter:
tesseract results after SHARPEN filter:
From what I've learned looking inside people, ^ I've decided human
beings are somewhere ` between a hurricane and an ice cube} in some
respects, permanently mysterious, but in others- with enough science
and careful probingeentirely ' scrutabler It would be as foolish to
think we have reached the limits of human knowledge as it is to 3
think we could ever know everything. There is still room enough to
get better, to ask questions of i even the dead, to learn from
knowing when our i simple certainties are wrong.
And results without filter:
From what I've learned lnnkmg wade maple} Fve deculed lunnuan wlng;.
el'. .y.w.r-a' isbetween a luurrlctuvr null llva laAll.' a. I ll
respects, permanently unyst:-rwntMl ln ms. re with enough scaena)
and turutul pmlulng l~m.rely scrutable. It would he as loallsla to
thank we have reached the llmlts of human knowledge as lt ls to think
we could ever know everything. There ls still room enough to get
better, to ask quesuons of ` even the dead, to learn from knowmg when
our simple certeindes are wrong.

Resources