473,471 Members | 4,687 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2006
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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.