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

Update Cameras_Lister.py #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion Cameras_Lister.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@ def SetCameraCustomResolution(self, context):
context.scene.render.resolution_x = context.active_object.camera_custom_resolution_settings_pointer_prop.Custom_Horizontal_Resolution
context.scene.render.resolution_y = context.active_object.camera_custom_resolution_settings_pointer_prop.Custom_Vertical_Resolution

#How to set camera resolution (webcam) with opencv?
cv::VideoCapture cap;
if (!cap.isOpened()) // check if succeeded to connect to the camera
CV_Assert("Cam open failed");

cap.set(CV_CAP_PROP_FRAME_WIDTH,640);
cap.set(CV_CAP_PROP_FRAME_HEIGHT,480);
#then if you use OpenCV 3 just replace the last instructions with these:
then if you use OpenCV 3 just replace the last instructions with these:

cap.set(cv::CAP_PROP_FRAME_WIDTH, valueX); // valueX = your wanted width
cap.set(cv::CAP_PROP_FRAME_HEIGHT, valueY); // valueY = your wanted heigth





# CAMERA VIEW OFF
class CameraViewOff(bpy.types.Operator):
bl_idname = 'cameras.camera_view_off'
Expand Down Expand Up @@ -549,4 +566,4 @@ def unregister():
addon_keymaps.clear()

if __name__ == "__main__":
register()
register()