Ask Your Question

costa_974's profile - activity

2018-12-13 06:02:43 -0600 received badge  Popular Question (source)
2014-11-25 13:15:54 -0600 asked a question Is there an autocrop function in OpenCV?

Is there an autocrop function in OpenCV? Possibly exposed to Java?

2014-10-25 06:05:12 -0600 commented question How to efficiently count the number of unique colors in Java
public int countColors(byte[] img_buffer, int channels) {

    Set<Integer> set =  new HashSet<Integer>();
    int img_buffer_length = img_buffer.length;

    for (int i = 0; i < (img_buffer_length - channels); i += channels)
    {
         int pixelVal = 0;
         for (int j = 0; j < channels; j++) {
            pixelVal += (img_buffer[i + j] << (8 * j));
         }
         set.add(pixelVal);
    }

    int r = set.size();

    return r;

}
2014-10-25 05:20:28 -0600 commented answer How to efficiently count the number of unique colors in Java

berak... I own the server. warhol's marylin has 5 unique colors only for human beings. http://blog.virginmegastore.me/index.php/are-you-the-next-big-artist/andy-warhols-marilyn-monroe-pink-fluo/ has for example has 81912 colors. Thanks anyway for your comment.

2014-10-24 15:25:26 -0600 commented answer How to efficiently count the number of unique colors in Java

I understand, maybe opencv is not the right/best tool, but I'm working on a photo-website and I would like to warn or discard photo with bad quality... I'm naive... but I was thinking on counting colors! :)

2014-10-24 15:19:51 -0600 commented answer How to efficiently count the number of unique colors in Java

I'm glad berak and petititi you have understood my question! Maybe others are too focused on computer vision... but I'm using opencv for a photo-website... and I would warn or discard photo with too little colors. Maybe now I'm clearer! :)

2014-10-24 15:12:44 -0600 commented answer How to efficiently count the number of unique colors in Java

Another doubt... I don't understand why opencv doesn't have a simple array of 32bit integers representing RGBA.

2014-10-24 15:03:05 -0600 commented answer How to efficiently count the number of unique colors in Java

Ok thank you very much! But I think that java will be a little slow iterating every pixel... I hoped there was a fast native method.

But... by the way... do you know that opencv.org is not accessible since 2 days... Site not configured, Coming soon: Another fine website hosted by WebFaction.

2014-10-23 15:24:23 -0600 commented question How to efficiently count the number of unique colors in Java

ok... you guys are too smart! i'm not able to be clear! the c# code is just an example! how can I do the same in opencv? I just want to count the colors in a image!

2014-10-22 05:13:26 -0600 commented question How to efficiently count the number of unique colors in Java

c# code: public static int CountImageColors(string fileName) { int count = 0; HashSet<Color> colors = new HashSet<Color>(); Bitmap bmp = null;

if (File.Exists(fileName))
{
    try
    {
        bmp = new Bitmap(fileName);
        if (bmp != null)
        {
            for (int y = 0; y &lt; bmp.Size.Height; y++)
            {
                for (int x = 0; x &lt; bmp.Size.Width; x++)
                {
                    colors.Add(bmp.GetPixel(x, y));
                }
            }
            count = colors.Count;
        }
    }
    catch 
    {
        throw;
    }
    finally
    {
        colors.Clear();
        bmp.Dispose();
    }
2014-10-21 12:18:42 -0600 commented question How to efficiently count the number of unique colors in Java

It's much simpler... let's rephrase the question in "How to efficiently count colors in a Mat object in Java", without "unique"... I know there's cvCountNonZero, but I have to split the channels... etc, or I could iterate every pixels. I would like a simple way to count colors like in Photoshop fo example. Thanks.

2014-10-20 15:07:53 -0600 asked a question How to efficiently count the number of unique colors in Java

How to efficiently count the number of unique colors in Java?

2014-05-31 14:18:31 -0600 received badge  Editor (source)
2014-05-31 10:24:38 -0600 received badge  Student (source)
2014-05-31 10:06:24 -0600 asked a question Compute identical hash of near identical images

Different browser render images in different ways. Is there a kind of smooth-algorithm to make them identical. I tried different filters median, pixelate, avarage, etc with no luck.

You can find an example (chrome vs ie) and a comparison i did with imagemagick.

https://drive.google.com/folderview?id=0B9AFP7Wrq30xc0NUSlZPQnA3ZU0&usp=sharing

Thanks.

ps: the fact is that i want to get some information server-side (on a different server) that is related to the image (jpg). i could transmit the whole image, but it's not practical. So I was thinking to compute a sha512 of the image client-side and retrieve the info by that. I hope i'm clearer.