Ask Your Question
0

edge detection of a signature

asked 2013-08-07 05:10:42 -0500

hash gravatar image

updated 2013-08-08 01:45:35 -0500

Is there any opencv codes for edge detection of a signature..I am currently doing my final year project and it is based on identified number of signatures in a signature sheet. but in here on side of the signature sheet there are printed names..and other side hand written signatures..is there any opencv codes for find different between those two and count the number of signature?

Can I please have an idea about this issue please..Thank you

edit retag flag offensive close merge delete

Comments

could you provide some sample images?

simon111 gravatar imagesimon111 ( 2013-08-07 05:13:46 -0500 )edit

3 answers

Sort by » oldest newest most voted
0

answered 2013-08-07 06:58:33 -0500

updated 2013-08-08 01:50:10 -0500

You can filter signatures from other thing on the sheet.

1- specify the foreground & background of the sheet.

2- classify foreground by the object color.

3- classify by width of stroke of any foreground object by the distance transform.

4- classify stoke by the zero crossing.

Edit: In the preprocessing stage,the noise level or quality of the sheet can be determined.Use the blockwise dft() ,ٍEntropy ,Standard deviation to compute the quality of sheet then use to low pass filter to reduce noise.If part of signature has been altered The gabor filter can be used to repair it.

In the recognition stage use the vector quantization for quantize the signature curves then use the HMM(hidden markov model) for the training sequence of lines.

edit flag offensive delete link more

Comments

Thank you,But is there any code for do this,I have tried the canny edge detection codes ,but it ask about a clear images,It is correctly not detect any of this signature or printed things.

hash gravatar imagehash ( 2013-08-07 22:22:36 -0500 )edit

@hash, just a quick reminder that this forum is for giving directions on how to tackle your problem. It does expect you to move ahead and start trying out some suggestions of people. Put your test results in here, so we can see where it goes wrong, provide us with some samples, ... Don't expect that the community will solve your final years project for you.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-08 01:46:19 -0500 )edit

I have added the codes and image below..

hash gravatar imagehash ( 2013-08-10 04:39:26 -0500 )edit
0

answered 2013-08-10 02:11:19 -0500

hash gravatar image

Attendance_sheet.JPG

this is the image I have tried with

edit flag offensive delete link more
0

answered 2013-08-10 02:09:05 -0500

hash gravatar image

I have tried this code,actually this is a javacv code,

import javax.swing.JFrame; import com.googlecode.javacpp.Pointer; import com.googlecode.javacv.; import static com.googlecode.javacv.cpp.opencv_core.; import static com.googlecode.javacv.cpp.opencv_imgproc.; import static com.googlecode.javacv.cpp.opencv_highgui.;

public class SignatureDetector {

private static String SOURCE_FILE = "images\sourceImage.jpg"; private static String HOUGH_FILE = "images\houghrImage.jpg"; public static void main(String[] args) {

    String fileName = args.length >= 1 ? args[0] : "images\\Attendance_sheet.JPG"; // if no params provided, compute the defaut image
    IplImage src = cvLoadImage(fileName, 0);
    IplImage dst;
    IplImage colorDst;
    CvMemStorage storage = cvCreateMemStorage(0);
    CvSeq lines = new CvSeq();

    CanvasFrame source = new CanvasFrame("Source");
    CanvasFrame hough = new CanvasFrame("Hough");
    if (src == null) {
        System.out.println("Couldn't load source image.");
        return;
    }

    dst = cvCreateImage(cvGetSize(src), src.depth(), 1);
    colorDst = cvCreateImage(cvGetSize(src), src.depth(), 3);

    cvCanny(src, dst, 50, 200, 3);
    cvCvtColor(dst, colorDst, CV_GRAY2BGR);

    /*
     * apply the probabilistic hough transform
     * which returns for each line deteced two points ((x1, y1); (x2,y2))
     * defining the detected segment
     */
    if (args.length == 2 && args[1].contentEquals("probabilistic")) {
        System.out.println("Using the Probabilistic Hough Transform");
        lines = cvHoughLines2(dst, storage, CV_HOUGH_PROBABILISTIC, 1, Math.PI / 180, 40, 50, 10);
        for (int i = 0; i < lines.total(); i++) {
            // Based on JavaCPP, the equivalent of the C code:
            // CvPoint* line = (CvPoint*)cvGetSeqElem(lines,i);
            // CvPoint first=line[0], second=line[1]
            // is:
            Pointer line = cvGetSeqElem(lines, i);
            CvPoint pt1  = new CvPoint(line).position(0);
            CvPoint pt2  = new CvPoint(line).position(1);

            System.out.println("Line spotted: ");
            System.out.println("\t pt1: " + pt1);
            System.out.println("\t pt2: " + pt2);
            cvLine(colorDst, pt1, pt2, CV_RGB(255, 0, 0), 3, CV_AA, 0); // draw the segment on the image
        }
    }
    /*
     * Apply the multiscale hough transform which returns for each line two float parameters (rho, theta)
     * rho: distance from the origin of the image to the line
     * theta: angle between the x-axis and the normal line of the detected line
     */
    else if(args.length==2 && args[1].contentEquals("multiscale")){
                    System.out.println("Using the multiscale Hough Transform"); //
        lines = cvHoughLines2(dst, storage, CV_HOUGH_MULTI_SCALE, 1, Math.PI / 180, 40, 1, 1);
        for (int i = 0; i < lines.total(); i++) {
            CvPoint2D32f point = new CvPoint2D32f(cvGetSeqElem(lines, i));

            float rho=point.x();
            float theta=point.y();

            double a = Math.cos((double) theta), b = Math.sin((double) theta);
            double x0 = a * rho, y0 = b * rho;
            CvPoint pt1 = new CvPoint((int) Math.round(x0 + 1000 * (-b)), (int) Math.round(y0 + 1000 * (a))), pt2 = new CvPoint((int) Math.round(x0 - 1000 * (-b)), (int) Math.round(y0 - 1000 * (a)));
            System.out.println("Line spoted: ");
            System.out.println("\t rho= " + rho);
            System.out.println("\t theta= " + theta);
            cvLine(colorDst, pt1, pt2, CV_RGB(255, 0, 0), 3, CV_AA, 0);
        }
    }
    /*
     * Default: apply the standard hough transform. Outputs: same as the multiscale output.
     */
    else {
        System.out.println("Using the Standard Hough Transform");
        lines = cvHoughLines2(dst, storage, CV_HOUGH_STANDARD, 1, Math.PI / 180, 90, 0, 0);
        for (int i = 0; i < lines.total(); i++) {
            CvPoint2D32f point = new CvPoint2D32f(cvGetSeqElem(lines, i));

            float rho ...
(more)
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-08-07 05:10:42 -0500

Seen: 2,770 times

Last updated: Aug 10 '13