private void DecodeBarcode() { var reader = new BarcodeReader(); while (true) { if (currentBitmapForDecoding != null) { currentBitmapForDecoding = gsFilter.Apply(currentBitmapForDecoding); if (cbContrast.Checked) { csFilter.ApplyInPlace(currentBitmapForDecoding); } if (cbHistogram.Checked) { heFilter.ApplyInPlace(currentBitmapForDecoding); } if (btnThreshold.BackColor == Color.Green) { tsFilter.ApplyInPlace(currentBitmapForDecoding); } Invoke(new Action <Bitmap>(ShowFrame), currentBitmapForDecoding.Clone()); var result = reader.Decode(currentBitmapForDecoding); if (result != null) { Invoke(new Action <Result>(ShowResult), result); } currentBitmapForDecoding.Dispose(); currentBitmapForDecoding = null; } Thread.Sleep(sleep); } }
private void button14_Click(object sender, EventArgs e) { var histogramEqualization = new HistogramEqualization(); histogramEqualization.ApplyInPlace(picture.bitmap); pictureBox1.Image = picture.bitmap; }
private void button4_Click(object sender, EventArgs e) { //Equalização de Histograma HistogramEqualization hq = new HistogramEqualization(); hq.ApplyInPlace(bmp); pb_Original.Image = bmp; }
// ========================================================= private void HistogramFunct(ref Bitmap frame) { // create filter HistogramEqualization filter = new HistogramEqualization(); // process image filter.ApplyInPlace(frame); }
public static Bitmap HistogramEquilization(Bitmap bmp) { // create filter HistogramEqualization filter = new HistogramEqualization(); // process image filter.ApplyInPlace(bmp); return(bmp); }
public Bitmap Equalize(Bitmap bmp) { HistogramEqualization filter = new HistogramEqualization(); // process image filter.ApplyInPlace(bmp); return(bmp); }
/// <summary> /// Change the pixel format of the bitmap image /// </summary> /// <param name="inputImage">Bitmapped image</param> /// <param name="newFormat">Bitmap format - 24bpp</param> /// <returns>Bitmap image</returns> private static Bitmap ChangePixelFormat(Bitmap inputImage) { var img = inputImage.Clone(new Rectangle(0, 0, inputImage.Width, inputImage.Height), inputImage.PixelFormat); var histogramEqualization = new HistogramEqualization(); var smoothing = new Mean(); histogramEqualization.ApplyInPlace(img); smoothing.ApplyInPlace(img); img = img.Clone(new Rectangle(0, 0, inputImage.Width, inputImage.Height), PixelFormat.Format24bppRgb); return(img); }
private static void Main(string[] args) { var image = TestUtils.LoadImage(@"D:\ScarIntelFinal\ScarIntel\BD\filipe_dir_an\filipe_dir_an_2.bmp"); var fp = new FingerprintTemplate(image); Bitmap img = (Bitmap)Bitmap.FromFile(@"D:\ScarIntelFinal\ScarIntel\BD\filipe_dir_an\filipe_dir_an_2.bmp"); HistogramEqualization equalization = new HistogramEqualization(); equalization.ApplyInPlace(img); img.Save("Aforge.bmp"); }
public static List <Rectangle> DetectFaces(Bitmap image) { List <Rectangle> xfaces = new List <Rectangle>(); HaarObjectDetector detector; detector = new HaarObjectDetector(new FaceHaarCascade(), 20, ObjectDetectorSearchMode.Average, 1.1f, ObjectDetectorScalingMode.SmallerToGreater); detector.UseParallelProcessing = true; detector.Suppression = 2; var grayImage = Grayscale.CommonAlgorithms.BT709.Apply(image); HistogramEqualization filter = new HistogramEqualization(); filter.ApplyInPlace(grayImage); Rectangle[] faces = detector.ProcessFrame(grayImage); xfaces.AddRange(faces); return(xfaces); }
private void eqHistogram_Click(object sender, RoutedEventArgs e) { ClearTextBoxes(); brightness = 0; Brightness.Value = 0; if (eqHistogram.IsChecked == true) { HistogramEqualization filter = new HistogramEqualization(); filter.ApplyInPlace(mainPhoto); Photography.Source = ToBitmapImage(mainPhoto); } else { UpdatePicture(ImageURL); Photography.Source = ToBitmapImage(mainPhoto); } mainPhotoIS = Photography.Source; UpdateHistograms(null); UpdateChannelPreviews(null); }
private void ImageHistogram(Bitmap bmp) // 이미지 평활화 함수 { HistogramEqualization filter = new HistogramEqualization(); filter.ApplyInPlace(bmp); }