Ask Your Question
1

I want to download image on the memory!!

asked 2018-01-31 23:53:54 -0600

fireRabbit gravatar image

updated 2018-02-01 02:34:02 -0600

hello, i want to download image on the memory using opencv on QT

    unsigned char* data = NULL;
    EdsUInt64 size = 0;

    err = EdsGetPointer(stream, (EdsVoid**)& data);
    err = EdsGetLength(stream, &size);

i'm using this code first line is get image's address + "data" is pointer second is image's size

i want to access image using pointer address but i dont know how to please help me!~

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-02-01 02:25:06 -0600

berak gravatar image

updated 2018-02-01 04:02:11 -0600

you can use imdecode for this:

Mat bytes(1, length, CV_8S, data); // wrap a Mat header around it (no copy)
Mat m = imdecode(bytes, IMREAD_ANYCOLOR);
if (! m.empty()) { // did it work ?
    imshow("M",m);
    waitKey();
}
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-01-31 23:53:54 -0600

Seen: 160 times

Last updated: Feb 01 '18