Can't install camview in buster
- cmorley
 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 7230
 - Thank you received: 2106
 
			
	
						09 Nov 2022 13:49				#256287
		by cmorley
	
	
		
			
	
			
			 		
													
	
				Replied by cmorley on topic Can't install camview in buster			
			
				<!DOCTYPE html>
shouldn't be in cam_align.py
also can you post the output of:
qtvcp --help
					shouldn't be in cam_align.py
also can you post the output of:
qtvcp --help
Please Log in or Create an account to join the conversation.
- seuchato
 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 376
 - Thank you received: 123
 
			
	
						09 Nov 2022 13:57				#256288
		by seuchato
	
	
		
			
	
	
	
			 		
													
	
				Replied by seuchato on topic Can't install camview in buster			
			
				Forget above post, I saved the files using save link to and that ended up as html files not ui and py. My bad.
So: Hurray! It works!
I am on 2.8.4 and it works using - o option:
"EMBED_TAB_COMMAND= halcmd loadusr -Wn qtvcp_embed qtvcp -d -c qtvcp_embed -x {XID} -o size=1200,900 cam_align"
Attached screenshot shows the resized window.
As you can see, the camera canvas has been resized using the mouse. You can decrease the camera picture using the lower right hand handle. You can also increase the camera picture, but then it is cropped to the size of the set canvas size (1200x900). once you release the mouse handle upon increasing the camera picture above the canvas size, you cannot grab it again to resize it.
Knowing this, I will not touch it once it is set to the correct size.
Chris: Thanks a ton!
Greez
chris
 			
					So: Hurray! It works!
I am on 2.8.4 and it works using - o option:
"EMBED_TAB_COMMAND= halcmd loadusr -Wn qtvcp_embed qtvcp -d -c qtvcp_embed -x {XID} -o size=1200,900 cam_align"
Attached screenshot shows the resized window.
As you can see, the camera canvas has been resized using the mouse. You can decrease the camera picture using the lower right hand handle. You can also increase the camera picture, but then it is cropped to the size of the set canvas size (1200x900). once you release the mouse handle upon increasing the camera picture above the canvas size, you cannot grab it again to resize it.
Knowing this, I will not touch it once it is set to the correct size.
Chris: Thanks a ton!
Greez
chris
		The following user(s) said Thank You: cmorley 	
			Please Log in or Create an account to join the conversation.
- seuchato
 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 376
 - Thank you received: 123
 
			
	
						10 Nov 2022 19:30				#256374
		by seuchato
	
	
		
			
	
			
			 		
													
	
				Replied by seuchato on topic Can't install camview in buster			
			
				Would it be possible to set angular resolution in ini as well? If not, where in source?			
					Please Log in or Create an account to join the conversation.
- cmorley
 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 7230
 - Thank you received: 2106
 
			
	
						10 Nov 2022 20:16				#256381
		by cmorley
	
	
		
			
	
			
			 		
													
	
				Replied by cmorley on topic Can't install camview in buster			
			
				Currently you can not from the ini.
I could add that.
What are you looking to set it to by the way?
					I could add that.
What are you looking to set it to by the way?
Please Log in or Create an account to join the conversation.
- seuchato
 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 376
 - Thank you received: 123
 
			
	
						11 Nov 2022 13:03				#256427
		by seuchato
	
	
		
			
	
	
			
			 		
													
	
				Replied by seuchato on topic Can't install camview in buster			
			
				I thought of setting it to 0.1°. If you check the attached two screenshots of my test setup, you might recognise, the angle is close to 348.5 and a bit further away of 348.0.
An arbitrary value in ini would just about be perfect
Tia
chris
					An arbitrary value in ini would just about be perfect
Tia
chris
Please Log in or Create an account to join the conversation.
- cmorley
 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 7230
 - Thank you received: 2106
 
			
	
						11 Nov 2022 21:20				#256464
		by cmorley
	
	
		
			
	
	
			 		
													
	
				Replied by cmorley on topic Can't install camview in buster			
			
				I forgot that you can cycle through rotation increments or 5, 1, 0.5 and 0.1 degrees by clicking the middle mouse (or left and right together) button.
