Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to add image source in GRIP #966

Open
handsomeadi opened this issue Aug 15, 2020 · 3 comments
Open

unable to add image source in GRIP #966

handsomeadi opened this issue Aug 15, 2020 · 3 comments

Comments

@handsomeadi
Copy link

I just opened GRIP and selected "add image source", but some exceptions occurred and there appeared a box telling me that my image was invalid. Worst of all, the app crashed after I closed the issue box. Does anyone know how to solve this?
p.s. Below is the message I got from the issue box.

The image selected was invalid

Stack Trace:

java.io.IOException: Error lo$USERng image D:\機研\cascade_classifier\Cargo\IMG_20200812_152034.jpg
	at edu.wpi.grip.core.util.ImageLo$USERngUtility.loadImage(ImageLo$USERngUtility.java:35)
	at edu.wpi.grip.core.sources.ImageFileSource.loadImage(ImageFileSource.java:119)
	at edu.wpi.grip.core.sources.ImageFileSource.loadImage(ImageFileSource.java:115)
	at edu.wpi.grip.core.sources.ImageFileSource.initialize(ImageFileSource.java:81)
	at edu.wpi.grip.ui.pipeline.AddSourceButton.lambda$new$0(AddSourceButton.java:111)
	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.skin.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1405)
	at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.lambda$createChildren$343(ContextMenuContent.java:1358)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	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.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.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	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$MouseHandler.process(Scene.java:3757)
	at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
	at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:380)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:294)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:416)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:415)
	at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
	at com.sun.glass.ui.View.notifyMouse(View.java:937)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
	at java.lang.Thread.run(Thread.java:745)

System Info:

Property Name Property
GRIP Version v1.5.2
java.version 1.8.0_101
javafx.version 8.0.101
os.name Windows 10
os.version 10.0
os.arch amd64
@JLLeitschuh
Copy link
Member

Hi @handsomeadi,

I'm wondering if this issue has anything to do with the 機研 characters in the path of the file. Do you have any way of attempting to load the file from a path that doesn't contain chinese characters?
You could try doing this with an external zip drive.

@JLLeitschuh
Copy link
Member

I'm going to guess that this is because of some sort of issue in openCV unfortunately.

public static void loadImage(String path, final int flags, Mat dst) throws IOException {
checkNotNull(path, "The path can not be null");
checkNotNull(dst, "The destination Mat can not be null");
final Mat img = opencv_imgcodecs.imread(path, flags);
if (img == null || img.empty() || img.isNull()) {
throw new IOException("Error loading image " + path);
} else {
img.copyTo(dst);
}

@nbourre
Copy link

nbourre commented Oct 12, 2021

I'm having the same issue with a path containing an accented character. (Eg : "D:\photos\2021\école\45132747_DB0766.JPG")

A workaround is to replace the accented character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants