samedi 28 mars 2015

How to divide image into sub blocks 8x8 in c#?

I need to make Image Watermarking in DCT method using c#. But I don't know how to dividing image into 8x8 blocks and make the DCT transform using c#. Anyone can help me please? So far this is what I've tried.



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using Emgu.CV;
using Emgu.CV.Util;
using Emgu.CV.Structure;

namespace DCTTransform
{
public partial class Form1 : Form
{
Image<Bgr, Byte> img;
Image<Ycc, Byte> imgYcc;
Bitmap bmp;


public Form1()
{
InitializeComponent();
}

private void btBrowse_Click(object sender, EventArgs e)
{
OpenFileDialog od = new OpenFileDialog();
if (od.ShowDialog() == DialogResult.OK)
{
img = new Image<Bgr, byte>(od.FileName);
pcCitra.Image = img.ToBitmap();
}
}



private void btTransform_Click(object sender, EventArgs e)
{
imgYcc = img.Convert<Ycc, Byte>();
bmp = imgYcc[0].ToBitmap();
pbDCT.Image = bmp;

}
}
}


Thanks before :)


Aucun commentaire:

Enregistrer un commentaire