I did commit changes to 2.9 to allow setting the rotation increment with the INI with -o rotincr=.2
Also now displays the current rotation increment
					I did commit changes to 2.9 to allow setting the rotation increment with the INI with -o rotincr=.2
Also now displays the current rotation increment
		The following user(s) said Thank You: seuchato 	
			Please Log in or Create an account to join the conversation.
- seuchato
 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 376
 - Thank you received: 123
 
			
	
						11 Nov 2022 22:24				#256471
		by seuchato
	
	
		
			
	
			
			 		
													
	
				Replied by seuchato on topic Can't install camview in buster			
			
				Tried to "cycle through rotation increments or 5, 1, 0.5 and 0.1 degrees by clicking the middle mouse (or left and right together) button". Sounds surrealistic! I have a logitech mx master. No combination seems to trigger resolution change.
I'll try again tomorrow. I do hope I can get the 2.9 stuff into my 2.8.4 setup. Anyway: I'll be reporting what I find.
Thanks a ton anyway!
					I'll try again tomorrow. I do hope I can get the 2.9 stuff into my 2.8.4 setup. Anyway: I'll be reporting what I find.
Thanks a ton anyway!
Please Log in or Create an account to join the conversation.
- cmorley
 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 7230
 - Thank you received: 2106
 
			
	
						12 Nov 2022 00:29				#256479
		by cmorley
	
	
		
			
	
	
			 		
													
	
				Replied by cmorley on topic Can't install camview in buster			
			
				Ahh yes 2.8.4 doesn't have the cycling code.
You probably can just copy the 2.9 camview.py into 2.8.4, i don;t think it uses any new code.
Here is the latest 2.9 code:
github.com/LinuxCNC/linuxcnc/blob/2.9/li...ts/camview_widget.py
github.com/LinuxCNC/linuxcnc/blob/2.8/sh...cam_align_handler.py
					You probably can just copy the 2.9 camview.py into 2.8.4, i don;t think it uses any new code.
Here is the latest 2.9 code:
github.com/LinuxCNC/linuxcnc/blob/2.9/li...ts/camview_widget.py
github.com/LinuxCNC/linuxcnc/blob/2.8/sh...cam_align_handler.py
		The following user(s) said Thank You: seuchato 	
			Please Log in or Create an account to join the conversation.
- seuchato
 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 376
 - Thank you received: 123
 
			
	
						12 Nov 2022 04:34		 -  12 Nov 2022 04:35		#256485
		by seuchato
	
	
		
			
				
chris
Since you added the code for setting the windows size in the ini file, I have been thinking whether or not it is a good idea to have the automatic resizing or not. Here is my reasoning, why I would prefer the fixed ini way:
The cameras will have a defined resolution like 1920x1080. The tab canvas size is not related at all to the the camera resolution. In attached screenshot you can see a manually resized cam_align window. Instead of 1920x1080 the window is now something like 100x800. Still the rotated cross hairs internal angle remains at 90°. The reading now is 314° where it should be in between 348.0 and 348.5°. Also the red circle remains round and is limited to the canvas size of the cam_align window. The behavior of circle and cross hairs is correct imho. I fine tuned the original size to match the red circle as good as possible to the circle on the paper. This aspect ratio should be kept, in order to make use of optical alignment. So, if automatic resizing is any good, it should keep the aspect ratio, else angular readings and optical centering could become obsolete.
And: Where to set this aspect ratio, if not in the ini file?
greez
chris
					
	
	
	
			 		
													
	
				Replied by seuchato on topic Can't install camview in buster			
			Ideally the tab would resize automatically.
