473,289 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Matrixes & Bitmaps

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

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
Nov 16 '05 #1
6 2002
Hi,

You can look at this links they do image processing in C#:
http://www.c-sharpcorner.com/Code/20...Processing.asp

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

http://msdn.microsoft.com/library/de...rp11152001.asp

Regards,
Emad

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

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

Nov 16 '05 #2
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" <e_*******@hotmail.com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
Hi,

You can look at this links they do image processing in C#:
http://www.c-sharpcorner.com/Code/20...Processing.asp

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

http://msdn.microsoft.com/library/de...rp11152001.asp

Regards,
Emad

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

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


Nov 16 '05 #3
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."

Nov 16 '05 #4
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

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

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:RR**************@cpmsftngxa10.phx.gbl...
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."

Nov 16 '05 #5
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" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:uN**************@TK2MSFTNGP11.phx.gbl...
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" <e_*******@hotmail.com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
Hi,

You can look at this links they do image processing in C#:
http://www.c-sharpcorner.com/Code/20...Processing.asp

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

http://msdn.microsoft.com/library/de...rp11152001.asp
Regards,
Emad

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

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



Nov 16 '05 #6
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."

Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jose Garcia | last post by:
Hi there, Can somebody explain me how can i use matrixes with dinamic memory? I use malloc and free (NOT new & delete). I want to access to the matrix like Matrix but i don't know how to do that...
14
by: LumisROB | last post by:
Is it possible to create matrixes with vector <vector <double >> ? If it is possible which is the element m23 ? You excuse but I am not an expert Thanks ROB
0
by: SHC | last post by:
Hi all, I saw the following 2 files used in the OpenGL and DirectX 9 programming: 1) resource.h //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by...
2
by: Mike | last post by:
Hello everybody. I am drawing a country map that consists of 149 municipality bitmaps, each around 25 Kb. I draw it onto the in-memory bitmap, then draw it on the picture box. I use C++, but...
3
by: TFB | last post by:
I am looking, but cannot find, the location of icons and bitmaps after installation of VS2005. Are there any included? I know in 2003 there were many to choose from but either I am looking in the...
2
by: liav.ezer | last post by:
Hello all, I need to find the correlation between two binary matrixes - should i use cross correlation for that or i can preform a simple convulution task to achive it? Is there any C++ library...
1
by: KinGPIN | last post by:
hi ; I have a homework about CMatrix; and i had a problem ;in my homowork i hace functions and operators written for CMatrix class(this was my first homework); it is wanted to inherite the...
6
by: Greg Esres | last post by:
I have some text lines to print that are much longer than the width of the paper, maybe as much as 6 times. For a given page, I'd like everything that doesn't fit to print on a second page, and...
4
by: ishakteyran | last post by:
hello to all.. i have a realy tough assignment which requires me to add, substract, multiply, and get inverse of non-sparse and sparse matrixes.. in a more clear way it wants me to to the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.