TX1 CSI camera display black screen

Hi,

Recently we test facedetect(opencv3.2 + CSI camera) on TX1.
but we found some problem:
capture can been opened,show screen is black .

we used opencv samples (videocapture_basic.cpp) for test .

Anyone can help me ,thank you .

Hi,

Could you help us check the gst functionality first?

Thanks.

gst-launch-1.0 nvcamerasrc fpsRange="30.0 30.0" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvtee ! nvvidconv flip-method=2 ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvoverlaysink -e

Hi, AastaLLL

nvgstcapture can show normaly.
I also check USB-camera,it’s ok.
I had searched one message about TK1:
we should modify V4L2_FRAME_BUF_SIZE from 40964096 -> 34096*4096.
but I can’t verify it.
thanks.

Hi,

Looks like you can read camera source normally.
May I know which display function you used? Do you use cv::imshow()?

Here is simple sample for display sanity. Could you give it a try?

#include <opencv2/highgui/highgui.hpp>

int main()
{
    cv::Mat img(512,512,CV_8UC3,cv::Scalar(0));
    cv::putText(img,
        "Hello, OpenCV on Jetson!",
        cv::Point(10, img.rows / 2),
        cv::FONT_HERSHEY_DUPLEX,
        1.0,
        CV_RGB(118, 185, 0),
        2);

    cv::imshow("Hello!", img);
    cv::waitKey(0);
}
nvcc topic_1000473.cpp -lopencv_core -lopencv_highgui -o test

Hi, AastaLLL
As you said,we use cv::imshow()for test.
We build your sample.
The window display normally:background is black.the “Hello, OpenCV on Jetson!” is green.
Is right ?

thanks.

Hi,

Sorry for the late reply.

Looks like your camera input and display works normally.
Could you attach source code for us better investigate?

Hi,

Could you share the status of this issue?
Does it fix already?

Any feedback is highly appreciated.

Hi, AastaLLL
I found the reason that:
The CSI camera need ISP,gst(with NVT pluge) only open it.
So I use follow code:

const char* gst =  "nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)640, height=(int)360, format=(string)I420, framerate=(fraction)30/1 ! \
                    nvvidconv flip-method=2 ! video/x-raw, format=(string)I420 ! \
                    videoconvert ! video/x-raw, format=(string)BGR ! \
                    appsink";

    cv::VideoCapture cap(gst);

It’s ok,thank u.