Finding Largest Rectangle opaque with Imagemagick - image-processing

I need to extract the biggest (area) rectangle which contains no transparent pixels from a picture.
Here's an exemple (maybe this hand made solution is wrong though):
I find some link about principles (in python) or same topic related issue (here) but without any answer.
Is it possible to make it with Imagemagick? or any command-line tool on linux?

I didn't find a command-line based tool to do that, so I 'forked' the version proposed by zed (J.F. Sebastian here) on github : largest_rectangle script by zed.

Related

Do you know any tools to make such graphs?

Do you know tools to make graphs like in the picture?
You can try mathcha.io which is an online tool for creating tikz pictures used in tex documents.
The package tikz is exactly what you need for that kind of plots.

Distorted 3D reconstruction OPENCV + PCL (Martin Peris code)

I am using Martin Peris code for 3D reconstruction using OpenCV and PCL (link below):
http://blog.martinperis.com/2012/01/3d-reconstruction-with-opencv-and-point.html
Trouble point:
I am having trouble with the final step in viewing the 3D reconstruction in the "3D viewer" window. I am getting a perfect disparity image as shown in the blog but my final reconstruction image looks like this:
https://drive.google.com/file/d/0Bx1aNPhwJU4kMmt1cUVHVXBOLWM/edit?usp=sharing
You can compare this with the one which is shown in the video link given in that blog.
Things that I have tried:
Checked if all the required libraries are installed. I believe otherwise the code wouldn't compile and give me any results.
Checked if I have a graphics support on my machine:
$lspci | grep VGA
09:00.0 VGA compatible controller: NVIDIA Corporation G71GL [Quadro FX 3500] (rev a1)
My doubts:
If there is some library missing for OpenGL or OpenCV or PCL which is making the 3D reconstruction window suffer.
The controversial reprojectImageTo3D() function in OpenCV which is also used in the code by Martin Peris.
Some other reason that one of you could help me with ;-)
Other details:
Ubuntu Version : 12.04
OpenCV Version : 2.3.1-7
Any suggestions would really be helpful!
Thanks,
Pratul
RESOLVED!
It was actually a driver issue with my graphics card. To solve it I wiped off the currently installed driver and then re-installed an updated one and that worked like a charm.
Details of this solution I have posted on the PCL mailing list as I didn't wanted to repeat myself here.
enter link description here
I hope this helps.

Fingeprint thinning code preserving continuity of ridges

I am trying to develop a project that involves fingerprint matching. Now, I am stuck at the stage of Fingerprint thinning. I am coding my project using OpenCV and c++ Visual Studio 2010.
I tried erode() function, but it doesn't preserve the continuity of ridge lines. I also tried the following algorithm of Zhang-Suen thinning,
http://opencv-code.com/quick-tips/implementation-of-thinning-algorithm-in-opencv/
but, this shows an exception at memory location. I don't know how to proceed and i am stuck with this step.
Kindly help me with the code for fingerprint thinning + also preserving continuity of ridges.
If you're just looking for a code example of extraction, SourceAFIS (BSD License) goes from full greyscale to binarized and thinned with some artifact trimming as well and then identifies minutia. It's written in c# but it might give you some bright ideas.

How to translate ImageMagick commands into ImageMagick API calls?

I need to do some light image processing on large image, and I try to use ImageMagick for that. Unfortunately, the API documentation has a very low information content, with documentation similar to:
MagickDeleteImageArtifact
MagickDeleteImageArtifact() deletes a wand artifact.
The format of the MagickDeleteImageArtifact method is:
MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand, const char *artifact)
A description of each parameter follows:
image
the image.
artifact
the image artifact.
Could anybody suggest a few information sources for ImageMagick that would have, you know, information?
(and yes, this piece of "documentation" is pasted from ImageMagick web site, with the incorrect parameter)
Edit: Here is the context: I develop an iOS application, so I want to call ImageMagick from the C language (or Objective-C or C++). The need is to split large images that would not fit in the limited amount of RAM of an iOS device into smaller "tiles" (and downsample for lower resolution versions too. But once I have the tiles, I can do that using only iOS facilities).
Edit 2: Using the command line, I can achieve this tiling with the "convert" command with corresponding parameters. So my immediate need would be to translate such a command line command into the relevant set of API calls.

Using ImageMagick from Command line in .Net?

I am using ImageMagick from Commandline in .Net? Although a .Net wrapper (ImageMagick.Net in codeplex) is available but it is still in alpha and does not have implementation for all the command line options e.g Distort, Montage. Therefore I am using System.Diagnostics.Process class to invoke the ImageMagick command line.
What are the Pros/Con of this approach? I can see a performance issue if I have to perform multiple transformation on the same image and if I invoke the command twice then the commandline will load the Image twice. Is there a way I can chain the commands so that output of the first transformation is feed into the second command?
It will definitely be slower, and when you chain commands, you are going to be encoding and decoding the image into a format unnecessarily -- if you do this, make sure you use a lossless format like PNG for intermediate formats. To speed it up, use one without compression.
Two other choices
Use ImageMagick.NET and then wrap anything else you need from imagemagick yourself, probably by contributing to the project
My company, Atalasoft, has a free .NET imaging SDK with a lot of overlap with ImageMagick. You can download here: http://atalasoft.com/photofree -- Montage is basically the same as our Overlay commands and Distort is a 2D transformation, which are all included. If ImageMagick.NET can accept and produce .NET Bitmap objects, then you can use both together fairly easily.

Resources