wpiroboticsprojects / grip Goto Github PK
View Code? Open in Web Editor NEWProgram for rapidly developing computer vision applications
Home Page: http://wpiroboticsprojects.github.io/GRIP
License: Other
Program for rapidly developing computer vision applications
Home Page: http://wpiroboticsprojects.github.io/GRIP
License: Other
It is impossible to remove a webcam source.
If you supply a mask param you start getting a ghosting effect on the image.
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1770)
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1653)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.control.MenuItem.fire(MenuItem.java:462)
at com.sun.javafx.scene.control.ControlAcceleratorSupport.lambda$doAcceleratorInstall$12(ControlAcceleratorSupport.java:165)
at com.sun.javafx.scene.control.ControlAcceleratorSupport$$Lambda$251/1135422936.run(Unknown Source)
at com.sun.javafx.scene.KeyboardShortcutsHandler.processAccelerators(KeyboardShortcutsHandler.java:347)
at com.sun.javafx.scene.KeyboardShortcutsHandler.dispatchBubblingEvent(KeyboardShortcutsHandler.java:163)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$KeyHandler.process(Scene.java:3965)
at javafx.scene.Scene$KeyHandler.access$1800(Scene.java:3911)
at javafx.scene.Scene.impl_processKeyEvent(Scene.java:2040)
at javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2502)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:197)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:147)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$349(GlassViewEventHandler.java:228)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$339/1953432847.get(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:404)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:227)
at com.sun.glass.ui.View.handleKeyEvent(View.java:546)
at com.sun.glass.ui.View.notifyKey(View.java:956)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$48(GtkApplication.java:139)
at com.sun.glass.ui.gtk.GtkApplication$$Lambda$41/1327763628.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1767)
... 39 more
Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot initialize CameraSource without either a device number or address : Cannot initialize CameraSource without either a device number or address
---- Debugging information ----
message : Cannot initialize CameraSource without either a device number or address
cause-exception : java.lang.IllegalArgumentException
cause-message : Cannot initialize CameraSource without either a device number or address
class : edu.wpi.grip.core.sources.CameraSource
required-type : edu.wpi.grip.core.sources.CameraSource
converter-type : edu.wpi.grip.core.serialization.SourceConverter
line number : 3
class[1] : java.util.ArrayList
converter-type[1] : com.thoughtworks.xstream.converters.collections.CollectionConverter
class[2] : edu.wpi.grip.core.Pipeline
converter-type[2] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
version : 0.1.0
-------------------------------
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.addCurrentElementToCollection(CollectionConverter.java:98)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:91)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:85)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:80)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1206)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1190)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1061)
at edu.wpi.grip.core.serialization.Project.open(Project.java:58)
at edu.wpi.grip.core.serialization.Project.open(Project.java:52)
at edu.wpi.grip.ui.MainWindowView.openProject(MainWindowView.java:146)
... 49 more
Caused by: java.lang.IllegalArgumentException: Cannot initialize CameraSource without either a device number or address
at edu.wpi.grip.core.sources.CameraSource.createFromProperties(CameraSource.java:122)
at edu.wpi.grip.core.serialization.SourceConverter.unmarshal(SourceConverter.java:53)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
... 72 more
Event: ErrorEvent
Event: ErrorClearedEvent
ErrorWitness (final class)
Needs a few additional parameters for the operation that is there to be really useful. Then you can think about how to do a more general version of blob finding operations.
Each source will be associated with a specific source view.
Currently it is possible to connect multiple things to an input of a step. This shouldn't be allowed - it makes the value of the socket ambiguous and dependent on the timing of the events in the application. Instead, when the user tries to make a connection to an input socket that is already connected to something, we could either not allow it, or just remove the old connection.
The function to search the palette list of steps does not search the step descriptions.
Pipeline should be run in a separate thread
The pipeline should have a timer and will run at a specific rate.
Setting the source value will no longer runs the pipeline; instead it flags a dirty bit.
for(;;) {
if(sem.wait(time) || sources.dirty) {
run();
}
}
This will make everything sequential and makes mutable data safe.
Is this OK?
:ui:run
ID Type Value
Dec 10, 2015 9:50:18 AM com.sun.javafx.css.StyleConverterImpl getInstance
SEVERE: StyleConverterImpl : converter Class is null for : com.sun.javafx.scene.layout.region.CornerRadiiConverter
Dec 10, 2015 9:50:18 AM com.sun.javafx.css.StyleConverterImpl readBinary
SEVERE: could not deserialize com.sun.javafx.scene.layout.region.CornerRadiiConverter
could not deserialize com.sun.javafx.scene.layout.region.CornerRadiiConverter
Building 90% > :ui:run
Also opening a camera that does not exist causes an exception.
edit: Opening cameras on windows does not work, if the camera exists on that slot or not. The problem seems to be in the way you handle the camera class with opencv. I have used a program written with java to process an image.
Property Name | Property |
---|---|
javafx.version | 8.0.66 |
java.runtime.name | Java(TM) SE Runtime Environment |
java.vm.version | 25.66-b17 |
java.vm.vendor | Oracle Corporation |
java.vm.name | Java HotSpot(TM) 64-Bit Server VM |
java.runtime.version | 1.8.0_66-b17 |
java.awt.graphicsenv | sun.awt.Win32GraphicsEnvironment |
javafx.runtime.version | 8.0.66-b17 |
os.name | Windows 10 |
os.version | 10.0 |
os.arch | amd64 |
file.encoding | Cp1252 |
java.vm.info | mixed mode |
java.version | 1.8.0_66 |
sun.arch.data.model | 64 |
sun.cpu.endian | little |
java.io.IOException: A problem occurred trying to start the frame grabber for Webcam 1
at edu.wpi.grip.core.sources.CameraSource.startVideo(CameraSource.java:97)
at edu.wpi.grip.core.sources.CameraSource.<init>(CameraSource.java:68)
at edu.wpi.grip.core.sources.CameraSource.<init>(CameraSource.java:43)
at edu.wpi.grip.ui.pipeline.AddSourceView.lambda$null$39(AddSourceView.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.bytedeco.javacv.FrameGrabber$Exception: cvCreateCameraCapture() Error: Could not create camera capture.
at org.bytedeco.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:179)
at edu.wpi.grip.core.sources.CameraSource.startVideo(CameraSource.java:95)
... 6 more
In aerial assist, you could get more points in autonomous if your robot scored in the "hot" goal. One of the approaches to this was using computer vision to identify which goal was lit up There's a page on screensteps explaining one approach (there's also c code using the NI libraries)
If add the following features, this program would theoretically be useful in 2014:
RGBThresholdOperation
The remaining math in the screensteps page would probably happen in the control system code, not in GRIP.
Sources should not be started until either the user chooses to add it in the UI, the core triggers a start event (headless. This will ensure that sources that are loaded from a
Starting a source:
StartAllSourcesEvent
StartAllSourcesEvent
Closing a camera crashes Grip, the camera wont show up even if i put in the right values.
When using "mask" type mats, it would be super helpful to have some sort of simple editing functions in GRIP for creating simple mats. Single-channel rectangle drawing would be fine for this.
What were the actions performed prior to this error appearing?
Property Name | Property |
---|---|
javafx.version | 8.0.60 |
java.runtime.name | Java(TM) SE Runtime Environment |
java.vm.version | 25.60-b23 |
java.vm.vendor | Oracle Corporation |
java.vm.name | Java HotSpot(TM) 64-Bit Server VM |
java.runtime.version | 1.8.0_60-b27 |
java.awt.graphicsenv | sun.awt.CGraphicsEnvironment |
javafx.runtime.version | 8.0.60-b27 |
os.name | Mac OS X |
os.version | 10.11.1 |
os.arch | x86_64 |
file.encoding | UTF-8 |
java.vm.info | mixed mode |
java.version | 1.8.0_60 |
sun.arch.data.model | 64 |
sun.cpu.endian | little |
java.lang.IllegalStateException: Failed to grab image
at edu.wpi.grip.core.sources.CameraSource.lambda$startVideo$23(CameraSource.java:110)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.bytedeco.javacv.FrameGrabber$Exception: cvGrabFrame() Error: Could not grab frame. (Has start() been called?)
at org.bytedeco.javacv.OpenCVFrameGrabber.grab(OpenCVFrameGrabber.java:244)
at edu.wpi.grip.core.sources.CameraSource.lambda$startVideo$23(CameraSource.java:108)
... 1 more
While running Find Lines and Filter lines for an extended period of time I encountered a blue screen. I was running a TV show on a second monitor which might been related.
I created a FindLines and FilterLines operation and turned on the image previews for them. Nothing showed up in the preview area, but I did notice that the scrollbar changed, indicating that it was allocating an empty window about the right size. It did work the first time I tried it. I'll continue to play with it to see if I can find a pattern.
Switch statements should have a default label
switch (channels) {
Trying to use any webcam other then 0 when your system only has 1 webcam throws an exception. Ideally GRIP would enumerate the webcams on your system and only present ones that won't make it crash.
java.io.IOException: A problem occurred trying to start the frame grabber for Webcam 1
at edu.wpi.grip.core.sources.CameraSource.startVideo(CameraSource.java:97)
at edu.wpi.grip.core.sources.CameraSource.<init>(CameraSource.java:68)
at edu.wpi.grip.core.sources.CameraSource.<init>(CameraSource.java:43)
at edu.wpi.grip.ui.pipeline.AddSourceView.lambda$null$39(AddSourceView.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.bytedeco.javacv.FrameGrabber$Exception: cvCreateCameraCapture() Error: Could not create camera capture.
at org.bytedeco.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:179)
at edu.wpi.grip.core.sources.CameraSource.startVideo(CameraSource.java:95)
... 6 more
When implementing dependency injection there are two common patterns that are used. Constructor Injection and Field Injection.
Please use this post to collect evidence supporting/against one pattern or the other.
Harder to test
Field Injection
Guice injects fields with the @Inject annotation. This is the most concise injection, but the least testable.
-Guice wiki
Slower
Second issue is performance. A constructor call (direct or by reflection) is always faster than a bunch of reflection field assignments. Dependency injection frameworks must use reflection analysis to build dependency tree and create reflection constructors. This process causes additional performance hit.
-Maciej Chaลapuk
Breaks the encapsulation paradigm
From the philosophical point of view, field injection breaks encapsulation, which is one of four fundamentals of object-oriented programming, which is the main paradigm of Java.
-Maciej Chaลapuk
Encourages Dependency hiding
If there was one thing I could take away from #Spring it was being able to use @Autowired on fieldsโฆ sigh #BedCon
It encourages hiding dependencies, which is the opposite of what DI actually wants to achieveโฆ
Considered 'Auto-Magic' by manny
So i have always stayed away from field injection... There is a lot of what I consider automagic behind the scenes, and from my opinion I always prefer explicit over implicit.
- Scott Hepburn (Kronos Inc. Software Engineer, uses Spring)
Impossible to create instances of a class without using reflection
Reduces the amount of "boilerplate" code you have to write.
JavaFX uses field injection by default
Promotes smaller classes
Promotes being able to define concrete state rules about a class.
The core of the problem here is that code youโve written allows clients to create instances of the class in an invalid state. The whole purpose of a type is clients being able to rely on the invariants it enforces. Itโs one of the reasons you use an EmailAddress type over a plain String to represent email adresses in your code: clients can be sure the instance they get is a valid email address as the value object enforces this constraint during construction. A String can potentially be anything, validated or not - how do you know?
-Oliver Gierke
Provides a way to write tests without an injection framework
At least with constructor and setter injection, you have the option of not using the frameworks and/or reflection in your tests.
Project Lombok will solve the code bloat problem.
Since OpenCV's inRange
method is prone to segfaulting with the wrong input it should be avoided. Instead, inRange
should be wrapped in a helper function that provides certain safety guarantees to ensure that a segfault is not possible.
What were the actions performed prior to this error appearing?
yeah uh uh type - Jonathan Leitschuh
tried to use a webcam on windows
Property Name | Property |
---|---|
javafx.version | 8.0.66 |
java.runtime.name | Java(TM) SE Runtime Environment |
java.vm.version | 25.66-b17 |
java.vm.vendor | Oracle Corporation |
java.vm.name | Java HotSpot(TM) 64-Bit Server VM |
java.runtime.version | 1.8.0_66-b17 |
java.awt.graphicsenv | sun.awt.Win32GraphicsEnvironment |
javafx.runtime.version | 8.0.66-b17 |
os.name | Windows 10 |
os.version | 10.0 |
os.arch | amd64 |
file.encoding | windows-1252 |
java.vm.info | mixed mode |
java.version | 1.8.0_66 |
sun.arch.data.model | 64 |
sun.cpu.endian | little |
java.io.IOException: A problem occurred trying to start the frame grabber for Webcam 0
at edu.wpi.grip.core.sources.CameraSource.startVideo(CameraSource.java:97)
at edu.wpi.grip.core.sources.CameraSource.<init>(CameraSource.java:68)
at edu.wpi.grip.core.sources.CameraSource.<init>(CameraSource.java:43)
at edu.wpi.grip.ui.pipeline.AddSourceView.lambda$null$39(AddSourceView.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.bytedeco.javacv.FrameGrabber$Exception: cvCreateCameraCapture() Error: Could not create camera capture.
at org.bytedeco.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:179)
at edu.wpi.grip.core.sources.CameraSource.startVideo(CameraSource.java:95)
... 6 more
I can full screen and minimize but not resize the window manually. The split screen is working however.
When you click preview the preview shows up on the right of the preview pane instead in the same order of the pipeline.
It will only work on two images. However, OpenCV allows for a single image and a scalar. Is this something we should fix?
Registering an object to the event bus inside of a constructor call can result in a subscriber being called prior to all of the fields in the class being fully constructed. This can lead to null pointer exceptions for fields that are final and should have been initialized in the classes constructor.
Relavent Gitter Discussion Discovery of problem and discussion of how to fix it.
Guava Google Groups Discussion with Dev
Don't publish the "this" reference during construction
One of the mistakes that can introduce a data race into your class is to expose the this reference to another thread before the constructor has completed. Sometimes the reference is explicit, such as directly storing this in a static field or collection, but other times it can be implicit, such as when you publish a reference to an instance of a non-static inner class in a constructor. Constructors are not ordinary methods -- they have special semantics for initialization safety. An object is assumed to be in a predictable, consistent state after the constructor has completed, and publishing a reference to an incompletely constructed object is dangerous. Listing 2 shows an example of introducing this sort of race condition into a constructor. It may look harmless, but it contains the seeds of serious concurrency problems.
-Brian Goetz
This can be resolved by ensuring that constructors never call a register method
See:
http://docs.opencv.org/3.0.0/d7/d1b/group__imgproc__misc.html#ga72b913f352e4a1b1b397736707afcde3
Should only take THRESH_BINARY and THRESH_BINARY_INV, but has dropdown items for all the threshold types.
Please create a list of operations and inputs that should be removed and leave them here.
Don't know how to fix this. We should probably check the log file and try to figure out what is going wrong.
Chocolatey installed 0/1 package(s). 1 package(s) failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log
Use explicit scoping instead of the default package private level
final RangeSlider slider;
Do you have any plans to package Kinect support with GRIP? I'm not sure how it would work, since every platform implements drivers differently, but it could potentially be very useful.
If we have a sink that is publishing after we deploy GRIP over to the robot then there will be two network tables nodes publishing to the same values. As such, we should make it so that when when we push the jar over to the robot it should should suspend camera access on the local machine.
This instead should be handled with a more subtle notification.
This is more intuitive than having to press the enter key in a field to commit the value to the step.
When a connection to an input socket is removed, the socket still has the last value obtained from that connection. One of the reasons this is bad is because some types (like Mat
s) are basically pointers, so the value of the input socket keeps changing as long as the Mat
keeps getting modified by the step it used to be connected to.
Using this save file:
Move your camera very fast. The image will show through even though the "show original image" is unchecked.
<grip:Pipeline>
<sources>
<grip:Camera>
<property name="deviceNumber" value="0"/>
</grip:Camera>
</sources>
<steps>
<grip:Step name="resize">
<grip:Input step="0" socket="0"/>
<grip:Input step="0" socket="1"/>
<grip:Input step="0" socket="2">
<value>0.25</value>
</grip:Input>
<grip:Input step="0" socket="3">
<value>0.25</value>
</grip:Input>
<grip:Input step="0" socket="4">
<value>INTER_LINEAR</value>
</grip:Input>
<grip:Output step="0" socket="0" published="false" previewed="true"/>
</grip:Step>
<grip:Step name="Find Blobs">
<grip:Input step="1" socket="0"/>
<grip:Input step="1" socket="1">
<value>1</value>
</grip:Input>
<grip:Input step="1" socket="2">
<value>
<double>0.0</double>
<double>1.0</double>
</value>
</grip:Input>
<grip:Input step="1" socket="3">
<value>false</value>
</grip:Input>
<grip:Output step="1" socket="0" published="false" previewed="true"/>
</grip:Step>
</steps>
<connections>
<grip:Connection>
<grip:Output step="0" socket="0" published="false" previewed="true"/>
<grip:Input step="1" socket="0"/>
</grip:Connection>
<grip:Connection>
<grip:Output source="0" socket="0" published="false" previewed="false"/>
<grip:Input step="0" socket="0"/>
</grip:Connection>
</connections>
<sink>
<value class="edu.wpi.grip.core.sinks.DummySink"/>
</sink>
</grip:Pipeline>
What were the actions performed prior to this error appearing?
I added a webcam. I'm using a USB webcam (Logitech 9000 Pro) on Windows 10 64-bit
Message: Camera Frame Grabber Thread crashed with uncaught exception
Property Name | Property |
---|---|
javafx.version | 8.0.66 |
java.runtime.name | Java(TM) SE Runtime Environment |
java.vm.version | 25.66-b17 |
java.vm.vendor | Oracle Corporation |
java.vm.name | Java HotSpot(TM) 64-Bit Server VM |
java.runtime.version | 1.8.0_66-b17 |
java.awt.graphicsenv | sun.awt.Win32GraphicsEnvironment |
javafx.runtime.version | 8.0.66-b17 |
os.name | Windows 10 |
os.version | 10.0 |
os.arch | amd64 |
file.encoding | Cp1252 |
java.vm.info | mixed mode |
java.version | 1.8.0_66 |
sun.arch.data.model | 64 |
sun.cpu.endian | little |
java.lang.ArithmeticException: / by zero
at edu.wpi.grip.core.sources.CameraSource.lambda$start$18(CameraSource.java:158)
at java.lang.Thread.run(Thread.java:745)
...At least in ubuntu. Is this something we want? Opencv allows for differently sized images, but the usage is complicated.
This was broken by the refactor
After shutting down my IP webcam, GRIP threw a null pointer error. Ideally, GRIP would notice that it lost connection, and display the last frame it received as well as a "lost connection" notice somewhere in the UI. Ideal behavior would also include a UI control or intermittent pinging to restore connectivity when it becomes available.
java.lang.NullPointerException
at org.bytedeco.javacv.IPCameraFrameGrabber.grab(IPCameraFrameGrabber.java:121)
at edu.wpi.grip.core.sources.CameraSource.lambda$startVideo$23(CameraSource.java:108)
at java.lang.Thread.run(Thread.java:745)
java.lang.NullPointerException
at edu.wpi.grip.ui.preview.TextAreaSocketPreviewView.onSocketChanged(TextAreaSocketPreviewView.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at edu.wpi.grip.core.Socket.setValue(Socket.java:90)
at edu.wpi.grip.core.OutputSocket.setValue(OutputSocket.java:51)
at edu.wpi.grip.core.sources.CameraSource.lambda$startVideo$87(CameraSource.java:166)
at java.lang.Thread.run(Thread.java:745)
Webcam Frame Grabber Thread crashed with uncaught exception:
java.lang.IllegalStateException: Not on FX application thread; currentThread = Thread-5
at com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:236)
at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(QuantumToolkit.java:423)
at javafx.scene.Parent$2.onProposedChange(Parent.java:367)
at com.sun.javafx.collections.VetoableListDecorator.setAll(VetoableListDecorator.java:113)
at com.sun.javafx.collections.VetoableListDecorator.setAll(VetoableListDecorator.java:108)
at com.sun.javafx.scene.control.skin.LabeledSkinBase.updateChildren(LabeledSkinBase.java:575)
at com.sun.javafx.scene.control.skin.LabeledSkinBase.handleControlPropertyChanged(LabeledSkinBase.java:204)
at com.sun.javafx.scene.control.skin.LabelSkin.handleControlPropertyChanged(LabelSkin.java:49)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase.lambda$registerChangeListener$61(BehaviorSkinBase.java:197)
at com.sun.javafx.scene.control.MultiplePropertyChangeListenerHandler$1.changed(MultiplePropertyChangeListenerHandler.java:55)
at javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:89)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:182)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
at javafx.beans.property.StringPropertyBase.fireValueChangedEvent(StringPropertyBase.java:103)
at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:110)
at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:144)
at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:49)
at javafx.beans.property.StringProperty.setValue(StringProperty.java:65)
at javafx.scene.control.Labeled.setText(Labeled.java:145)
at edu.wpi.grip.ui.pipeline.input.SliderInputSocketView.lambda$new$69(SliderInputSocketView.java:52)
at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:349)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
at javafx.beans.property.DoublePropertyBase.fireValueChangedEvent(DoublePropertyBase.java:106)
at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:113)
at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:147)
at javafx.scene.control.Slider.setValue(Slider.java:213)
at edu.wpi.grip.ui.pipeline.input.SliderInputSocketView.updateSliderValue(SliderInputSocketView.java:60)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at edu.wpi.grip.core.Socket.setValue(Socket.java:90)
at edu.wpi.grip.core.OutputSocket.setValue(OutputSocket.java:51)
at edu.wpi.grip.core.sources.CameraSource.lambda$startVideo$87(CameraSource.java:166)
at java.lang.Thread.run(Thread.java:745)
Let's collect all of the issues related to the generated OpenCV functions in one place so we can keep up with the progress on them easily. Here are the ones I've found by playing around with it a little.
dtype
or ddepth
parameter. We want to provide as low-level access as necessary, but these don't really seem to map to useful ideas in the application, even though they happen to parameters to many opencv functions.accumulateSquare
(and other accumulate functions that we don't wrap) aren't really operations, they're more like implementations of the +=
operator. It doesn't make sense to make operations for them.batchDistance
crashes. The domain for K should be 1 to MAX_VALUE
, not MIN_VALUE
to MAX_VALUE
.canny
crashes. We need to implement checkbox socket controls.compare
, flipcode
, etc... Many enums are shown as integers. We should detect which parameters seem to be enums.cornerHarris
, cornerMinEigenVal
, possible more output Mat
s of floats. We should allow float Mat
s to be previewed.dilate
probably remove the border stuff, or at least make it actually work.normalize
keeps printing errors about "Unknown/unsupported norm type". I guess the enums aren't being generated with the right values.pow
, sqrt
only work on floating point Mat
s. I'm also not sure if we need to support these operations right now, but if we discover that taking the square root of an image is useful, we should add a way to convert between pixel data types.Line Filter should take a minimum and a maximum.
It should indicate what the length's scale is, or alternatively it should be relative to the size of the mat so it doesn't matter if the resize operation changes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.