Ask Your Question

Ryang's profile - activity

2019-04-08 08:33:52 -0500 received badge  Enthusiast
2019-04-06 19:16:39 -0500 received badge  Editor (source)
2019-04-06 19:16:39 -0500 edited question panoramic image with multiple fixed camera

panoramic image with multiple fixed camera Hi all, I plan to make a large size high-resolution scanner using multiple ca

2019-04-06 19:16:12 -0500 asked a question panoramic image with multiple fixed camera

panoramic image with multiple fixed camera Hi all, I plan to make a large size high-resolution scanner using multiple ca

2019-04-06 19:16:09 -0500 asked a question panoramic image with multiple fixed camera

panoramic image with multiple fixed camera Hi all, I plan to make a large size high-resolution scanner using multiple ca

2015-08-05 02:42:47 -0500 asked a question Error occurred during running time. cvHoughLines2
   I want to find lines using cvHoughLines2 function. but when I run the program there are some error like below.

root@nvidia:~/sampleCode/4_captureOpenCV# ./captureOpenCV -vt 10sad

  1. Create NvMedia capture

  2. Create NvMedia device

  3. Create NvMedia mixer(s) and output(s) and bind them

  4. Check that the device is enabled (initialized)

Query check - Output Info - Enabled:1 displayId:0 type:b302 width:480 height:272 refresh:59.940060 type:D

Used output - Output Info - Enabled:1 displayId:0 type:b302 width:480 height:272 refresh:59.940060 type:D

  1. Open output file(s)

  2. Create vip pool(s), queue(s), fetch threads and stream start/done semaphores

wait for ADV7182 ... one second

  1. Kickoff

  2. Control Thread

timeNotCount

frame= 0, time=0.000001000[s]

  1. Wait for completion

frame= 1, time=0.059011000[s]

frame= 2, time=0.092225000[s]

frame= 3, time=0.125588000[s]

frame= 4, time=0.159008000[s]

frame= 5, time=0.192591000[s]

OpenCV Error: Bad argument (The source image must be 8-bit, single-channel) in cvHoughLines2, file /root2

terminate called after throwing an instance of 'cv::Exception' what(): /root/opencv-2.4.9/modules/imgproc/src/hough.cpp:712: error: (-5) The source image must be 8-2

here is my source code.

I don't know why my program quit in short time. I set the running time at 10 sec.

   //CV_HOUGH_PROBABILISTIC 
CvSeq* lines = 0; 
cvHoughLines2( imgOrigin, lines, CV_HOUGH_PROBABILISTIC, 1, CV_PI/180, 50, 50, 5 );

for( i = 0; i < 1; i++ )
{      CvPoint* line = (CvPoint*)cvGetSeqElem(lines,i); 
       cvLine( imgOrigin, line[0], line[1], CV_RGB(255,0,0), 3, 8, 0 );
}
sprintf(fileName, "captureImage/imgOrigin%d.png", i);
    cvSaveImage(fileName, imgOrigin, 0);

    // ---------------------------------------------------------------------
2015-08-02 23:53:16 -0500 commented answer Detecting color and drawing line

I don't know how to computer find the orange zone. So I think that after inRange there will left only white lines so if i use hough transform I can get the Point of the orange zone.

is there any better method?

2015-07-30 06:27:16 -0500 asked a question Detecting color and drawing line

Hi guys. I'm just start OpenCV. I have some trouble to do my small project.

I want to make a program to detect orange color and draw line from middle to the orange color's average point . I have a trouble to draw line. anyone help me??

#include <opencv2/opencv.hpp> 
#include <iostream>  

int main( int argc, char** argv ) {    
cv::VideoCapture cap;   
if (argc==1) {    cap.open(0);           // open the default camera   } 
else {     cap.open(argv[1]);   }   
if( !cap.isOpened() ) 
    {  
    // check if we succeeded     
    std::cerr << "Couldn't open capture." << std::endl;     
    return -1;
    }
cv::Mat frame;  
while( 1 ) {    
    cap >> frame;   
    if( !frame.data ) break;             // Ran out of film 
    cv::Point point_of_poll = Find_poll (freame);
    if (point_of_poll.x == 0)
    draw_left;
    else if (point_of_poll < mid)
    draw_left;
    else if (point_of_poll > mid)
    draw_right;
    if( cv::waitKey(33) >= 0 ) break;   
} 
}


Point Find_poll(Mat frame){
    cv::CvSeq* lines = 0; 
    cv::Mat mask; // specify the range of colours that you want to include, you can play with the borders here
    cv::Scalar lowerb = cv::Scalar(38,125,250);
    cv::Scalar upperb = cv::Scalar(42,129,255); 
    cv::inRange(frame, lowerb, upperb, mask); // if the frame has any orange pixel, this will be painted in the mask as white
    cv::Mat storage;
    cv::Mat result;
    lines = cvHoughLines2( mask, storage, CV_HOUGH_PROBABILISTIC, 1, CV_PI/180, 50, 50, 5 );
    cv::Point Averge;
    cv::Point Averge.x = 0;
    cv::Point Averge.y = 0;
    for( i = 0; i < lines->total; i++ )
    {         
        CvPoint* line = (CvPoint*)cvGetSeqElem(lines,i);
               Average.x += line.x;
        Average.y += line.y;
    }

Average.x = Point_Average.x / lines->total;
Average.y = Point_Average.y / lines->total;

return Average // return averge point of orange poll
}
2015-07-30 06:27:14 -0500 asked a question Detect orange color and draw point

Hi guys. I'm just start OpenCV. I have some trouble to do my small project.

I want to make a program to detect orange color and draw line from middle to the orange color's average point . I have a trouble to draw line. anyone help me??

include <opencv2 opencv.hpp="">

include <iostream>

int main( int argc, char** argv ) {
cv::VideoCapture cap;
if (argc==1) { cap.open(0); // open the default camera } else { cap.open(argv[1]); }
if( !cap.isOpened() ) {
// check if we succeeded
std::cerr << "Couldn't open capture." << std::endl;
return -1; } cv::Mat frame;
while( 1 ) {
cap >> frame;
if( !frame.data ) break; // Ran out of film cv::Point point_of_poll = Find_poll (freame); if (point_of_poll.x == 0) turn_left; else if (point_of_poll < mid) turn_left; else if (point_of_poll > mid) turn_right; if( cv::waitKey(33) >= 0 ) break;
} }

Point Find_poll(Mat frame){ cv::CvSeq* lines = 0; cv::Mat mask; // specify the range of colours that you want to include, you can play with the borders here cv::Scalar lowerb = cv::Scalar(38,125,250); cv::Scalar upperb = cv::Scalar(42,129,255); cv::inRange(frame, lowerb, upperb, mask); // if the frame has any orange pixel, this will be painted in the mask as white cv::Mat storage; cv::Mat result; lines = cvHoughLines2( mask, storage, CV_HOUGH_PROBABILISTIC, 1, CV_PI/180, 50, 50, 5 ); cv::Point Averge; cv::Point Averge.x = 0; cv::Point Averge.y = 0; for( i = 0; i < lines->total; i++ ) {
CvPoint* line = (CvPoint*)cvGetSeqElem(lines,i); Average.x += line.x; Average.y += line.y; }

Average.x = Point_Average.x / lines->total; Average.y = Point_Average.y / lines->total;

return Average // return averge point of orange poll }