Ask Your Question

Vivek Goel's profile - activity

2014-10-23 23:33:27 -0600 commented question Line Detection.

Ok, i should try it again with proper structuring element. Thanks

2014-10-22 09:10:08 -0600 commented question Line Detection.

Will canny give edges of different thickness? Since if the canny output give edges of different thickness then it will be correct solution but if the detected edges are of same thickness then the morphological operations will be much hard to calibrate and I will to design a much good and sophisticated structuring element.

2014-10-21 23:25:51 -0600 commented question Line Detection.

Since all the edges are of same thickness it doesn't matter what I should use first opening or closing. I want to use the parameters in Hough P Transform to eliminate redundant lines.

2014-10-21 10:47:22 -0600 commented question Line Detection.

Actually if I will use morphological operations, the edges on which I have to work will be lost! Since they are of same thickness.

2014-10-20 14:59:02 -0600 commented question Line Detection.

ya it's good to use morphological operations but HoughP transform already have parameters to do this. Can you tell me the working and use of last 2 parameters in which i have given 600 and 300 value?

2014-10-18 10:28:25 -0600 answered a question Line detectionin opencv C++

for hough line code is -: HoughLinesP(dst,lines,1,CV_PI/180,80,30,10); now make a conditional statement like-:

if( theta>CV_PI/180*170 || theta<CV_PI/180*10)
    { Point pt1, pt2;
    ..........
    line( cdst, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
    }

this while restrict the scope of detected lines and then you will be able to show your horizontal lines only.

2014-10-18 10:23:04 -0600 received badge  Supporter (source)
2014-10-18 05:36:55 -0600 asked a question Line Detection.

After increasing the minLineLength and decreasing maxLineGap program is still showing number of lines and also the gap is also visible. Can someone tell me the problem in the program? Image is:-image description Code is-:

include "stdafx.h"

include <cv.h>
include <highgui.h>
include <math.h>
using namespace cv;
int main(int argc, char** argv)
{
    Mat src, dst, color_dst;
    src = imread("line2.jpg", 0);
    Canny(src, dst, 50, 200, 3);
    cvtColor(dst, color_dst, CV_GRAY2BGR);


    vector<Vec4i> lines;
    HoughLinesP(dst,lines,1,CV_PI/180,80,600,300);
    for (size_t i = 0; i < lines.size(); i++)
    {
        line(color_dst, Point(lines[i][0], lines[i][1]),
            Point(lines[i][2], lines[i][3]), Scalar(0, 0, 255), 3, 8);
    }
    namedWindow("Source", 1);
    imshow("Source", src);
    namedWindow("Detected Lines", 1);
    imshow("Detected Lines", color_dst);
    waitKey(0);
    return(0);
}
2014-10-17 11:20:47 -0600 commented question Can someone tell me how to make line following code. I mean algorithm or functions i should use.

No issue :) Hitting hard make you stronger. And yes i asked new question. My apology.

2014-10-17 11:15:59 -0600 asked a question Line follwoing

Applied hough line transform. How can I find orientation of the detected line? Firstly:-

  1. I do thresholding.
  2. Applied Hough Line transform.
  3. For orientation I tried traversing the image, then find two set of points (x1,y1) and (x2,y2) from where the change in colour due to hough line transform take place in two different levels.
  4. Find points to get the slope between them.

But the program become very complex with no result.

2014-10-17 11:12:27 -0600 commented question Can someone tell me how to make line following code. I mean algorithm or functions i should use.

Did that :(

2014-10-17 11:09:49 -0600 commented question Can someone tell me how to make line following code. I mean algorithm or functions i should use.

Sorry Sir, I had read the faq and I had also tried the code of this problem but after many effort I failed, I want to start with scratch. So therefore I ask this type of question.

2014-10-17 10:54:51 -0600 commented question Can someone tell me how to make line following code. I mean algorithm or functions i should use.

There is no issue in giving command. But I am not getting the algorithm how to find orientation.

2014-10-17 10:42:21 -0600 asked a question Can someone tell me how to make line following code. I mean algorithm or functions i should use.

I mean algorithm or functions I should use. I want to make my bot work and walk using line following.

2014-08-23 09:07:48 -0600 commented question Why we use mainly HSV color space nor BGR color space for color detection?

So in shadow or in change in environment like in water it will be pretty useful and efficient?

2014-08-23 00:54:59 -0600 asked a question Why we use mainly HSV color space nor BGR color space for color detection?

i also need to know that which color space is more efficient in calibrating and detection of colors in live video.

2014-05-03 12:55:53 -0600 commented question Camera is not opening and getting frames

it is just exiting with code 0. the console opens and close in 1 second in many programs.

2014-05-03 12:51:17 -0600 commented answer Execution exiting after running the code.

through your motivation i will definitely try it in future. i am getting some problem with my webcam, i will check it out soon and contact you later :)

