RetinaFastToneMapping Class Returning Zero Mat in Java Wrapper

asked 2019-11-05 02:22:28 -0600

Faraday gravatar image

Hello! I am trying to use the RetinaFastToneMapping class in the opencv contrib module in java, but keep running into a strange problem. The function that does the tone mapping doesn't seem to be able to actually return the luminence-corrected image. Instead, it creates a blank image of the same size and type as the input (when I say blank, I mean filled with zeros). This is the code I am using to test the class:

    Mat input = Imgcodecs.imread(filepath,Imgcodecs.IMREAD_GRAYSCALE);

    RetinaFastToneMapping retina = RetinaFastToneMapping.create(input.size());

    retina.setup();

    input.convertTo(input,CvType.CV_64F);
    Mat test = new Mat(input.size(),input.type());
    retina.applyFastToneMapping(input,test);`:

I am using opencv 4.0.1 to test, so it is possible that this issue has since been fixed, but I can't find any references to it anywhere, so it seemed reasonable to ask on here. If I am using the RetinaFastToneMapping class wrong, then that could be the problem as well. I would appreciate any help anyone can give me on this problem as i've been stuck on it for quite some time. I've been running the code on this image: image description Thank you for taking the time to read this question!

edit retag flag offensive close merge delete

Comments

I am using opencv 4.0.1 to test, so it is possible that this issue has since been fixed

still happens to me with current master(4.1.2) using c++, also:

warning: Heap block at 003FF458 modified at 003FF478 past requested size of 18
Program received signal SIGTRAP, Trace/breakpoint trap.
berak gravatar imageberak ( 2019-11-06 09:11:36 -0600 )edit
1

Hi @berak! If you are getting this issue as well should I submit this as an issue on the github?

Faraday gravatar imageFaraday ( 2019-11-06 19:42:24 -0600 )edit

should I submit this as an issue on the github?

i think this is a good idea.

berak gravatar imageberak ( 2019-11-07 02:00:53 -0600 )edit
berak gravatar imageberak ( 2019-11-08 10:11:13 -0600 )edit

Sorry! I was doing college apps

Faraday gravatar imageFaraday ( 2019-11-08 16:40:24 -0600 )edit