Looking for an algorithm

  • Thread starter Christian Gmeiner
  • Start date
C

Christian Gmeiner

Hi all,

I have the following problem. I want to encode a 4bit bitmap into the
subpicture format of an DVD [1]. Now i can use
per "region" only for colors but for the whole subpicutre I can use 16
colors. So imagine I have the this example bitmap.

5 1 1 1 1
5 2 2 3 3
5 2 2 4 4
5 2 2 4 4


5 colors and in the end I should have min 2 regions. So whats now an
region you might ask: I will give some examples:

1)
5 1 1
5 2 2
5 2 2
5 2 2

2)
1 1 1 1
2 2 3 3
2 2 4 4
2 2 4 4


So a region is an area of the whole bitmap which only uses 4 colors
and it must be a rectangle. At the moment I am looking for a Region
Detection algorithm, which I can use to produce such regions.

Thanks for every idea, link and answer,
Christian

[1] http://dvd.sourceforge.net/dvdinfo/spu.html
 
V

Victor Bazarov

Christian said:
I have the following problem. I want to encode a 4bit bitmap into the
subpicture format of an DVD [1]. Now i can use
per "region" only for colors but for the whole subpicutre I can use 16
colors. So imagine I have the this example bitmap.

5 1 1 1 1
5 2 2 3 3
5 2 2 4 4
5 2 2 4 4


5 colors and in the end I should have min 2 regions. So whats now an
region you might ask: I will give some examples:

1)
5 1 1
5 2 2
5 2 2
5 2 2

2)
1 1 1 1
2 2 3 3
2 2 4 4
2 2 4 4


So a region is an area of the whole bitmap which only uses 4 colors
and it must be a rectangle. At the moment I am looking for a Region
Detection algorithm, which I can use to produce such regions.

Please ask in 'comp.programming'. This is *not* a C++ language
question. When you have the algorithm, but have problems putting
it into C++ terms, ask again, we'll help.

Also, consider googling for "region detection algorithm". FAWK,
if you know the name, you should be able to find at least something.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
ScottChare

Latest Threads

Top