2014-05-01 03:45:29 -0600 asked a question Camera is not opening and getting frames
#include "stdafx.h"
#include <stdio.h>
#include <highgui.h>
#include <cv.h>
#include <cxcore.h>

void main(){ //Sobel edge detection for a video

    CvCapture* capture = cvCreateCameraCapture(0);  //The video is loaded into a pointer of type CvCapture
    IplImage* frame; IplImage*gscale_res; IplImage* edgeframe; //Declaration of structure variables to store frames
    char *win = "video"; char *winEdge = "edges"; //Declaration of character pointers to store window names
    cvNamedWindow(win, CV_WINDOW_AUTOSIZE); //Window is created for original image
    cvNamedWindow(winEdge, CV_WINDOW_AUTOSIZE); //Window is created for resultant image

    while (1)
    {
        frame = cvQueryFrame(capture); //Image under consideration is captured as a shot of the video
        if (!frame)
        {
            printf("cam not found");
            break;
        }
        gscale_res = cvCreateImage(cvSize(frame->width, frame->height), IPL_DEPTH_8U, 1);//Creation of the image variable to store both the grayscale intermediate and final result
        edgeframe = cvCreateImage(cvSize(frame->width, frame->height), IPL_DEPTH_16S, 1); //The 16-bit signed image for the result of the Sobel Edge detection
        cvCvtColor(frame, gscale_res, CV_BGR2GRAY); //Gray-scale intermediate created
        cvSobel(gscale_res, edgeframe, 1, 0, 3);// Sobel edge detection function is applied on the grayscale image and the result is put in the other variable
        cvConvertScaleAbs(edgeframe, gscale_res, 1, 0); //The 16-bit signed image is converted to an 8-bit unsigned version so it can be displayed
        cvShowImage(win, frame); //Original image is shown
        cvShowImage(winEdge, gscale_res); //Resultant image with edges detected, is shown
        char c = cvWaitKey(33); //This is to account for the frame speed of the loaded video
        cvReleaseImage(&gscale_res);
        cvReleaseImage(&edgeframe);
        if (c == 27) //If the character of code 27 or the ESCAPE character is entered, the loop will break
            break;
    }

    cvReleaseCapture(&capture); //Video is released from memory
    cvReleaseImage(&frame);  //Images released from memory
    cvDestroyWindow(win);
    cvDestroyWindow(winEdge); //Windows closed
}

i have tried different arguments, cvCreateCameraCapture,cvCaptureFromCAM but still not working

2014-05-01 03:39:17 -0600 commented answer Execution exiting after running the code.

flood of errors..

2014-04-24 05:38:03 -0600 commented question Execution exiting after running the code.

thanks for your presence. it will be gratefull if you would take a llok at the above code if you have free time later. thanks alot. :)

2014-04-24 05:34:08 -0600 commented question Execution exiting after running the code.

how can i learn the c++ interface? means if want to to start learning it.

2014-04-24 05:31:19 -0600 commented question Execution exiting after running the code.

i am using the same. can you send me a code for color detection.? i can check for that.

2014-04-24 05:27:07 -0600 commented question Execution exiting after running the code.

so what should be the problem. why it is not working? when i am capturing a video, it works fine. :/

2014-04-24 05:18:52 -0600 commented question Execution exiting after running the code.

now in console it's showing 'Null frame press any key to continue...' and than exits

2014-04-24 05:12:05 -0600 commented question Execution exiting after running the code.

its showing only a console for only 5 secs and exits.

2014-04-24 05:00:53 -0600 commented question Execution exiting after running the code.

but it is exiting in my pc. without opening windows and all.

2014-04-24 04:55:52 -0600 commented question Execution exiting after running the code.

help me, how to fix it. it will be very thankfull.

