Jetson Nano Opencv Error

I take in the below error at Jetson nano Qt

terminate called after throwing an instance of ‘cv::Exception’
what(): OpenCV(4.1.1) /home/nvidia/host/build_opencv/nv_opencv/modules/highgui/src/window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘imshow’

Press to close this window…

This is the code;

#include <opencv2/highgui.hpp>

using namespace std;

int main()
{
cv::Mat img=cv::imread(“home/lena.jpeg”);
cv::imshow(“Window”,img);
cv::waitKey(0);
return 0;
}

Can you solve this problem?

Hi,
We try this simple python code and don’t hit any issue:

# Python program to explain cv2.imread() method

# importing cv2
import cv2

# path
path = r'/usr/src/jetson_multimedia_api/data/Picture/nvidia-logo.jpg'

# Using cv2.imread() method
img = cv2.imread(path)

# Displaying the image
cv2.imshow('image', img)

cv2.waitKey(10000)

The sample is from
Python OpenCV | cv2.imread() method - GeeksforGeeks

Please check if you can decode nvidia-logo.jpg successfully.