Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading and sending real camera data #8

Open
Francisobiagwu opened this issue Feb 11, 2020 · 0 comments
Open

Reading and sending real camera data #8

Francisobiagwu opened this issue Feb 11, 2020 · 0 comments

Comments

@Francisobiagwu
Copy link

I am using opencv to read camera image/saved image, and I am confused how to pass the image to the instance.

Eg:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include

using namespace cv;
using namespace std;

Mat image;
image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file

if(! image.data )                              // Check for invalid input
{
    cout <<  "Could not open or find the image" << std::endl ;
    return -1;
}

from the rti-dds code:
/* Get a new sample before every write. This data sample can come from a
free sample or a previously written sample which is ready for reuse. */

    retcode = CameraImage_CameraImageData_writer->get_loan(instance);
    if (retcode != DDS_RETCODE_OK) {
        fprintf(stderr, "CameraImage_CameraImageDataDataWriter_get_loan error(%s:%d)\n", __FILE__, __LINE__);
        publisher_shutdown(participant);
        return -1;
    }

how do provide this image/image properties to instance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant