GRIP icon indicating copy to clipboard operation
GRIP copied to clipboard

resize types don't work

Open nightpool opened this issue 8 years ago • 16 comments

not sure if this is indicative of a lower-level opencv bug, but the bottom three values of the interpolation option on the resize operation throw an error

specifically, inter_max, warp_fill_outliers, and warp_inverse_map

(on master)

stack trace from the logs:

OpenCV Error: Bad argument (Unknown interpolation method) in resize, file /Users/saudet/projects/bytedeco/javacpp-presets/opencv/cppbuild/macosx-x86_64/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3363
java.lang.RuntimeException: /Users/saudet/projects/bytedeco/javacpp-presets/opencv/cppbuild/macosx-x86_64/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp:3363: error: (-5) Unknown interpolation method in function resize

    at org.bytedeco.javacpp.opencv_imgproc.resize(Native Method)
    at edu.wpi.grip.generated.opencv_imgproc.Resize.perform(Resize.java:59)
    at edu.wpi.grip.core.Operation.perform(Operation.java:61)
    at edu.wpi.grip.core.Step.runPerformIfPossible(Step.java:145)
    at edu.wpi.grip.core.Step.onInputSocketChanged(Step.java:164)
    at sun.reflect.GeneratedMethodAccessor30.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.setValueOptional(Socket.java:70)
    at edu.wpi.grip.core.OutputSocket.setValueOptional(OutputSocket.java:36)
    at edu.wpi.grip.core.Socket.setValue(Socket.java:79)
    at edu.wpi.grip.core.OutputSocket.setValue(OutputSocket.java:41)
    at edu.wpi.grip.core.sources.CameraSource.lambda$start$15(CameraSource.java:209)
    at edu.wpi.grip.core.sources.CameraSource$$Lambda$402/1745982941.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
Property Name Property
GRIP Version 0.3.0
javafx.version 8.0.45
java.runtime.name Java(TM) SE Runtime Environment
java.vm.version 25.45-b02
java.vm.vendor Oracle Corporation
java.vm.name Java HotSpot(TM) 64-Bit Server VM
java.runtime.version 1.8.0_45-b14
java.awt.graphicsenv sun.awt.CGraphicsEnvironment
javafx.runtime.version 8.0.45-b11
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_45
sun.arch.data.model 64
sun.cpu.endian little

nightpool avatar Jan 06 '16 02:01 nightpool

I've tested this before and it works. Huh. I'll have to try that out and see what happens. Thanks for the issue.

OH! You mean the ENUM? Yea, those are generated and need to be manually removed. Unfortunately I never implemented a mechanism to do that....

JLLeitschuh avatar Jan 06 '16 02:01 JLLeitschuh

@nightpool What arguments are you putting in the boxes? Here is a working example: untitled

AustinShalit avatar Jan 06 '16 02:01 AustinShalit

edited issue with more explicit description re: @AustinShalit's confusion

nightpool avatar Jan 06 '16 02:01 nightpool

also some border types in erode have this issue:

  • border_wrap
  • border_transparent
  • border_isolated

nightpool avatar Jan 06 '16 02:01 nightpool

@JLLeitschuh I recommend removing the borderType param in erode (I doubt anyone is using it)

Thoughts?

ThomasJClark avatar Jan 06 '16 02:01 ThomasJClark

Not in this release. Perhaps in the next one.

JLLeitschuh avatar Jan 06 '16 04:01 JLLeitschuh

Ok, but fixing the resize types should definitely happen. That's a pretty bad bug

ThomasJClark avatar Jan 06 '16 05:01 ThomasJClark

Really both of them are pretty critical. They should definitely be fixed before 1.0.0

ThomasJClark avatar Jan 06 '16 19:01 ThomasJClark

See also issue #151

PaulaRudy avatar Jan 06 '16 19:01 PaulaRudy

So basically, @JLLeitschuh opencv is just really bad at types? For some reason I'm not at all surprised...

nightpool avatar Jan 06 '16 20:01 nightpool

This isn't an OpenCV issue, the issue is that we're including invalid values in the dropdown menu

ThomasJClark avatar Jan 06 '16 20:01 ThomasJClark

@ThomasJClark sure, but the root cause of that is that OpenCV does not have well-defined enum types. (For example, they have a enum ThresholdTypes, but that enum is reused in places where it's not appropriate, such as AdaptiveThreshold)

nightpool avatar Jan 06 '16 20:01 nightpool

Yes, opencv is really bad with types. We are generating that list dynamically from the sourcecode of another library that unfortunately contains list of integers instead of enums that we can use.

Those enums don't exist as enums in the opencv source code. All of that has to be parsed and turned into eums we can display.

JLLeitschuh avatar Jan 06 '16 20:01 JLLeitschuh

@JLLeitschuh Hi,the enums types can not be found, you removed the enums to integers,could you give me an examples ? thank you for your repay!

YIFanH avatar Jan 09 '17 08:01 YIFanH

I'm not sure what you mean? What are you trying to do with GRIP Where the enums aren't being found?

JLLeitschuh avatar Jan 09 '17 15:01 JLLeitschuh

@JLLeitschuh I am so sorry for my expressions,i make opencv_improc modules as a independent module in my android-ndk project, when used the resize function, the unknown interpolation method appeared.

YIFanH avatar Jan 10 '17 01:01 YIFanH