cv::remap on two different systems

asked 2018-03-01 03:26:21 -0600

I have an issue with cv:remap. I have code supposed to run on two different systems:

  1. MacOS, OpenCV 3.2
  2. Windows, OpenCV 2.4.13

The code is supposed to run on both systems, that's why I'm testing it on both.

At one point in the code, I'm using cv::remap on a 24-channel CV_32F image. This works perfectly on Mac/3.2, and fails with an exception on Windows/2.4.13. The exception even tells me what is wrong: Apparently, on the Windows/2.4.13 combo the image mustn't have more than four channels for cv::remap.

I find this documented nowhere, and I don't know if it's a Windows or 2.4.13 restriction. In either case: why?

I temporarily fixed the issue by splitting into channels, then loop-remap, then merge again, but this is way less elegant.

edit retag flag offensive close merge delete


  • 24-channel -- seriously ?
  • "The exception even tells me what is wrong" -- exact error msg, please,
  • 2.4.13 -- why use that ? rather try with latest master
berak gravatar imageberak ( 2018-03-01 03:28:58 -0600 )edit

Yes, seriously. It's not uncommon in what I'm doing. I'm using more on occasion, but 24 is very common.

Demosthenes gravatar imageDemosthenes ( 2018-03-01 03:31:28 -0600 )edit

"24 is very common." -- sure, sad as it is. unfortunately, it's more a frozen, maintanace branch, no additional functionality will get added there, ever. if it has restrictions, you'll have to live with it.

berak gravatar imageberak ( 2018-03-01 03:35:09 -0600 )edit

Again: It's supposed to run on different versions, one of them being 2.4.13. I'm not on the Windows machine right now, but it was a failed assertion where one part was "cns<=4" or something like that. Pretty obvious it's an assertion on channels, and on the separate channels everything worked perfectly (aside from possibly run-time, didn't measure the difference).

Demosthenes gravatar imageDemosthenes ( 2018-03-01 03:35:26 -0600 )edit

" or something like that" -- please be exact, so we can look up the problem.

berak gravatar imageberak ( 2018-03-01 03:36:50 -0600 )edit

You should try to put a minimal reproducible code that triggers the exception.

Eduardo gravatar imageEduardo ( 2018-03-01 04:00:46 -0600 )edit