Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

read camera image incorrect

$
0
0
I using the function of videocapture to read camera data VideoCapture cap(0); int Key; Mat src; if(cap.isOpened()) { while(1) { cap.read(src); namedWindow("capture", 0); imshow("capture",src); Key = waitKey(10); if(Key ==27) break; }} The output is likely bayer image with green vision![image description](/upfiles/14226336805640216.png) And the image size is not correct(640X480), it should be 2592X1944 in raw 12 bits. Is some parameters for function videocapture need I set? or have anything I miss for opencv videocapture? ---------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------- I got it! The problem is causing by a function which is translating raw data to bayer pattern. The camera input is raw in 12 bits format, as reading the camera data that one element is separated to two bytes (low byte and high byte) We need to merge this two byte to a int format(0~2^8 -> 0~2^16). OpenCV has a mistake in the data merging, so I got the wrong image first. I coding that translating raw data to bayer pattern and getting the correct result without white balance. ![image description](/upfiles/14232114932680185.jpg)

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>