Change camera resolution Qtdragon?
- wusel0464
- Away
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 7
03 Oct 2025 09:00 #335763
by wusel0464
Change camera resolution Qtdragon? was created by wusel0464
Hello,
Another question.
Since my problems with the exit of the tool button have unfortunately not yet been resolved, I try to move all over to Debian Trixie.
First realization, I am back to 2.9 second, unfortunately, it has not improved the situation tool button.
But the real concern I have is whether you can change the resolution of the camera somehow. The standard is 640x800, but mine can do until 1600x1200.
Thank you and greetings, Frank.
Another question.
Since my problems with the exit of the tool button have unfortunately not yet been resolved, I try to move all over to Debian Trixie.
First realization, I am back to 2.9 second, unfortunately, it has not improved the situation tool button.
But the real concern I have is whether you can change the resolution of the camera somehow. The standard is 640x800, but mine can do until 1600x1200.
Thank you and greetings, Frank.
Please Log in or Create an account to join the conversation.
- wusel0464
- Away
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 7
04 Oct 2025 15:01 #335817
by wusel0464
Replied by wusel0464 on topic Change camera resolution Qtdragon?
Hello,
Sometimes try to tinker something that roughly corresponds to functionality, which I am looking for for Qtdragon.
I have little idea what I copied together. But it only runs in studio code how to explain the Linuxcnc, so I am light years away to understand it.
Here is the code snippet:
import cv2
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1600)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1200)
while True:
ret_val, img = cap.read()
down_width = 800
down_height = 600
down_points = (down_width, down_height)
img = cv2.resize(img, down_points, interpolation= cv2.INTER_AREA)
cv2.imshow('my webcam', img)
if cv2.waitKey(1) == 27:
break # esc to quit
cap.release()
cv2.destroyAllWindows()
Best regards and have a nice weekend, Frank.
Translation errors come from Google.
Sometimes try to tinker something that roughly corresponds to functionality, which I am looking for for Qtdragon.
I have little idea what I copied together. But it only runs in studio code how to explain the Linuxcnc, so I am light years away to understand it.
Here is the code snippet:
import cv2
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1600)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1200)
while True:
ret_val, img = cap.read()
down_width = 800
down_height = 600
down_points = (down_width, down_height)
img = cv2.resize(img, down_points, interpolation= cv2.INTER_AREA)
cv2.imshow('my webcam', img)
if cv2.waitKey(1) == 27:
break # esc to quit
cap.release()
cv2.destroyAllWindows()
Best regards and have a nice weekend, Frank.
Translation errors come from Google.
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7648
- Thank you received: 2133
04 Oct 2025 23:18 #335837
by cmorley
Replied by cmorley on topic Change camera resolution Qtdragon?
Are you talking of the resolution of the camera or the size of the window?
There is no built in way to set camera resolution but you can scale the window.
linuxcnc.org/docs/devel/html/gui/qtdragon.html#_camview_tab
There is no built in way to set camera resolution but you can scale the window.
linuxcnc.org/docs/devel/html/gui/qtdragon.html#_camview_tab
Please Log in or Create an account to join the conversation.
- wusel0464
- Away
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 7
05 Oct 2025 08:20 #335847
by wusel0464
Replied by wusel0464 on topic Change camera resolution Qtdragon?
Hello,
First of all, thank you very much for the quick reaction.
My concern is to exploit the dissolution of the chip for a more precise presentation. The zoom function built into Qtdragon is forced to invent pixels, but this is not significant to a small extent. There is not much to get out of a currently used resolution of 640x480 pixels. In the current situation, improvement would only be achieved by reducing the distance from the camera, but I come to areas where it becomes unhealthy for the camera.
My milling machine is just a cheese mill, but improving ease of use is nothing bad.
The picture of OpenCV has to be read somewhere, and couldn't you install these lines?
cap.set (cv2.cap_prop_frame_width, 1600)
cap.set (cv2.cap_prop_frame_height, 1200)
The values are now mine and it works so far that the picture becomes visibly worse with small values.
Or how do you get Linux not to take the standard resolution?
Thank you for your efforts and all the best, Frank.
First of all, thank you very much for the quick reaction.
My concern is to exploit the dissolution of the chip for a more precise presentation. The zoom function built into Qtdragon is forced to invent pixels, but this is not significant to a small extent. There is not much to get out of a currently used resolution of 640x480 pixels. In the current situation, improvement would only be achieved by reducing the distance from the camera, but I come to areas where it becomes unhealthy for the camera.
My milling machine is just a cheese mill, but improving ease of use is nothing bad.
The picture of OpenCV has to be read somewhere, and couldn't you install these lines?
cap.set (cv2.cap_prop_frame_width, 1600)
cap.set (cv2.cap_prop_frame_height, 1200)
The values are now mine and it works so far that the picture becomes visibly worse with small values.
Or how do you get Linux not to take the standard resolution?
Thank you for your efforts and all the best, Frank.
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7648
- Thank you received: 2133
06 Oct 2025 05:28 #335894
by cmorley
Replied by cmorley on topic Change camera resolution Qtdragon?
if I add these commands, on my machine the camera fails.
we need to find away to detect possible resolutions.
How do you know what resolution is displaying in qtdragon?
we need to find away to detect possible resolutions.
How do you know what resolution is displaying in qtdragon?
Please Log in or Create an account to join the conversation.
- wusel0464
- Away
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 7
06 Oct 2025 15:11 - 06 Oct 2025 15:30 #335922
by wusel0464
Replied by wusel0464 on topic Change camera resolution Qtdragon?
Hello,
Thank you for your effort and patience.
I didn't expect it to be so easy either.
I searched the code on the net to try whether it could work with the camera before I gave any nonsense.
I just let the whole thing run in studio code.
Since I hardly have any idea from programming, I was glad to have something to run at all.
My thought was that you could do something like that in the scaling function and to simply make it handlebar via the qtdragon.pref.
What Qtdragon shows, I noticed when comparing the image with other programs and even if you use the zoom function, the image becomes pixelated very quickly.
Various Linux tools first read only 640x480 as a kind of standard.
v4L2-ctl --list format-ext shows the following resolutions:
640x480
352x288
320x240
176x144
160x120
800x600
1280x960
1600x1200
When I start GuvcView, the camera is first displayed 640x480, it can then select and the image quality changes.
Small addendum, you can see it even better:
Qtvcp -d -o Cam number = 14 cam_align
Two cameras are just connected here:
Port 1 Andostar
[QTvcp.QTVCP.WIDGETS.CAMVIEW_WIDGET][DEBUG] Port 1 is working and reads images (480.0 x 640.0) (camview_widget.py:520)
Port3 webcam
[QTvcp.QTVCP.WIDGETS.CAMVIEW_WIDGET][DEBUG] Port 3 is working and reads images (480.0 x 640.0) (camview_widget.py:520)
Thank you for your efforts and all the best, Frank.
Thank you for your effort and patience.
I didn't expect it to be so easy either.
I searched the code on the net to try whether it could work with the camera before I gave any nonsense.
I just let the whole thing run in studio code.
Since I hardly have any idea from programming, I was glad to have something to run at all.
My thought was that you could do something like that in the scaling function and to simply make it handlebar via the qtdragon.pref.
What Qtdragon shows, I noticed when comparing the image with other programs and even if you use the zoom function, the image becomes pixelated very quickly.
Various Linux tools first read only 640x480 as a kind of standard.
v4L2-ctl --list format-ext shows the following resolutions:
640x480
352x288
320x240
176x144
160x120
800x600
1280x960
1600x1200
When I start GuvcView, the camera is first displayed 640x480, it can then select and the image quality changes.
Small addendum, you can see it even better:
Qtvcp -d -o Cam number = 14 cam_align
Two cameras are just connected here:
Port 1 Andostar
[QTvcp.QTVCP.WIDGETS.CAMVIEW_WIDGET][DEBUG] Port 1 is working and reads images (480.0 x 640.0) (camview_widget.py:520)
Port3 webcam
[QTvcp.QTVCP.WIDGETS.CAMVIEW_WIDGET][DEBUG] Port 3 is working and reads images (480.0 x 640.0) (camview_widget.py:520)
Thank you for your efforts and all the best, Frank.
Last edit: 06 Oct 2025 15:30 by wusel0464.
Please Log in or Create an account to join the conversation.
- wusel0464
- Away
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 7
07 Oct 2025 15:39 #336019
by wusel0464
Replied by wusel0464 on topic Change camera resolution Qtdragon?
Hello,
Apparently I found the right place in the code, at least the image quality changes.
Enclosed the pictures I have reached, maybe you can use or expand it in the future.
Thanks to everyone and best regards, Frank
Apparently I found the right place in the code, at least the image quality changes.
Enclosed the pictures I have reached, maybe you can use or expand it in the future.
Thanks to everyone and best regards, Frank
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.236 seconds