Ask Your Question

santhoshkelathodi's profile - activity

2020-03-12 12:40:12 -0600 received badge  Popular Question (source)
2017-07-04 02:59:35 -0600 received badge  Notable Question (source)
2016-12-28 03:51:08 -0600 commented question Install could not find libnvidia-fatbinaryloader.so.367.48

I am also getting similar issues when I am trying to compile openCV with CUDA support make -j4 gives even though cmake is successful. is it because cuda is not installed correctly.

cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D EIGEN_INCLUDE_PATH=/usr/include/eigen3 \ -D WITH_CUDA=ON \ -D ENABLE_FAST_MATH=1 \ -D WITH_TBB=ON \ -D WITH_V4L=ON \ -D WITH_QT=ON \ -D WITH_OPENGL=ON \ -D CUDA_FAST_MATH=1 \ -D WITH_CUBLAS=1 \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D CUDA_NVCC_FLAGS="-D_FORCE_INLINES" \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \ -D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python \ -D BUILD_EXAMPLES=ON ..

2016-11-28 14:30:42 -0600 received badge  Popular Question (source)
2016-02-22 11:21:52 -0600 commented answer Adding an user defined object to Mat Object

What you said must be correct. I need to understand some more concepts about OpenCV. Ill understand them and get back. I am just a beginner. I hope you will bear with me if you think my question was trivial. :(. I ll get back on this. Thank you for the explanation

2016-02-22 03:59:43 -0600 commented question extracting Magnitude and angle from flowfeature

I have just started to use the Opencv.I am sure that I could contribute in future.

2016-02-22 03:59:10 -0600 commented answer extracting Magnitude and angle from flowfeature

Berek: There was no problem. It was just that I did not know how to interpret the data as I did not understand the Mat object clearly. In fact I wanted to get the magnitude and direction of all the pixels with Optical flow.

2016-02-22 03:54:26 -0600 commented question Adding an user defined object to Mat Object

1)As I understand Mat object is multidimensional array mainly used for image manipulation. I wanted to represent more information about the image for each of the pixel for one of my research purpose.For me it made more sense to include the information in the pixel position if I want to mark the pixel or to store some additional information. 2)Mat is only for image manipulation? 3) Have you tried to add the element directly in the Mat? Santhosh>Yes Why do you need a custom object? What does it represent? Does it contains numbers? Santhosh>For example to flag a pixel.Or for example in case of some feature extraction of pixel.I want to store feature information at the pixel.contains no or text "The class Mat represents an n-dimensional dense numericalsingle-channel or multi-channel array

2016-02-18 05:35:44 -0600 asked a question Adding an user defined object to Mat Object

Anyone knows or have some sample code where a user defined object ( for example of a class myClassX) can be added to a mat Object.

Example

Something like this -> But definitely the below program is not compiling. is there any way to store user defined objects in Mat Object?

MyClass m[2][2];
Mat M(2, 2, MyClass, m);
MyClass Obj;
MyClassObj.at<MyClass>(0, 1) = Obj;
2016-02-18 05:09:50 -0600 answered a question extracting Magnitude and angle from flowfeature

Through trial and error I got the answer .Hope this will help someone: :)


 calcOpticalFlowFarneback(prevgray, gray, flow, 0.5, 3, 15, 3, 5, 1.2, 0);
 Mat xy[2];
 split(flow, xy);
 //calculate angle and magnitude
 Mat magnitude, angle;
 cartToPolar(xy[0], xy[1], magnitude, angle, true);
 for(int y = 0; y < prevgray.rows; y++)
 {
      for(int x = 0; x < prevgray.cols; x++)
      {
           const Point2f& fxy = flow.at< Point2f>(y, x);
           float magxy = magnitude.at<float>(y,x);
           float angleDeg = angle.at<float>(y,x);
           /*Print them(magxy, angleDeg) here*/

      }
 }
2016-02-15 10:58:58 -0600 asked a question extracting Magnitude and angle from flowfeature

1)I wanted to get all the pixels with some motion and wanted to store the position and angle in some data structure(Which data structure to use and how?). Could anyone help me how I could do it.

2)Whether the below code is correct to extract the magnitude and direction of Optical Flow vector. If so how I can I do the operation mentioned in 1) from here on.

3)I find that the openCV manual could be supplemented with examples of the usage of different functions. I am not sure whether anyone else think the same.I think it will help new users. Now to write code I need to do lot of search on the net. :(. However community is having good response.


calcOpticalFlowFarneback(prevgray, gray, flow, 0.5, 3, 15, 3, 5, 1.2, 0);
Mat xy[2];
split(flow, xy);
//calculate angle and magnitude
Mat magnitude, angle;
cartToPolar(xy[0], xy[1], magnitude, angle, true);

2016-02-12 22:49:07 -0600 received badge  Enthusiast
2016-02-10 17:33:31 -0600 received badge  Self-Learner (source)
2016-02-10 09:29:09 -0600 answered a question 'cv::Exception' in calcOpticalFlowFarneback

I have fixed this issue. It was found out that the resolution of the image1 and image2 were not matching and because of that this crash was happening. This intuition I got from the error message(prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyr_scale < 1 in function calcOpticalFlowFarneback) and when I gave 2 images of same resolution it worked. Sorry for asking such a silly doubt. :( However I think it will be useful for some amateur opencv user.

2016-02-08 08:19:02 -0600 received badge  Editor (source)
2016-02-08 08:16:57 -0600 asked a question 'cv::Exception' in calcOpticalFlowFarneback

There is an exception in running the below : When I debugged I found that the code is crashing in the function call calcOpticalFlowFarneback(). I have just run the sample code written below. Could anyone help me solve this issue.I am working in the Qt Creator programming environment -----------------------------------------exception----------------------------------------------------

Starting /home/santhosh/opencv-qt/OpticalFlowDense2/OpticalFlowDense2...
OpenCV Error: Assertion failed (prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyr_scale < 1) in calcOpticalFlowFarneback, file /home/santhosh/opencv/opencv-3.1.0-source/modules/video/src/optflowgf.cpp, line 1102
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/santhosh/opencv/opencv-3.1.0-source/modules/video/src/optflowgf.cpp:1102: error: (-215) prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyr_scale < 1 in function calcOpticalFlowFarneback

The program has unexpectedly finished.

----------------------------Code---------------------------------------------------------------------------

void drawOptFlowMap (const Mat& flow, Mat& cflowmap, int step, const Scalar& color);

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    Mat prev_im,nex_im,flow;

    prev_im=imread("image1.jpg",0);
    if (!prev_im.data)
    {
        QMessageBox msg;
        msg.setText("Could not Load image1");
        msg.exec();
    }
    //namedWindow("previm", cv::WINDOW_AUTOSIZE);
    imshow("previm",prev_im);


    nex_im=imread("image2.jpg",0);
    if (!nex_im.data)
    {
        QMessageBox msg;
        msg.setText("Could not Load image2");
        msg.exec();
    }
    //namedWindow("nextim", cv::WINDOW_AUTOSIZE);
    imshow("nextim",nex_im);


    calcOpticalFlowFarneback(prev_im,nex_im,flow,0.5, 1, 12, 2, 7, 1.5, 0);

    Mat cflow;
    cvtColor(prev_im, cflow, CV_GRAY2BGR);
    drawOptFlowMap(flow, cflow, 10, CV_RGB(0, 255, 0));


    imshow("OpticalFlowFarneback", cflow);


    waitKey(0);
}




void drawOptFlowMap (const Mat& flow, Mat& cflowmap, int step, const Scalar& color)
{
 for(int y = 0; y < cflowmap.rows; y += step)
 {
      for(int x = 0; x < cflowmap.cols; x += step)
      {
       const Point2f& fxy = flow.at< Point2f>(y, x);
       line(cflowmap, Point(x,y), Point(cvRound(x+fxy.x), cvRound(y+fxy.y)),
        color);
       circle(cflowmap, Point(cvRound(x+fxy.x), cvRound(y+fxy.y)), 1, color, -1);

      }
 }
}
2016-02-07 01:06:29 -0600 asked a question /usr/bin/ld: warning: libicui18n.so.54, needed by /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link) makefile:44: recipe for target 'DenseOpticalFlow' failed

