CamView for Wheesy and Jessie

More
10 years 7 months ago - 10 years 7 months ago #71652 by newbynobi
Hallo,

as camview-emc is not any longer supported for Wheesy and Jessie, I decided to make my own widget to show a live image within LinuxCNC. It is based on opencv and GTK2, so it can be embedded in GladeVCP.

You find the branch with an GladeVCP widget to be embedded very easy on
GladeVCP CamView

You will need to install some dependencies, see "Stand Alone Description"

So I need some testers to get results and to convince other developers to merge my stuff to master.

To test "Stand Alone" (Wheesy oder Jessie)
Code:
sudo apt-get install qv4l2
open a terminal and type
Code:
qv4l2
If your camera is recognized and you are able to start a live stream, you are ready to go!
Code:
sudo apt-get install python-opencv sudo apt-get install v4l-utils sudo apt-get install v4l2ucp
Download the attached file camview.txt and rename it to camview.py

Open a terminal and go to the directory you placed camview.py and then type
Code:
python camview.py

Please read also the comments in the file camview.py, as I commented some start options.

Please report:
- should it be included in LinuxCNC / GladeVCP
- What Camera (type and model) do you use? (Will include that info in later documentation)
- Other comments you like to mention

Norbert
Last edit: 10 years 7 months ago by newbynobi. Reason: wrong name of depency (v4l-utils is the corrrect one)
The following user(s) said Thank You: Tchefter

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #72359 by bogie6040
Hello Norbert,

I followed your "stand alone" instructions, it can't find the v4l2-utils returning with:

bogie6040@LinuxCNC:~/Downloads$ sudo apt-get install v4l2-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package v4l2-utils
bogie6040@LinuxCNC:~/Downloads$

So I went to synaptic package manager and found "v4l-utils" version 0.8.8-3 and loaded it....
Everything else was found and loaded correctly, is there a different utilities package I need?

I went ahead and tried to run the camview.py file and it runs for a short period but then returns the following:

bogie6040@LinuxCNC:~/Downloads$ python camview.py
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
camview.py:702: Warning: g_object_ref: assertion `object->ref_count > 0' failed
gtk.main()
Segmentation fault
bogie6040@LinuxCNC:~/Downloads$

I'm looking forward to using your revised camview, looks very useful for the 6 seconds I can check it out.... :) Oh BTW I'm running Wheezy 2.7.4 and the camera is a logitech C270
Thanks, Bogie

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #72366 by newbynobi
Hallo Bogie,

thanks for testing.
My fault, the v4l-utils is the correct one, I corrected that error.

could you please try the following:

in a terminal type:
qv4l2
and let that one run with the preview.

Does that one work OK ?

Norbert

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago - 10 years 7 months ago #72372 by newbynobi
@Bogie

I changed the code a little bit, after googling your problem.
It might be a driver problem, not beeing completly conform with v4l2, but also a timing problem ( your computer is faster than your camera).

Please test with the attached file after renaming it from .txt to .py. You will find in line 310 a timer.sleep(0.1)

With this settings you will get a poor FPS, if it does work, try to reduce the value as much as possible.

You could also check the FPS that your camera does support with qv4l2

Norbert
Last edit: 10 years 7 months ago by newbynobi.

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago - 10 years 7 months ago #72402 by bogie6040
Norbert,

I can't test till I get home tonight (mountain time USA) but somethings I didn't mention, sorry, qv4l2 does bring up a preview of the camera output and I could even change the resolution and whatnot.... when running the camview.py script last night I noticed that the window didn't close if I didn't use the mouse, it did close by it's self after selecting the debug button with the keyboard though....

I will try what you have suggested tonight though...
~edit~ I did try this with an old trust spacecam 300 (only does 640x480) and it does work :) Is there a way to embed this in a tab in Axis?

Bogie
Last edit: 10 years 7 months ago by bogie6040.

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #72427 by bogie6040
Norbert,

The new python script works with my logitech cam now, Is there a way to put it into a tab in axis like the old camview did? Also is there a way to add a focus control?
Excellent work!! :)

Thanks
Bogie

Please Log in or Create an account to join the conversation.

Moderators: HansU
Time to create page: 0.079 seconds
Powered by Kunena Forum