Matrixes & Bitmaps

  • Thread starter Thread starter Tamir Khason
  • Start date Start date
T

Tamir Khason

Assist,
I have different images wich I have to compare. Tnx to Bob, did it in unsafe
blocks and it even works :) , BUT -> of couse I recieve buffer oveflows
often.
Checked the code and there is nothing to fix, so here is the million dollar
question: How to manipulate bitmaps as Matrixes (or byte[,]) it ONLY COLOR
MATRIX - NOTHIG MORE and I do not need to do something really VISUAL within
the program only math functions.
Question: How to convert Bitmap to Matrix in safe code?

TNX
 
Thank you for response, but as I asked: I did it with unsafe code and this
works fine, I want to do it with safe code using Math methods only (if
possible).

TNX

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

Emad Barsoum said:
Hi,

You can look at this links they do image processing in C#:


http://www.c-sharpcorner.com/Code/2004/April/ImageProcessing.asp

http://www.codeproject.com/cs/media/csharpgraphicfilters11.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp11152001.asp

Regards,
Emad

Tamir Khason said:
Assist,
I have different images wich I have to compare. Tnx to Bob, did it in unsafe
blocks and it even works :) , BUT -> of couse I recieve buffer oveflows
often.
Checked the code and there is nothing to fix, so here is the million dollar
question: How to manipulate bitmaps as Matrixes (or byte[,]) it ONLY
COLOR
MATRIX - NOTHIG MORE and I do not need to do something really VISUAL within
the program only math functions.
Question: How to convert Bitmap to Matrix in safe code?

TNX
 
Hi Tamir,

I'm not quite sure about the safe and unsafe way you mentioned. Since there
is no method in GDI+ available to do subtract by pixel RGB value, you have
to implement it yourself. The only way we can think is to iterate each
pixel and do a subtract. I don't think there is safer ways.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Thank you for reply. Strange problem here.
I tried to do this with THE SAME IMAGE. What it have to be? Right, Black
Image x-x=0, BUT Without treshold there are areas untuched left. WHY?
I'm doing iteraction one-by-one in pixels (even tried within RGB values),
but no change. p1[x]-p2[x] > 0 even when p1 and p2 retrived from the same
image.
Please advice
 
Hi,

To do it with safe code you need to use GetPixel and SetPixel function,
which provided in last link but it is much more slower, in the last link it
took 14 sec to convert from RGB to gray image using safe code and 1.2 second
using unsafe code.

Regards,
Emad

Tamir Khason said:
Thank you for response, but as I asked: I did it with unsafe code and this
works fine, I want to do it with safe code using Math methods only (if
possible).

TNX

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

Emad Barsoum said:
Hi,

You can look at this links they do image processing in C#:


http://www.c-sharpcorner.com/Code/2004/April/ImageProcessing.asp

http://www.codeproject.com/cs/media/csharpgraphicfilters11.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp11152001.asp

Regards,
Emad

Tamir Khason said:
Assist,
I have different images wich I have to compare. Tnx to Bob, did it in unsafe
blocks and it even works :) , BUT -> of couse I recieve buffer oveflows
often.
Checked the code and there is nothing to fix, so here is the million dollar
question: How to manipulate bitmaps as Matrixes (or byte[,]) it ONLY
COLOR
MATRIX - NOTHIG MORE and I do not need to do something really VISUAL within
the program only math functions.
Question: How to convert Bitmap to Matrix in safe code?

TNX
 
Hi Tamir,

If the two same images cannot produce a black image, might there be
something wrong with the algorithm? Could you show us the code here so that
I can try to reproduce it on my computer.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top