This code checks 2 images’ pixels, compares each pixels based on the threshold (<= 7), finds a best fitting watermark image from the system given 6 images, and loads that image next to the cover image.
For a 100*100 watermark image this particular code takes nearly 130 secs to give output.
Please suggest some ways to optimize it regarding execution time.
public partial class Embedding_Pixels_Evaluation : Form
private Stopwatch sp;
sp = new Stopwatch();
button1.Enabled = false;
//choose watermark from system
private void button2_Click(object sender, EventArgs e)
Boolean imageSize = false;
Boolean flag = false;
int count_miss = new int;
int count_hit = new int;
for (int cnt = 1; cnt <= 6; cnt++)
//sample watermarks saved in sampleimage folder
string curpath = Application.StartupPath.ToString() + @"sampleimage"