Ask Your Question

Ed95's profile - activity

2019-04-02 15:47:13 -0500 commented question Augmented Reality using custom OpenCV

@berak Thanks for the links. The project is a good one. Awesome that you take the time to try to help out with the quest

2019-03-30 22:11:39 -0500 asked a question Augmented Reality using custom OpenCV

Augmented Reality using custom OpenCV I'm learning OpenCV and have come across arUco markers. I've also been learning ab

2019-01-11 16:05:51 -0500 commented question dnn assertion failed 'getMemoryShapes()' using Darknet yolov3

Found the issue. I created a wrapper (dnn_yolo) for cv::dnn::Net. The wrapper has cv::dnn::Net net as private but when i

2019-01-11 02:34:39 -0500 asked a question dnn assertion failed 'getMemoryShapes()' using Darknet yolov3

dnn assertion failed 'getMemoryShapes()' using Darknet yolov3 Hi, I'm trying to use the OpenCV dnn with the Darknet pre

2019-01-05 03:33:38 -0500 commented answer Issues running dnn openpose sample code with kinect v2

That's fixed it. Thanks! Appreciate the debugger hint. That will be useful.

2019-01-05 02:25:35 -0500 commented answer Issues running dnn openpose sample code with kinect v2

That's fixed it. Thanks!

2019-01-05 02:24:06 -0500 marked best answer Issues running dnn openpose sample code with kinect v2

Hi, I have version 4.0.1-dev installed on ubuntu 16.04 (g++ v 5.4.0) with libfreenect2 (for kinect v2) and am trying to use the dnn openpose sample program with a kinect camera. The sample code works with a single image. The kinect driver can (independently) display an rgb stream using imshow(). The issue I'm having is using them both together. **I have assumed the sample code can be used with a web camera (kinect) (instead of just still images). The code I have throws a CV:Exception when it calls net.forward().

Mat inputBlob = blobFromImage(img, scale, Size(W_in, H_in), Scalar(0, 0, 0), false, false, CV_8U);
    net.setInput(inputBlob);
    Mat result = net.forward();

The exception is :

   terminate called after throwing an instance of 'cv::Exception'
      what():  OpenCV(4.0.1-dev) /home/ed/src/opencv/modules/dnn/src/layers/convolution_layer.cpp:1119: error: (-215:Assertion failed) inputs[0].size[1] % blobs[0].size[1] == 0 in function 'forward'

It suggests the inputBlob maybe empty. The output from gdb is below:

(gdb) print inputBlob
$2 = {flags = 1124024320, dims = 4, rows = -1, cols = -1, data = 0x114acb00 "hfhifc^Y[[[XUXYUTPMLOQK?79877:?GPVULC>9<@A?>?C:76:Fc\243\260\253\205aSNF??>EJIA:5-.47<A>94/41/-)--+0D\214\226\220R.())&$#!$-64+&$&*+-/12221//268:8579>>::==:9746??@GJC]\233\304\301\250\226\245\323\340\336\331\333\334\334\340\336\333\333\334\337\337\337\336\336\336\336\336\334\335\337\340\340\340\343\343\342\342\344\344\341\343\343\341\337\340\343\345\344\342\337\337\342\345\344", <incomplete sequence \342>..., datastart = 0x114acb00 "hfhifc^Y[[[XUXYUTPMLOQK?79877:?GPVULC>9<@A?>?C:76:Fc\243\260\253\205aSNF??>EJIA:5-.47<A>94/41/-)--+0D\214\226\220R.())&$#!$-64+&$&*+-/12221//268:8579>>::==:9746??@GJC]\233\304\301\250\226\245\323\340\336\331\333\334\334\340\336\333\333\334\337\337\337\336\336\336\336\336\334\335\337\340\340\340\343\343\342\342\344\344\341\343\343\341\337\340\343\345\344\342\337\337\342\345\344", <incomplete sequence \342>..., dataend = 0x11c95b00 "", datalimit = 0x11c95b00 "", allocator = 0x0, u = 0xe8b860, size = {p = 0xeccae4}, step = {p = 0xeccac0, buf = {0, 0}}}

So I think the issues could be :

1) How I create the cv::Mat for the kinect rgb image.

   cv::Mat rgbCV(rgb->height,rgb->width,CV_8UC4,rgb->data);
   cv::Mat img(rgbCV.clone());

2)Creating the inputBlob

 Mat inputBlob = blobFromImage(img, scale, Size(W_in, H_in), Scalar(0, 0, 0), false, false, CV_8U);

W_in is set to 1920, H_in is set to 1080 (kinect rgb size), scale =1.0. Initially I had the type (last parameter) on default (CV_32F) but tried CV_8U. The result was the same cv.Exception).

All help is appreciated.

2019-01-05 02:05:30 -0500 edited question Issues running dnn openpose sample code with kinect v2

Issues running dnn openpose sample code with kinect v2 Hi, I have version 4.0.1-dev installed on ubuntu 16.04 (g++ v 5.4

2019-01-05 02:01:00 -0500 edited question Issues running dnn openpose sample code with kinect v2

Issues running dnn openpose sample code with kinect v2 Hi, I have version 4.0.1-dev installed on ubuntu 16.04 (g++ v 5.4

2019-01-04 22:37:38 -0500 asked a question Issues running dnn openpose sample code with kinect v2

Issues running dnn openpose sample code with kinect v2 Hi, I have version 4.0.1-dev installed on ubuntu 16.04 (g++ v 5.4

2018-12-16 20:13:06 -0500 answered a question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

Managed to produce a depth image using the kinect v1 camera with openCV 4. The issues were : Wrong pointer assignment

2018-12-14 23:18:10 -0500 edited question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

Transfer kinect depth data from c++ vector to Mat and displaying it in OpenCV Hi, I'm trying to learn OpenCV using a ki

2018-12-14 23:17:53 -0500 edited question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

Transfer kinect data from c++ vector to Mat and displaying it in OpenCV Hi, I'm trying to learn OpenCV using a kinect v

2018-12-14 15:53:56 -0500 edited question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

Transfer kinect data from c++ vector to Mat and displaying it in OpenCV Hi, I'm trying to learn OpenCV using a kinect v

2018-12-14 15:53:45 -0500 edited question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

Transfer data from c++ vector to Mat and displaying it in OpenCV Hi, I'm trying to learn OpenCV using a kinect v1 sensor

2018-12-12 20:47:00 -0500 commented question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

I read that you need to use waitKey() with a value greater than 0, and the depth image resolution for v1 is only 320x240

2018-12-12 03:58:42 -0500 commented question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

@berak. Thanks that was perfect. Converting to CV_8U fixed the exception.Will update libs. The window isn't appearing or

2018-12-12 03:58:27 -0500 commented question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

@berak. Thanks that was perfect. Converting to CV_8U fixed the exception.Will update libs. The window isn't appearing or

2018-12-12 03:58:07 -0500 commented question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

@berak. Thanks that was perfect. Converting to CV_8U fixed the exception.Will update libs. The window isn't appearing or

2018-12-12 02:18:30 -0500 commented question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

@berak. Thanks, that was the first thing I saw too and that's a great ptr explanation!

2018-12-12 02:13:58 -0500 commented question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

@sjhalayka Thanks.I had the rows and columns around the wrong way. If I use clone() I now get an exception when using im

2018-12-11 18:17:02 -0500 commented question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

@sjhalayka . Just included the .cpp file at the end for reference but have removed. thx

2018-12-11 18:16:04 -0500 commented question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

Just included the .cpp file at the end for reference but have removed. thx

2018-12-11 18:14:04 -0500 received badge  Editor (source)
2018-12-11 18:14:04 -0500 edited question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

Transfer data from c++ vector to Mat and displaying it in OpenCV Hi, I'm trying to learn OpenCV using a kinect v1 sensor

2018-12-11 15:18:08 -0500 asked a question Transfer kinect depth data from c++ vector to Mat and display it in OpenCV

Transfer data from c++ vector to Mat and displaying it in OpenCV Hi, I'm trying to learn OpenCV using a kinect v1 sensor

2018-12-06 13:34:35 -0500 received badge  Enthusiast
2018-12-02 13:53:31 -0500 commented answer cmake issue compiling bridging code for OpenCV,OpenKinect and PCL

Thanks so much! That fixed it.

2018-12-01 22:37:23 -0500 commented answer cmake issue compiling bridging code for OpenCV,OpenKinect and PCL

Thanks! That removed the error. I have a bunch of other errors for types like CV_16SC2, CV_16F, CV_CALIB_FIX_K4, CV_WND

2018-12-01 22:37:07 -0500 commented answer cmake issue compiling bridging code for OpenCV,OpenKinect and PCL

Thanks! That removed the error. I have a bunch of other errors for types like CV_16SC2, CV_16F, CV_CALIB_FIX_K4,CV_WNDO

2018-12-01 22:31:10 -0500 marked best answer cmake issue compiling bridging code for OpenCV,OpenKinect and PCL

Hi,

I'm trying to learn OpenCV using a couple of kinect sensors (360 & ONE) . To get the sensors working I grabbed OKPCL (https://github.com/Qworg/OKPCL) - some bridging code between OpenKinect, OpenCV and PCL.

I'm using OpenCV 4.0, on Ubuntu 16.04 LTS. Each of the libraries required compiled but when I compile the bridging code, OKPCL, the executables that rely on OpenCV fail with "not declared within scope" errors.

Scanning dependencies of target OKCV
[ 56%] Building CXX object CMakeFiles/OKCV.dir/OKCV.cpp.o
/home/ed/src/qworg_branch/OKPCL/OKCV.cpp: In function ‘double computeReprojectionErrors(const std::vector<std::vector<cv::Point3_<float> > >&, const std::vector<std::vector<cv::Point_<float> > >&, const std::vector<cv::Mat>&, const std::vector<cv::Mat>&, const cv::Mat&, const cv::Mat&, std::vector<float>&)’:
/home/ed/src/qworg_branch/OKPCL/OKCV.cpp:194:59: error: ‘CV_L2’ was not declared in this scope
         err = norm(Mat(imagePoints[i]), Mat(imagePoints2),CV_L2);
                                                           ^

I've checked the source file (OKCV.cpp) to make sure the OpenCV headers are included. The namespace seems correct.

#include <iostream>
#include <libfreenect/libfreenect.hpp>
#include <libfreenect/libfreenect_registration.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <vector>
#include <ctime>

#include <boost/thread/thread.hpp>
//OPENCV Includes
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/highgui/highgui.hpp"

using namespace cv;
using namespace std;

I also tried changing the order of the includes to see if it was some kind of cross compilation issue but no.

I've checked the CMakeLists.txt file to ensure the OpenCV libraries are included. I added some lines but it made no difference to the compilation error.

exert from MakeLists.txt :

project(OKCV)

find_package(OpenCV REQUIRED)

include_directories( ${OpenCV_INCLUDE_DIRS} )   #[[ I randomly added ]]
link_directories(${OpenCV_LIBRARY_DIRS})  #[[ I randomly added ]]
add_definitions(${OpenCV_DEFINITIONS})     #[[ I randomly added]]

if (WIN32)
  set(THREADS_USE_PTHREADS_WIN32 true)


     find_package(Threads REQUIRED)

  include_directories(${THREADS_PTHREADS_INCLUDE_DIR})

endif()



    include_directories(. ${PCL_INCLUDE_DIRS})
    link_directories(${PCL_LIBRARY_DIRS})
    add_definitions(${PCL_DEFINITIONS})

include_directories(/usr/local/include/opencv4)   #[[ I added]]
link_directories(/usr/local/include/opencv4)          #[[ I added ]]

add_executable(OKCV OKCV.cpp)

if(APPLE)

  target_link_libraries(OKCV freenect ${PCL_LIBRARIES} ${OpenCV_LIBS} )
else()
  find_package(Threads REQUIRED)
  include_directories(${USB_INCLUDE_DIRS})

  if (WIN32)
    set(MATH_LIB "")
  else(WIN32)
    set(MATH_LIB "m")
  endif()

  target_link_libraries(OKCV freenect ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB} ${PCL_LIBRARIES} ${OpenCV_LIBS})
endif()

To build the OKPCL code I created the build directory, cd into and then:

rm -rf CMakeLists.txt
cmake -DCMAKE_CXX_FLAGS="-std=c++11" ..
make clean
make

I'm new to cmake so any help with this issue would be gold

2018-12-01 22:31:10 -0500 received badge  Scholar (source)
2018-12-01 22:30:03 -0500 commented answer cmake issue compiling bridging code for OpenCV,OpenKinect and PCL

Thanks! That removed the error. I have a bunch of other errors for types like CV_16SC2, CV_16F, CV_CALIB_FIX_K4 + more.

2018-12-01 16:12:15 -0500 asked a question cmake issue compiling bridging code for OpenCV,OpenKinect and PCL

cmake issue compiling bridging code for OpenCV,OpenKinect and PCL Hi, I'm trying to learn OpenCV using a couple of kine