image-processing

How do I convert any image to a 4-color paletted image using the Python Imaging Library ?

I have a device that supports 4-color graphics (much like CGA in the old days). I wanted to use PIL to read the image and convert it using my 4-color palette (of red, green, yellow, black), but I can't figure out if it's even possible at all. I found some mailing list archive posts that seem to suggest other people have tried to do so ...

PHP: destructor vs register_shutdown_function

I have a PHP class that creates a PNG image on the fly and sends it to browser. PHP manual says that I need to make sure that imagedestroy function is called at end to release the memory. Now, if I weren't using a class, I would have some code like this: function shutdown_func() { global $img; if ($img) imagedestroy($im...

How is the photoshop cutout filter implemented?

Photoshop has a lot of cool artistic filters, and I'd love to understand the underlying algorithms. One algorithm that's particularly interesting is the Cutout filter (number 2 at the link above). It has three tunable parameters, Number of Levels, Edge Simplicity, and Edge Fidelity. Number of levels appears to drive a straightforward ...

High Quality Image Scaling C#

I want to scale an image in C# with quality level as good as Photoshop does. Is there any C# image processing library available to do this thing? ...

BiCubic Shaper PHP Image Resize

Photoshop has that great: BiCube Shaper option for resizing. However I cannot find an equivalent. I've seen various code using GD that used imagecopyresampled and custom unsharp mask, but no where near the quality I am expecting. Any help? ...

What is the best language for footprint recognition?

Hi everyone. I have a project to recognize the footprint of animals. It is similar to facial recognition. There is a need to store footprint images in a database and compare them with images captured by camera. The question is what is the appropriate programming language to do this? ...

Find JPEG resolution with PHP

Calling all PHP gurus! I understand that you can use getimagesize() to get the actual pixel height and width of an image in PHP. However, if you open an image in photoshop and look at the image size dialog, you notice that there is a resolution value that determines the print size of the image. Given an arbitrary jpg image file, I need...

Showing too much 'skin' detection in software

I am building an ASP.NET web site where the users may upload photos of themselves. There could be thousands of photos uploaded every day. One thing my boss has asked a few time is if there is any way we could detect if any of the photos are showing too much 'skin' and automatically move flag these as 'Adults Only' before the editors make...

Python: Check if uploaded file is jpg

How can I check if a file uploaded by a user is a real jpg file in Python (Google App Engine)? This is how far I got by now: Script receives image via HTML Form Post and is processed by the following code ... incomming_image = self.request.get("img") image = db.Blob(incomming_image) ... I found mimetypes.guess_type, but it does not ...

Recommended face detection tools/SDK/etc.

I'm looking for a quick way to detect faces in pictures (stored as JPG or any other popular image format). Code in any popular programming language will do (Python, C#, Java, Matlab, etc.). I'm also willing to implement an algorithm by myself, as long as it is proven to be a good working one. Alternatively, if there are known freeware (...

Why do I get the exception - Unable to load DLL '?????.dll': The specified module could not be found.

I'm using Emgu.CV which is a C# wrapper for the OpenCV libraries. I changed the Emgu.CV source to invoke from the latest OpenCV library cv110.dll instead of cv100.dll and now I get this error (where ????? is cv110.dll). I have placed the cv110.dll file in all the same locations as the cv100.dll file however this does not help. On a br...

Image library recommendations

I'm looking for some image library that can work with multiple formats (jpg,gif,png), and is fast at displaying the images to the screen. Also, it would be nice if I could specify only part of the image to render to the screen. In the end I want to have lots of images on the screen that I can pan and zoom about. This is for a personal...

How does the fill operation work in paint applications?

All paint programs, independent of how simple or complex they are, come with a fill tool. This basically replaces the color of a closed region with another color. I know that there are different APIs to do this, but I am interested in the algorithm. What would be an efficient algorithm to implement this tool? A couple of things I can th...

.NET set image display size

I am using some custom controls one of which is a tooltip controller that can display images, so I am using th ebelow code to instantiate it: Image newImage = Image.FromFile(imagePath); e.ToolTipImage = newImage; obviously could inline it but just testing at the moment. The trouble is the image is sometimes the wrong size, is there a ...

OpenCV Object Detection - Center Point

Given an object on a plain white background, does anybody know if OpenCV provides functionality to easily detect an object from a captured frame? I'm trying to locate the corner/center points of an object (rectangle). The way I'm currently doing it, is by brute force (scanning the image for the object) and not accurate. I'm wondering...

Which is faster - C# unsafe code or raw C++

I'm writing an image processing program to perform real time processing of video frames. It's in C# using the Emgu.CV library (C#) that wraps the OpenCV library dll (unmanaged C++). Now I have to write my own special algorithm and it needs to be as fast as possible. Which will be a faster implementation of the algorithm? Writing an '...

Finding an interesting frame in a video

Does anyone know of an algorithm that I could use to find an "interesting" representative thumbnail for a video? I have say 30 bitmaps and I would like to choose the most representative one as the video thumbnail. The obvious first step would be eliminate all black frames. Then perhaps look for the "distance" between the various fram...

Applying PixelShaders on offscreen Bitmaps

hi there, i'm currently experimenting using PixelShaders introduced with .net 3.5 sp1 to improve image processing performance. everything is much faster , but til yet i just had effects applied to some elements in my wpf forms, that i actually want to avoid. we have a bunch of image processing functionality and i'd like to replace some...

Find known sub image in larger image

Does anyone know of an algorithm (or search terms / descriptions) to locate a known image within a larger image? e.g. I have an image of a single desktop window containing various buttons and areas (target). I also have code to capture a screen shot of the current desktop. I would like an algorithm that will help me find the target i...

Flash Screenshot

We're trying to send an image of a large SWF file to a server to have it mailed out and we're having a bit of trouble with transmission time. The SWF is about 900px x 600px and restricted to AS2 so we've been using this Bitmap Exporter class. We've tried using several different ways to transmit the data; base10, base36 and base128 but ...