2014-04-23 05:05:42 -0600 received badge  Editor (source)
2014-04-23 05:00:37 -0600 commented answer there is delay in image processing using panda board

ok, thanks and also sorry brother :) i am budding user so did some mistakes. i will reply with full specifications later because as of now i can't disclose it.

2014-04-23 04:50:10 -0600 asked a question Execution exiting after running the code.

I am try to run the code but msv execution is exiting and sometimes it shows breakpoint error. P.S. code is copied.

#include "stdafx.h"
#include "opencv/cvaux.h"
#include "opencv/highgui.h"
#include "opencv/cxcore.h"
#include <stdio.h>

int main(int argc, char* argv[])
{
    CvCapture* camera = cvCreateCameraCapture(-1); // Use the default camera

    IplImage* frame = 0;
    CvMemStorage* storage = cvCreateMemStorage(0); //needed for Hough circles

    // capturing some extra frames seems to help stability
    frame = cvQueryFrame(camera);
    frame = cvQueryFrame(camera);
    frame = cvQueryFrame(camera);

    // with default driver, PSEye is 640 x 480
    CvSize size = cvSize(640, 480);
    IplImage *  hsv_frame = cvCreateImage(size, IPL_DEPTH_8U, 3);
    IplImage*  thresholded = cvCreateImage(size, IPL_DEPTH_8U, 1);
    IplImage*  thresholded2 = cvCreateImage(size, IPL_DEPTH_8U, 1);

    CvScalar hsv_min = cvScalar(0, 50, 170, 0);
    CvScalar hsv_max = cvScalar(10, 180, 256, 0);
    CvScalar hsv_min2 = cvScalar(170, 50, 170, 0);
    CvScalar hsv_max2 = cvScalar(256, 180, 256, 0);

    //do {
    frame = cvQueryFrame(camera);
    if (frame != NULL) {
        printf("got frame\n\r");
        // color detection using HSV
        cvCvtColor(frame, hsv_frame, CV_BGR2HSV);
        // to handle color wrap-around, two halves are detected and combined
        cvInRangeS(hsv_frame, hsv_min, hsv_max, thresholded);
        cvInRangeS(hsv_frame, hsv_min2, hsv_max2, thresholded2);
        cvOr(thresholded, thresholded2, thresholded);

        cvSaveImage("thresholded.jpg", thresholded);

        // hough detector works better with some smoothing of the image
        cvSmooth(thresholded, thresholded, CV_GAUSSIAN, 9, 9);
        CvSeq* circles = cvHoughCircles(thresholded, storage, CV_HOUGH_GRADIENT, 2, thresholded->height / 4, 100, 40, 20, 200);

        for (int i = 0; i < circles->total; i++)
        {
            float* p = (float*)cvGetSeqElem(circles, i);
            printf("Ball! x=%f y=%f r=%f\n\r", p[0], p[1], p[2]);
            cvCircle(frame, cvPoint(cvRound(p[0]), cvRound(p[1])),
                3, CV_RGB(0, 255, 0), -1, 8, 0);
            cvCircle(frame, cvPoint(cvRound(p[0]), cvRound(p[1])),
                cvRound(p[2]), CV_RGB(255, 0, 0), 3, 8, 0);
        }

        cvSaveImage("frame.jpg", frame);
    }
    else {
        printf("Null frame\n\r");
    }
    //} while (true);
    cvReleaseCapture(&camera);
    return 0;
}

and errors are..

The thread 0x1cbc has exited with code 0 (0x0).
The thread 0xe84 has exited with code 0 (0x0).
The thread 0x1ec4 has exited with code 0 (0x0).
The thread 0x1590 has exited with code 0 (0x0).
The thread 0x11f8 has exited with code 0 (0x0).
The thread 0x1e04 has exited with code 0 (0x0).
The thread 0x1404 has exited with code 0 (0x0).
The program '[32] Myhello2.exe' has exited with code 0 (0x0).
2014-04-14 23:33:28 -0600 answered a question there is delay in image processing using panda board

I am usimg arduino omega for motor drivers and other peripherals and panda board for calibration. you can see the task on auvsi.

2014-03-30 23:50:47 -0600 asked a question there is delay in image processing using panda board

sir, i am currently working on an AUV, but there is delay in imgae processed by it. How the proformance can be improved. answers will be appreciated.