In pyqt4 it worked pretty well. pyqt5 not so much.
I could make the default size settable from the INI when loading I think, if that would help.
chris
Since you added the code for setting the windows size in the ini file, I have been thinking whether or not it is a good idea to have the automatic resizing or not. Here is my reasoning, why I would prefer the fixed ini way:
The cameras will have a defined resolution like 1920x1080. The tab canvas size is not related at all to the the camera resolution. In attached screenshot you can see a manually resized cam_align window. Instead of 1920x1080 the window is now something like 100x800. Still the rotated cross hairs internal angle remains at 90°. The reading now is 314° where it should be in between 348.0 and 348.5°. Also the red circle remains round and is limited to the canvas size of the cam_align window. The behavior of circle and cross hairs is correct imho. I fine tuned the original size to match the red circle as good as possible to the circle on the paper. This aspect ratio should be kept, in order to make use of optical alignment. So, if automatic resizing is any good, it should keep the aspect ratio, else angular readings and optical centering could become obsolete.
And: Where to set this aspect ratio, if not in the ini file?
greez
chris
		Last edit: 12 Nov 2022 04:35  by seuchato.		Reason: typo corrected	
			Please Log in or Create an account to join the conversation.
- seuchato
 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 376
 - Thank you received: 123
 
			
	
						12 Nov 2022 05:56				#256486
		by seuchato
	
	
		
			
				
Did the following:
started linuxcnc and got a pthon erro, see attached screen shot and errortext below:
Guess, that's because 2.9 is based on python 3 and 2.8.3 is still on 2.7. I got:
I am not familiar with python. Thus I do not feel fit to backport stuff to 2.7 (if possible at all). So, I cannot test it under 2.8.4.
greez
chris
					
	
	
		
			
			 		
													
	
				Replied by seuchato on topic Can't install camview in buster			
			Ahh yes 2.8.4 doesn't have the cycling code.
You probably can just copy the 2.9 camview.py into 2.8.4, i don;t think it uses any new code.
Here is the latest 2.9 code:
github.com/LinuxCNC/linuxcnc/blob/2.9/li...ts/camview_widget.py
github.com/LinuxCNC/linuxcnc/blob/2.8/sh...cam_align_handler.py
Did the following:
cd /usr/lib/python2.7/dist-packages/qtvcp/widgets
mv camview_widget.py camview_widget.py.sav
cp /home/cnc/downloads/camview_widget.py .
cd /usr/share/qtvcp/panels/cam_align/
mv cam_align_handler.py cam_align_handler.py.sav
cp /home/cnc/downloads/cam_align_handler.pystarted linuxcnc and got a pthon erro, see attached screen shot and errortext below:
Traceback (most recent call last):
  File "/usr/bin/qtvcp", line 377, in <module>
    APP = QTVCP()
  File "/usr/bin/qtvcp", line 211, in __init__
    window.instance()
  File "/usr/lib/python2.7/dist-packages/qtvcp/qt_makegui.py", line 178, in instance
    instance = uic.loadUi(self.filename, self)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/__init__.py", line 226, in loadUi
    return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/Loader/loader.py", line 72, in loadUi
    return self.parse(filename, resource_suffix, basedir)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 1021, in parse
    actor(elem)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 828, in createUserInterface
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 806, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 273, in createWidget
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 806, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 503, in createLayout
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 806, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 546, in handleItem
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 806, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 264, in createWidget
    self.stack.push(self.setupObject(widget_class, parent, elem))
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/uiparser.py", line 228, in setupObject
    obj = self.factory.createQObject(clsname, name, args, is_attribute)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/objcreator.py", line 100, in createQObject
    factory = self.findQObjectType(classname)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/objcreator.py", line 125, in findQObjectType
    w = module.search(classname)
  File "/usr/lib/python2.7/dist-packages/PyQt5/uic/Loader/qobjectcreator.py", line 113, in search
    module = __import__(mname, {}, {}, (cls,))
  File "/usr/lib/python2.7/dist-packages/qtvcp/widgets/camview_widget.py", line 71
SyntaxError: Non-ASCII character '\xe2' in file /usr/lib/python2.7/dist-packages/qtvcp/widgets/camview_widget.py on line 71, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for detailsGuess, that's because 2.9 is based on python 3 and 2.8.3 is still on 2.7. I got:
LANG=C apt list python
Listing... Done
python/oldstable,now 2.7.16-1 amd64 [installed,automatic]I am not familiar with python. Thus I do not feel fit to backport stuff to 2.7 (if possible at all). So, I cannot test it under 2.8.4.
greez
chris
Attachments:
Please Log in or Create an account to join the conversation.
		Time to create page: 0.136 seconds