Ask Your Question

hash's profile - activity

2019-01-25 15:55:57 -0600 received badge  Notable Question (source)
2017-10-06 10:39:20 -0600 received badge  Popular Question (source)
2017-09-05 02:00:34 -0600 received badge  Popular Question (source)
2013-08-10 04:39:26 -0600 commented answer edge detection of a signature

I have added the codes and image below..

2013-08-10 02:11:19 -0600 answered a question edge detection of a signature

Attendance_sheet.JPG

this is the image I have tried with

2013-08-10 02:09:05 -0600 answered a question edge detection of a signature

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)
2013-08-09 00:45:55 -0600 commented answer face databases with .bmp images for training haar cascade using .bmp images

ok.thank you

2013-08-07 22:22:36 -0600 commented answer edge detection of a signature

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.

2013-08-07 05:10:42 -0600 asked a question edge detection of a signature

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

2013-08-06 21:20:07 -0600 commented answer face databases with .bmp images for training haar cascade using .bmp images

Sorry,In here my project has face detection using haar cascade training, according to this tutorial database must have .bmp images. There is no face database founded as containing .bmp,Is there any face database with .bmp images?This is my final year project and if any one give an idea about this issue it is a great help.Thank you

2013-08-03 20:35:57 -0600 asked a question face databases with .bmp images for training haar cascade using .bmp images

I am currently doing my final year project and in here i am going to using face detection using haar cascade,and I have referred this http://nayakamitarup.blogspot.com/2011/07/how-to-make-your-own-haar-trained-xml.html?showComment=1374466014555#c4797751721941865712 and in here it is always asking for .bmp images.Is there any other way to do haar cascade training or can I have any database name which contains .bmp images please. Thank you.

2013-04-03 20:07:41 -0600 received badge  Editor (source)
2013-04-03 19:58:43 -0600 asked a question Bad argument (Array should be CvMat or IplImage) in unknown function

when i run the code it gives this error :OpenCV Error: Bad argument (Array should be CvMat or IplImage) in unknown function, file ......\src\opencv\modules\core\src\array.cpp, line 1238 Exception in thread "main" java.lang.RuntimeException: ......\src\opencv\modules\core\src\array.cpp:1238: error: (-5) Array should be CvMat or IplImage

at com.googlecode.javacv.cpp.opencv_core.cvGetSize(Native Method)

what is the sollution for this error?and i am trying to use javacv