#hazzy Logs
Mar 15 2020
#hazzy Calendar
12:28 AM CaptHindsight: got the opencv widget but no video yet
12:28 AM CaptHindsight: project for later today
12:28 AM TurBoss: is your device /dev/video0 ?
12:28 AM TurBoss: or 1
12:29 AM CaptHindsight: still learning how the designer tool works
12:29 AM CaptHindsight: i have buttons working
12:29 AM TurBoss: cool
12:30 AM TurBoss: everything is in the properties editor ctrl + I
12:30 AM TurBoss: crtl + i
12:30 AM CaptHindsight: not sure if I added the opencv widget properly yet to a VCP
12:30 AM TurBoss: you may get an error in designer but is about svg
12:31 AM CaptHindsight: yeah
12:31 AM TurBoss: is ok to ignore
12:31 AM CaptHindsight: something about converting widgets
12:31 AM TurBoss: yes that
12:32 AM CaptHindsight: got passed that, saw the new display widget , dragged it over
12:32 AM TurBoss: for now all the settings like devices and such are hardcoded in the widget
12:33 AM TurBoss: cal you issue
12:33 AM TurBoss: ls /dev/video*
12:34 AM TurBoss: or open your camera with vlc ?
12:36 AM CaptHindsight: debian9 in virtual box so i have to grab the USB
12:36 AM CaptHindsight: will work on this later after some rest
12:36 AM TurBoss: cool
12:36 AM TurBoss: nigh
12:36 AM CaptHindsight: thanks!!
02:56 AM TurBoss: I'm trying to obtain a copy of the pycamunits sources
02:56 AM TurBoss: http://psha.org.ru/cgit/psha/pycamunits.git
02:56 AM TurBoss: is down :(
07:03 AM Tom_L: TurBoss, http://psha.org.ru/b/pycamunits.ru.html
07:03 AM Tom_L: or https://github.com/pib/pycam/blob/master/pycam/Plugins/Units.py
07:03 AM Tom_L: ?
07:04 AM Tom_L: http://psha.org.ru/tmp/camview-emc.html
08:22 AM dremeier[m]1: good morning!
08:23 AM dremeier[m]1: https://pyformat.info/
08:24 AM dremeier[m]1: ^^ the syntax from there, should work? Can´t find the right one
08:42 AM dremeier[m]1: If the minimum Value is not 0 then the bar does not show up.
08:44 AM * dremeier[m]1 uploaded an image: image.png (294KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/aBKxXDarUqiEPknynHhiOOjs >
10:29 AM hazzy-m: dremeier: I need to work on the math for negative numbers
10:29 AM hazzy-m: it was all I could do to get positive values to work lol
10:30 AM roguish[m]: dremeier: what type of pressure sensor are you using and how is the signal into hal ???
10:33 AM dremeier[m]1: The Signal is 0 to 10V, so comes in analoge. 10V is 10 Bar
10:36 AM dremeier[m]1: hazzy: see on Spindle temp, the minimum is 20 the value is 25 but the bar does not show up.
11:41 AM hazzy-m: TurBoss: did you get the OpenVC widget to open in designer?
11:54 AM * hazzy-m uploaded an image: image.png (651KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/yBEHAOhctIZWtjldYhOJmAax >
12:11 PM dremeier[m]1: hazzy: do you want to improve the HalBar or is this the finale for now?
12:13 PM Not: [02qtpyvcp] 07KurtJacobson pushed 031 commit to 03opencv [+0/-0/±1] 13https://git.io/Jvi5X
12:13 PM Not: [02qtpyvcp] 07KurtJacobson 03b2971da - add crosshairs and scale image to widget size
12:17 PM hazzy-m: dremeier: I am working on it
12:17 PM dremeier[m]1: great 👍️
12:49 PM * dremeier[m]1 uploaded an image: image.png (90KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/EikLhIPVsdLOQNTHugoxDuJy >
12:53 PM dremeier[m]1: float values are working :-)
12:53 PM dremeier[m]1: I´m out for dinner
03:22 PM TurBoss: hello
03:23 PM CaptHindsight: TurBoss: should I look at using pyqt5.qtsvg vs rsvg for rendering the SVG files?
03:24 PM TurBoss: rsvg is from gtk
03:24 PM TurBoss: i think the svg example is overcomplicated
03:25 PM CaptHindsight: he was just testing and had some other features in mind
03:25 PM TurBoss: mine i mean
03:25 PM CaptHindsight: oh ok
03:26 PM CaptHindsight: I have video going in debian9 on the virtual machine
03:26 PM CaptHindsight: how do you get to display in the opencv widget?
03:27 PM CaptHindsight: how do you get video to display
03:28 PM TurBoss: sek booting
03:29 PM CaptHindsight: dev/video0
03:36 PM TurBoss: CaptHindsight: https://github.com/kcjengr/qtpyvcp/blob/opencv/qtpyvcp/widgets/display_widgets/opencv_widget/opencv_widget.py#L52
03:36 PM TurBoss: hazzy: hello you used Qpaint and not opencv draw stuff :P
03:36 PM hazzy-m: TurBoss: I don't know which is better
03:37 PM hazzy-m: I know how to use QPaint lol
03:37 PM TurBoss: yup
03:47 PM TurBoss: hazzy: is ok to change it to cv stuff?
03:50 PM hazzy-m: absolutely!
03:50 PM TurBoss: ty
03:50 PM hazzy-m: I was just playing because I didn't want to work on the hal bar widget lol
03:50 PM TurBoss: I'll add some slots to change the lines position and radius of center
03:52 PM hazzy-m: TurBoss: does the OpenCV widget load in designer for you? I crashes here
03:52 PM hazzy-m: * TurBoss: does the OpenCV widget load in designer for you?
03:52 PM TurBoss: hmm
03:52 PM hazzy-m: it crashes here
03:53 PM hazzy-m: it works if i remove the import cv and put it in the setup camera method
03:53 PM hazzy-m: so is something with cv, not with the widget its self
03:53 PM TurBoss: it works here
03:54 PM CaptHindsight: it loads in designer for me, i can drag it to a window but then what?
03:54 PM CaptHindsight: signal/slot editor?
03:54 PM TurBoss: not much there yet CaptHindsight:
03:54 PM TurBoss: could you run the vcp?
03:54 PM TurBoss: your screen?
03:54 PM CaptHindsight: it crashes
03:55 PM hazzy-m: it might be a conflict on my system then
03:55 PM TurBoss: :/
03:55 PM TurBoss: there is only a error shown from the svg example
03:57 PM CaptHindsight: I'm still getting used to Qt Designer
03:58 PM CaptHindsight: I've made windows with buttons that work so far in LCNC but that is my limit
03:58 PM TurBoss: :)
04:00 PM Lcvette: What's crackin?
04:00 PM TurBoss: \o/
04:00 PM Lcvette: \o/
04:00 PM TurBoss: we are confined in house
04:01 PM Lcvette: /o\
04:01 PM TurBoss: very serious
04:01 PM Lcvette: Sounds like it
04:03 PM Lcvette: Corona virus is no good anywhere
04:08 PM Lcvette: TurBoss: Is there alot of cases where you are
04:08 PM TurBoss: duno
04:09 PM TurBoss: didn't see tv
04:15 PM Not: [02qtpyvcp] 07KurtJacobson pushed 031 commit to 03master [+0/-0/±2] 13https://git.io/JviAL
04:15 PM Not: [02qtpyvcp] 07KurtJacobson 037c0b9d6 - DOC: Add LinuxCNC forum section to README
04:17 PM Not: [02qtpyvcp] 07KurtJacobson pushed 031 commit to 03gh-pages [+468/-0/±0] 13https://git.io/JviA3
04:17 PM Not: [02qtpyvcp] 07traviscibot 03fb64d73 - Deploy kcjengr/qtpyvcp to github.com/kcjengr/qtpyvcp.git:gh-pages
04:18 PM Lcvette: Hurray!
04:25 PM Not: [02qtpyvcp] 07TurBoss pushed 031 commit to 03opencv [+0/-0/±1] 13https://git.io/JviAW
04:25 PM Not: [02qtpyvcp] 07TurBoss 0375952fb - replace qt draw stuff with cv one
06:30 PM Not: [02qtpyvcp] 07TurBoss pushed 031 commit to 03opencv [+0/-0/±1] 13https://git.io/JvipX
06:30 PM Not: [02qtpyvcp] 07TurBoss 030b8a58c - implement slots for lines
07:16 PM * TurBoss uploaded an image: Captura de pantalla de 2020-03-16 01-16-02.png (487KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/pPkxtzdaEHNqjpQncKFmqkLb >
08:44 PM hazzy-m: TurBoss: nice!
09:20 PM CaptHindsight: TurBoss: how should i expect to work with the new openCV widget?
09:21 PM CaptHindsight: with opencv you set an input and output, then place filters and function in between
09:22 PM CaptHindsight: say the camera as the input, and a window as the output, then you can have the video pass through whatever layers of filters
09:23 PM CaptHindsight: having cross hairs lets you manually jog the machine into position
09:24 PM CaptHindsight: but openCV can measure the distance between current crosshair location relative to a part edge, corner, hole center and provide XY position info to auto jog into position
09:26 PM CaptHindsight: or for pick-n-place it provides the fine adjustment for parts aligned in trays or can orient a gripper to pick random parts and random angles and locations within a given boundary
09:27 PM hazzy-m: CaptHindsight: Yes! Would be awesome to have edge and corner detection
09:27 PM hazzy-m: it might make sense to use a plugin for the actual image processing to make it modular
09:27 PM CaptHindsight: I need to learn more about how the widgets IO works
09:28 PM hazzy-m: that way it would be easy to tweak for individual machines/cameras and needs
09:28 PM CaptHindsight: where and how do i get data from, like /dev/camera0
09:28 PM CaptHindsight: into the widgets window
09:29 PM hazzy-m: CaptHindsight: have you looked at the opencv_widget.py file yet?
09:29 PM hazzy-m: it is very simple
09:29 PM CaptHindsight: briefly
09:29 PM CaptHindsight: maybe it's already right in front of me :)
09:30 PM hazzy-m: it should be
09:30 PM hazzy-m: this line in setup_camera opens the stream `self.capture = cv2.VideoCapture('/dev/video0')`
09:31 PM hazzy-m: than a periodic timer is set up to call display_video_stream every 30ms
09:32 PM hazzy-m: the camera stream is read and the image painted on a QLable widget for display
09:32 PM * hazzy-m sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/kkQVGEoUNnOjHWJUmVmIdwgz >
09:33 PM CaptHindsight: OK so that displays the video from the camera
09:33 PM hazzy-m: any data processing would be done between getting the frame from the camera and painting it on the label widget
09:34 PM hazzy-m: which is what the setPixmap does
09:34 PM CaptHindsight: how about if video is piped into openCV for filtering and then you want to view that in the widget window?
09:36 PM CaptHindsight: isn't the video that is processed by openCV no longer at /dev/video0 ?
09:37 PM hazzy-m: you would just process the individual frame
09:39 PM * hazzy-m sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/whmavXkBOciPdkQClJAdnqGa >
09:40 PM hazzy-m: as easy as that to add canny edge detection for each frame
09:40 PM hazzy-m: the data is in edges, and you should further plot or process that, either each frame, or store it and process it later
09:42 PM CaptHindsight: then we just need some buttons for Sobel Filter (edge detect) and a slider for adjusting it
09:43 PM CaptHindsight: so the user can have some tuning
09:43 PM hazzy-m: yes, that should be easy
09:44 PM CaptHindsight: and the user can decide to manually jog to position of the crosshairs or auto "home" to it
09:45 PM hazzy-m: or set origin to edge without moving the machine ...
09:47 PM CaptHindsight: yes
09:48 PM CaptHindsight: another application is having 3 reference marks on the material to be machined
09:49 PM CaptHindsight: the camera jogs around to get their locations and then sets the origin or provides and offset for the tool paths
09:49 PM CaptHindsight: and /an
09:58 PM * hazzy-m uploaded an image: image.png (96KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/iFtiOcNDISpSJHYYbpxuOipm >
09:59 PM hazzy-m: CaptHindsight: basic canny edge detection working on a PCB
10:01 PM CaptHindsight: yes, drill and mill a pcb, then flip and have it aligned automatically
10:05 PM hazzy-m: oh, that would be awesome!
10:05 PM hazzy-m: I'm not going to mess up TurBoss branch with this, but I'll push to a new branch so you can look at it
10:07 PM CaptHindsight: ok
10:07 PM CaptHindsight: we'll figure out how to best use this
10:08 PM CaptHindsight: then mess up the TurBoss branch :p
10:09 PM hazzy-m: actually, I just changed tow lines, so I'll just post the modified method here
10:09 PM * hazzy-m sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/AurGPDYWAjQbmzWEskWaGmlp >
10:10 PM hazzy-m: time for bed
10:10 PM hazzy-m: night Capt!
10:11 PM CaptHindsight: see you tomorrow