an easy(very inefficient) solution maybe:
Take a pixel P and build a map which will contain pixels of all colors such
that overall
area including P is minimum. if u do this for all pixels, u will know which
one is minimum.
obviously this is not efficient.
i.e Take P and insert into the map, for all other points Q see if u can
insert into the map
if the same color as point(Q) doesnt exists. If same color point exists see
if by including it the overall
area(so-far) will become smaller. if so replace that point with Q. So in the
end you will get some points
one of each color and and the area is min including P.
running time is very bad = O(n^2 * time for cacl area of k points)

if u need efficient solution, u may want to look at how
region points are stored in a B-tree in which each leaf node of a Btree is a
small region of closeby points.
If a small region doesnt satify ur condition of having all colors, u move up
to a parent and check and so on.


On 4/15/07, elesser <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> In a program I am currently writing, I have a matrix (around 60000 x
> 3) containing information about the pixels in an image: every row of
> the matrix has information about 1 pixel. The first column contains
> the pixel id and the following two columns contain the x and y
> coordinates. If two rows have the same pixel id, this indicates that
> these two pixels have exactly the same RGB values.
>
> What I'm now trying to do is finding the smallest box in the image
> that contains ALL the colors in the image, that is, that contains
> every pixel with different RGB values at least one time. As far as I
> know, this is done by comparing all x and y coordinates of all the
> pixels with one another, looking for the smallest difference when
> substracting the xy values from each other. The problem is that from
> all identical pixel id's, one pixel has to be chosen that, overall, is
> the closest to all other pixels.
>
> Does anyone have any idea how to do this? I'm programming in MATLAB,
> but code in C or C++ is fine.
>
> Thanks.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to