divide image region

  • Thread starter Thread starter Ruby Nadler
  • Start date Start date
R

Ruby Nadler

Hi EveryOne,
Does some one knows a way or tool that knows how to divide image into
regions with c# so if the image is like a table style i will now the
positions of the columns?
i can read the pixlels colors but it will be very slow.
thanks
 
Ruby,

Can you be a little more specific with what you are trying to do? What
do you mean if the image is like a "table style"? Are you trying to place
pieces of an image into a table?

What is the end result of what you are trying to do?
 
Hi Nicholas,
what i am trying to do is cut b&w image (like newspaper page) into columns
and rows according to its layout.
any idea?
thanks.

Nicholas Paldino said:
Ruby,

Can you be a little more specific with what you are trying to do? What
do you mean if the image is like a "table style"? Are you trying to place
pieces of an image into a table?

What is the end result of what you are trying to do?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Ruby Nadler said:
Hi EveryOne,
Does some one knows a way or tool that knows how to divide image into
regions with c# so if the image is like a table style i will now the
positions of the columns?
i can read the pixlels colors but it will be very slow.
thanks
 
Hi Nicholas,
what i am trying to do is cut b&w image (like newspaper page) into columns
and rows according to its layout.
any idea?
thanks.

AFAIK, you can manipulate images efficiently by using unsafe code
regions and pointer arithmetics. There is a simple example in C# 3.0
in a Nutshell which I remember:

unsafe void RedFilter(int[,] bitmap)
{
int length = bitmap.Length;
fixed (int* b= bitmap)
{
int* p = b;
for(int i = 0; i < length; i++)
*p++ &= 0xFF;
}
}

This kind of iteration over a bitmap avoids runtime index checking and
runtime type checking as you would have by accessing the bitmap via
[x,y]
hth,
-- Henon

my site: http://www.eqqon.com
 
Back
Top