Total members 11893 |It is currently Tue Nov 05, 2024 12:28 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





SIR,
i am doing a application for image processing where i am comparing 2 immages,,and i want to highlight the pixcles where the diffrence occours with a red colored circle..i am able to compare the images but not able to highlight it with the circle..i want the pixel which is diffrent to be the center of the circle..

if (img1.Width == img2.Width && img1.Height == img2.Height)
{
//drawing
g = pictureBox1.CreateGraphics();
//////g = Graphics.FromImage(pictureBox1.Image);


for (int i = 0; i < img1.Width; i++)
{
for (int j = 0; j < img1.Height; j++)
{
img1_ref = img1.GetPixel(i, j).ToString();
img2_ref = img2.GetPixel(i, j).ToString();
if (img1_ref != img2_ref)
{
count2++;
flag = false;

//drawing

x = i;
y = j;
pen = new Pen(Color.Red);
g.DrawEllipse(pen, x, y,100,100);


//drawing
MessageBox.Show("error");

break;
}
count1++;
}
progressBar1.Value++;
}

if (flag == false)
MessageBox.Show("Sorry, Images are not same , " + count2 + " wrong pixels found");
else
MessageBox.Show(" Images are same , " + count1 + " same pixels found and " + count2 + " wrong pixels found");
}
else
MessageBox.Show("can not compare this images");
this.Dispose();
}




Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : i want to draw a circle on a image(any format bmp,jpeg etc.)
 Applet get mouse clicks and draw circle     -  
 Draw rectangle on image     -  
 Drawing circle using circle equation directly , on mouse     -  
 Read an image bitmap (.bmp) file and draw it as texture     -  
 PDF Format     -  
 Format Specifier in C     -  
 Format Debugging Messages     -  
 Number format for current     -  
 Number format function prototype     -  
 Printing today+ current date with different format     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com