I just joined this site and was surprised to see that there is a matlab tag but not an OpenCV tag. I then found that we are already asking if OpenCV questions are off-topic. However, there seems to be no objection against these questions:

From my understanding, an answer on the OpenCV meta question suggests accepting questions about algorithms and rejecting those that care only about the implementation of an algorithm in a particular language.

Without knowing much about the details, it seems like the Python question was asked as an implementation question but its accepted answer explains an algorithm.


  • Should we accept language-specific questions?
  • If the answer is it depends, then when would a language-specific question be valid?

See this answer for what I think of "How to do X in Y" questions. To quote:

Ideally, algorithms, ideas and approaches should be first and foremost and not code in language X. I mean, the answerer can use whatever language they feel they're comfortable in (e.g., the river detection question had answers in MATLAB, python and Mathematica), but the focus of the question should not be an explicit "give be the codez in X". Questions like show me how in any language and I'll work it out myself are also most welcome here.

Explicit requests for code in language X should be off-topic. The primary reason for not allowing questions that simply want code in X is because then we'll get overrun by which ever language is most commonly used in the particular field, and other folks who are more inclined towards theory and algorithm development part of it might be put off and leave. I can easily see MATLAB/openCV questions just flooding us if we opened the gates (in fact, we get a few such questions which you don't see because they are either promptly migrated or nuked right here).

However, Jonas had a point that it should be OK for users to present their problem (with code if necessary) in whatever language they're using, as long as the approach is clear from their code (i.e., no brainfuck or golfscript like code). Further more, there will be no guarantees of an answer in that particular language, i.e., if someone knows a good algorithm and explains it via Mathematica/MATLAB/python for an OpenCV question, then it should be fine. It's up to the OP to translate it (they can always go to Stack Overflow for help with that). I think this is a very reasonable position and will help foster a language-agnostic culture, instead of the language-free culture we've been having up until now. Some examples of good, recent questions like this are:

In both cases, the OP was looking for a solution in a particular language, but were both happy to learn of a possible approaches in different languages and I presume, are working on translating whatever helped.

Coming to your examples, the first question should not have been asked here. It was originally asked on Stack Overflow, and Endolith, a good contributor to this site recommended dsp.se. However, I won't fault him for that, because the SO version looked more like a conceptual question, which would've been a good fit, whereas the OP decided to dump his code here. The answer barely passes the minimum characters required. I'll ship it back to SO sometime soon.

The second one though, is very much on-topic. Note the last line: "The result inverse contains complex values, that confuses me." That is the crux of the question. The rest is just to support the story. It is clear that the problem is a conceptual one and the OP merely provided his code to guide the question and perhaps confirm if his problem is with the code or with his understanding. These are actually the kind of questions that would be very interesting on this site. Couple of others with code/language in the question, but has a theoretical/conceptual answer is


Welcome to the site!

The answer, of course, is it depends. In general, programming questions are in the realm of Stackoverflow, so we will migrate everything of the form My FFT function gives me an error there. However, sometimes you're trying to program a specific algorithm and it's simply more convenient to show your code for asking the question rather than writing down every single equation.

As you can see, the Python question you linked to was really about how to perform FFT with a computer, not about how to program on Python, and the upvoted answer has nothing to do with programming, but is rather explaining the concepts behind frequency-domain techniques.

Strictly speaking, "How do I do X in Y (programming language)?" will not be very welcome no any SE site, because that shows lack of willingness to try it yourself. If you're having specific questions like "What data structure should I use for complex FFT vectors?", that's a SO question with a tag. If you say "Here's my code for a Hilbert transformer which gives funny results for complex inputs. Please help me find where it's wrong", this might as well be here.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .