image_from_cam()

Captures an image from the camera panel.

Retrieves the current image displayed in the camera interface.

Syntax

planetcnc.image_from_cam()

Parameters

Parameter Type Description Comment
None

Return Value

Examples

#! /usr/bin/env python 
 
import planetcnc
 
img = planetcnc.image_from_cam()
if img:
    print("Image successfully captured from camera panel")
 
    # Save the image
    planetcnc.image_save(img, "captured_image.png")
 
    # Close the image
    planetcnc.image_close(img)
else:
    print("Failed to capture image from camera panel")

See also

image_open
image_open_data
image_close
image_save
image_size
image_get_pixel
image_get_pixel_gray
image_to_cam
image_from_cam