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

Green frame during video capture #179

Open
sandeep1404 opened this issue Jul 6, 2023 · 1 comment
Open

Green frame during video capture #179

sandeep1404 opened this issue Jul 6, 2023 · 1 comment

Comments

@sandeep1404
Copy link

Hi Everyone,

I have IMX230 camera sensor with me and I was trying to integrate it with Jetson nano and capture the photos, I followed the documentation https://docs.arducam.com/Nvidia-Jetson-Camera/Jetvariety-Camera/Quick-Start-Guide/ in setting the camera, however I was getting a green frame when I run the code python arducam_displayer.py.

Also when I run my code for a simple capturing images it still ended up giving me green frames, My opencv has gstremer as backend
My code is mentioned below:

import cv2

import imutils # pip install imutils

import numpy as np
from datetime import datetime
import array
import fcntl
import os
import argparse
from utils import ArducamUtils
import sys
from pip import main as pipmain



camera = True
if camera == True:
    cap = cv2.VideoCapture(0,cv2.CAP_V4L2) #cv2.CAP_V4L2
    arducam_utils = ArducamUtils(0)
    w = cap.set(cv2.CAP_PROP_FRAME_WIDTH,640)
    h = cap.set(cv2.CAP_PROP_FRAME_HEIGHT,480)
    #frame = frame.reshape(int(h), int(w))
    print(arducam_utils)

 
else:
    vid = cv2.VideoCapture('E:\arducam\mycam.mp4')
    
if arducam_utils.convert2rgb == 0:
	cap.set(cv2.CAP_PROP_CONVERT_RGB,arducam_utils.convert2rgb )#arducam_utils.convert2rgb

if camera:
    i=0
    while (cap.isOpened()):
        try:
            print('cam opened')		
            img, frame = cap.read()         
            frame=arducam_utils.convert(frame)
            frame = imutils.resize(frame,width=640)
            cv2.imshow('frame', frame)
            cv2.imwrite(f"/home/jetson/Desktop/cam_test/Client_Frame12_{i}.jpg", frame)
            i=i+1

        except:
            print('VIDEO FINISHED!')
            break

Client_Frame12_0

My output image from the camera is as shown in the figure, why is the green frame is coming I tried many color conversions but not able to get a good color image, and gstreamer also gives me internal data stream error always. can anyone please help me in resolving the issues asap its very urgent and any solution will be greatly helpful from me. Thankyou in advance.

@sandeep1404
Copy link
Author

Can someone help me in resolving this issue, it very urgent

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

1 participant