I am trying to compile a simple program to load an image in code block and eclipse. I am getting the following compilation error

I tried reinstalling qt by using the command as suggested by some people in some other groups.

sudo apt-get install qt5-default qttools5-dev-tools

But no use. Anyone got a solution for this?


12:06:56 * Build of configuration Release for project DenseOpticalFlow * make all Building file: ../main.cpp Invoking: GCC C++ Compiler g++ -I/usr/local/include/opencv -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp" Finished building: ../main.cpp

Building target: DenseOpticalFlow Invoking: GCC C++ Linker g++ -L/usr/local/lib -o "DenseOpticalFlow" ./main.o -lopencv_core -lopencv_highgui -lopencv_imgcodecs /usr/bin/ld: warning: libicui18n.so.54, needed by /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link) makefile:44: recipe for target 'DenseOpticalFlow' failed /usr/bin/ld: warning: libicuuc.so.54, needed by /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libicudata.so.54, needed by /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link) /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to ucal_clone_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference touenum_next_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to u_strToLower_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference toucnv_getStandardName_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to ucol_setAttribute_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference toucal_setMillis_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to ucol_strcoll_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference toucnv_setSubstChars_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to ucal_getTimeZoneDisplayName_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference toucal_openCountryTimeZones_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to ucnv_fromUnicode_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference toucnv_open_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to ucnv_getDefaultName_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference toucol_open_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to ucol_close_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference toucal_inDaylightTime_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to ucol_getSortKey_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference toucnv_getAvailableName_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to ucal_close_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference toucal_get_54' /home/santhosh/Qt/5.5/gcc_64/lib/libQt5Core.so.5: undefined reference to ...

(more)
2016-01-27 12:33:36 -0600 commented answer error: cannot find -lippicv

Cool. It worked. Thank you very much kbarni for the quick response...I am so impressed by the community..

2016-01-27 07:21:46 -0600 asked a question error: cannot find -lippicv

I have tried to create a simple application with QtCreator and was trying to compile the application I have installed opencv 3.1.0.

In the compilation it is giving the error. what is the issue. Anyone can help me. I could not find any solution for this issue.

17:41:21: Running steps for project test1... 17:41:21: Configuration unchanged, skipping qmake step. 17:41:21: Starting: "/usr/bin/make" g++ -Wl,-rpath,/home/santhosh/Qt/5.5/gcc_64 -Wl,-rpath,/home/santhosh/Qt/5.5/gcc_64/lib -o test1 main.o mainwindow.o moc_mainwindow.o pkg-config --libs opencv -L/home/santhosh/Qt/5.5/gcc_64/lib -lQt5Widgets -L/usr/lib64 -lQt5Gui -lQt5Core -lGL -lpthread /usr/bin/ld: cannot find -lippicv Makefile:221: recipe for target 'test1' failed collect2: error: ld returned 1 exit status make: * [test1] Error 1 17:41:21: The process "/usr/bin/make" exited with code 2. Error while building/deploying project test1 (kit: Desktop Qt 5.5.1 GCC 64bit) When executing step "Make" 17:41:21: Elapsed time: 00:00.

include "mainwindow.h"

include "ui_mainwindow.h"

//start:added by santhosh

include <qmessagebox>

include <opencv2 core="" core.hpp="">

include <opencv2 highgui="" highgui.hpp="">

//stop:added by santhosh

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); }

MainWindow::~MainWindow() { delete ui; } //start:added by santhosh void MainWindow::on_pushButton_clicked() { cv::Mat test_image = cv::imread("test_1img.jpg",0); if (!test_image.data) { QMessageBox msg; msg.setText("Cou1ld not Load image"); msg.exec(); } cv::namedWindow("test image", cv::WINDOW_AUTOSIZE); cv::imshow("test image", test_image); } //stop:added by santhosh