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

PureThermal (fw:v1.3.0) . Last pixel invalid value #41

Open
mrspirytus opened this issue May 8, 2021 · 1 comment
Open

PureThermal (fw:v1.3.0) . Last pixel invalid value #41

mrspirytus opened this issue May 8, 2021 · 1 comment

Comments

@mrspirytus
Copy link

Hello,

I have two PureThermal (fw:v1.3.0) (1e4e:0100) that I am using to grab frames. I am developing on Nvidia T4L (Nano) 18.04 with the latest libuvc library build from source and opencv from dep repo
libopencv-dev/stable,now 4.1.1-2-gd5a58aa75

I am using the latest libuvc because the previous version sometimes has an issue with a shutdown. (thread join issue). All code involved is c/c++ only.

Anyway, what I noticed is that when I process libuvc for each frame, I wrap it in cv:Mat

    cv::Mat img(frame->height,
                frame->width,
                CV_16UC1,
                reinterpret_cast<uchar*>(frame->data));

When I try to dump each unmodified pixel value from img, the very last pixel always has an invalid value which after converting to C I get a very low temp.
Here are few bytes from the last line. Please see attached screenshot.

image (3)

Is this a known issue? Here is a more complete code of how I print hex values from uvc callback

cv::Mat img(frame->height,
            frame->width,
            CV_16UC1,
            reinterpret_cast<uchar*>(frame->data));

cout << mat.cols << "x" << mat.rows << "x" << mat.depth() << std::endl;

vector<int16_t> array;
std::stringstream ss;

for(auto r(0); r < mat.rows; ++r) {
    ss.str("");
    for(auto c(0); c < mat.cols; ++c) {
        uint16_t val = *(uint16_t*)mat.ptr(r, c);
        ss << std::setw(4) << std::setfill('0') << std::hex
            << std::uppercase << val << " ";

        //val = ((int16_t)(val - 27315)) / 10;
        //ss << val << " ";
        array.push_back(val);
    }
    cout << ss.str() << std::endl;
}
@zhaocundang
Copy link

me too!

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

2 participants