basic OpenCV operations not working in beaglebone black

asked 2016-02-08 06:14:08 -0600

Saghir Khatri gravatar image

Hi all!

I am new to OpenCV and BeagleBone Black. I have installed all libraries in beagle bone black but when i try to run following code:

 // Test to convert a color image to gray
 // Build on Linux with:
 // g++ test_2.cpp -o test_2 -lopencv_core -lopencv_imgproc -lopencv_highgui

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

 using namespace cv;
 using namescpace std;
 int main() {
     // Load the image file and check for success
     Mat input = imread("lena.jpg", 1);
     if(!input.data) {
         cout << "Unable to open the image file" << endl;
         return -1;
     }

     // Convert the input file to gray
     Mat gray_image;
     cvtColor(input, gray_image, COLOR_BGR2GRAY);

     // Save the result
     imwrite("lena_gray.jpg", gray_image);

    return 0;
 }

i get following error at cvtColor line:

CMEM Error: init: Failed to open /dev/cmem: 'No such file or directory'

The cmemk kernel module does not appear to be installed.

Commands such as the following run as root would install cmemk and allow OpenCL to proceed properly.

For available CMEM DDR block size: ~512MB:
modprobe cmemk phys_start=0xa0000000 phys_end=0xc0000000 pools=1x536870912 allowOverlap=1

as mentioned above when i run: modprobe cmemk phys_start=0xa0000000 phys_end=0xc0000000 pools=1x536870912 allowOverlap=1

i get this error on same line:

Ipc_start: LAD_connect() failed: 4
test_2: /build/ti-opencl-zdvBAC/ti-opencl-01.01.06.00/host/src/core/dsp/mbox_impl_msgq.cpp:59: MBoxMsgQ::MBoxMsgQ(Coal::DSPDevice*): Assertion `status == (0) || status == (1)' failed.
Aborted

i tried other methods like findContours, threshold etc but it yields same error.

I dont know why get this problem. please let me know about its workaround

Thanks.

edit retag flag offensive close merge delete

Comments

I am having this same problem. Did you find a way to fix it? Cause I am stuck!

timgineer gravatar imagetimgineer ( 2016-02-08 22:38:15 -0600 )edit

I am having this problem too!

opencvuser1234 gravatar imageopencvuser1234 ( 2016-04-01 15:56:00 -0600 )edit