Click here to Skip to main content
16,004,991 members
Home / Discussions / C#
   

C#

 
GeneralRe: Is it possible to block access to a specific registry key? Pin
turbosupramk330-Dec-10 10:37
turbosupramk330-Dec-10 10:37 
GeneralRe: Is it possible to block access to a specific registry key? Pin
turbosupramk330-Dec-10 15:57
turbosupramk330-Dec-10 15:57 
AnswerRe: Is it possible to block access to a specific registry key? Pin
HaBiX3-Jan-11 22:28
HaBiX3-Jan-11 22:28 
QuestionUpdate Software Version. Pin
Sanket.Patil28-Dec-10 19:10
Sanket.Patil28-Dec-10 19:10 
AnswerRe: Update Software Version. Pin
Hiren solanki28-Dec-10 19:14
Hiren solanki28-Dec-10 19:14 
AnswerRe: Update Software Version. Pin
TweakBird28-Dec-10 22:46
TweakBird28-Dec-10 22:46 
GeneralRe: Update Software Version. Pin
Not Active29-Dec-10 1:44
mentorNot Active29-Dec-10 1:44 
QuestionAn exception occures when I process an image. please help me [modified] Pin
inayathussaintoori28-Dec-10 14:11
inayathussaintoori28-Dec-10 14:11 
Hello
I am doing face detection in live camera, first I detect skin and then I copy that skin area from the original image and re-size to he 50(width) and 70(height), because my template is 50(width) by 70(height) size.
when I start so some frames are checked properly but after some moment (or some time at the first frame) the following exception is generated.
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
the above error is generated on below line in the code.
stor = ((rowTamplate[(h * pixelSize)] + rowTamplate[(h * pixelSize) + 1] + rowTamplate[(h * pixelSize) + 2]) / 3) - ((rowBitmap[(h * pixelSize)] + rowBitmap[(h * pixelSize) + 1] + rowBitmap[(h * pixelSize) + 2]) / 3);

I thought alot to understand this problem but I failed.
the actual code is here.
BitmapData templateData = template.LockBits(new Rectangle(0, 0, 50, 70), System.Drawing.Imaging.ImageLockMode.WriteOnly, template.PixelFormat)
 bitmap = ImageResizer.ResizeImage(bitmap, 50, 70);//here bitmap is a region from original image where skin is present.and here I resize it to 50(width) by 70(height).
 BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, 50, 70), System.Drawing.Imaging.ImageLockMode.WriteOnly, bitmap.PixelFormat);
                       
double stor = 0;
for (int w = 0; w < 70; w++)
{
   Byte* rowTamplate = (byte*)templateData.Scan0 + (w * templateData.Stride);
   Byte* rowBitmap = (byte*)bitmapData.Scan0 + (w * bitmapData.Stride);
   for (int h = 0; h < 50; h++)
       {
             stor = 0;
//the exception is generated on the fllowing line
             stor = ((rowTamplate[(h * pixelSize)] + rowTamplate[(h * pixelSize) + 1] + rowTamplate[(h * pixelSize) + 2]) / 3) - ((rowBitmap[(h * pixelSize)] + rowBitmap[(h * pixelSize) + 1] + rowBitmap[(h * pixelSize) + 2]) / 3);
            if (stor < 0)
                                {
                                    stor *= -1;
                                }
                                PixelsCounter += (int)stor;
                                stor = 0;
                            }
                        } 

thanks

modified on Tuesday, December 28, 2010 9:53 PM

AnswerRe: An exception occures when I process an image. please help me Pin
Luc Pattyn28-Dec-10 14:58
sitebuilderLuc Pattyn28-Dec-10 14:58 
GeneralRe: An exception occures when I process an image. please help me Pin
inayathussaintoori28-Dec-10 16:00
inayathussaintoori28-Dec-10 16:00 
AnswerRe: An exception occures when I process an image. please help me Pin
Luc Pattyn28-Dec-10 16:24
sitebuilderLuc Pattyn28-Dec-10 16:24 
QuestionDoes Native C# can do all what WMI can do special for Remote PC?? Pin
AhmedOsamaMoh28-Dec-10 8:58
AhmedOsamaMoh28-Dec-10 8:58 
AnswerRe: Does Native C# can do all what WMI can do special for Remote PC?? Pin
Dave Kreskowiak28-Dec-10 9:28
mveDave Kreskowiak28-Dec-10 9:28 
GeneralRe: Does Native C# can do all what WMI can do special for Remote PC?? Pin
Richard MacCutchan28-Dec-10 22:11
mveRichard MacCutchan28-Dec-10 22:11 
AnswerRe: Does Native C# can do all what WMI can do special for Remote PC?? Pin
Manfred Rudolf Bihy28-Dec-10 9:31
professionalManfred Rudolf Bihy28-Dec-10 9:31 
AnswerRe: Does Native C# can do all what WMI can do special for Remote PC?? Pin
Luc Pattyn28-Dec-10 14:56
sitebuilderLuc Pattyn28-Dec-10 14:56 
JokeRe: Does Native C# can do all what WMI can do special for Remote PC?? Pin
Dan Mos29-Dec-10 1:45
Dan Mos29-Dec-10 1:45 
QuestionDataGridView Sorting Problem Pin
AhmedOsamaMoh28-Dec-10 7:50
AhmedOsamaMoh28-Dec-10 7:50 
AnswerRe: DataGridView Sorting Problem Pin
Not Active28-Dec-10 7:53
mentorNot Active28-Dec-10 7:53 
GeneralRe: DataGridView Sorting Problem Pin
AhmedOsamaMoh28-Dec-10 7:55
AhmedOsamaMoh28-Dec-10 7:55 
GeneralRe: DataGridView Sorting Problem Pin
Not Active28-Dec-10 8:00
mentorNot Active28-Dec-10 8:00 
GeneralRe: DataGridView Sorting Problem Pin
Keith Barrow28-Dec-10 9:22
professionalKeith Barrow28-Dec-10 9:22 
GeneralRe: DataGridView Sorting Problem Pin
Not Active28-Dec-10 9:49
mentorNot Active28-Dec-10 9:49 
AnswerRe: DataGridView Sorting Problem Pin
Richard Andrew x6428-Dec-10 8:19
professionalRichard Andrew x6428-Dec-10 8:19 
GeneralRe: DataGridView Sorting Problem Pin
Not Active28-Dec-10 8:54
mentorNot Active28-Dec-10 8:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.