Skip to content

code #3

Description

@SAgiKPJH
    start =time.time()
	
    while True: ## 반복문 돌입
        for item in {"A","B"}:
            select_channel(item) ## GPIO 출력 설정
            time.sleep(0.02) ## 0.02초 휴식
            try:
                buf = picam2.capture_array("main",wait=True) ## 이미지 가져오기 (캡쳐)
                buf = picam2.capture_array("main",wait=True)
                buf = cv2.cvtColor(buf, cv2.COLOR_BGR2RGB)
                if item == 'A':
                    cv2.imshow('A_image', buf)
                elif item == 'B':
                    cv2.imshow('B_image', buf)
                    endtime = time.time()-start
                    print("t : ",endtime)
                    print("FPS = ",1/endtime)
                    start = time.time()
                key = cv2.waitKey(1) & 0xff
                if key == 27 :
                  break
            except Exception as e:
                print("capture_buffer: "+ str(e))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions