In OpenCV 2.4.9 there is a nice function cv::adaptiveBilateralFilter(). It is documented here http://docs.opencv.org/modules/imgproc/doc/filtering.html?highlight=bilateralfilter#adaptivebilateralfilter
In OpenCV 3 (from GIT) all references to it has been removed. Even sample code is gone.
Can anybody explain reasons for removing it. Probably some other way to use cv::bilateralFilter() as adaptive? How?
Its been removed from 2.4 because of low quality.
( search https://github.com/Itseez/opencv for 'removed ABF' ).
But anything can happen as opencv-3 is not yet released. I guess, we just have to wait for the official changelog and perhaps alternate functionality.
Related
I have multiple cameras in my Windows 11 system and I am wondering how to get all avaiable resolutions for them. I am not intending to make a video capture, but I am willing to just get these properties.
Also, I don't care which API to use, be it DirectShow or MMF (Microsoft Media Foundation).
I haven't used any of these before either.
I have found multiple resources doing that in C# (as in here), but similar suggested answers for C++ are hard to understand - some code is given, but what libraries and 'includes' used is not given (as in here)
I have also checked DirectShow samples in hope something would be there, but I didn't find anything.
So, I checked MMF as well (1, 2, 3) and docs, but all posts seem pretty outdated and no full code is given showing how to use certain functions alongside proper 'includes', as trying the code gives me unresolved symbols.
So I am kind of stuck at the moment, I can't find a solution to this.
I would appreciate any help.
Also, I don't care which API to use, be it DirectShow or MMF (Microsoft Media Foundation). I haven't used any of these before either.
You generally do care because the data might be different.
With Media Foundation, see How to Set the Video Capture Format
Call IMFMediaTypeHandler::GetMediaTypeCount to get the number of supported formats.
You might also want to have a look at Tanta:
Windows Media Foundation Sample Projects and sample code there.
With DirectShow, see Webcamera supported video formats in addition to links you found; you will have to sort out includes and libraries through, among SDK samples AMCap does some one this and can be built from source without additional external libraries, from original code or from this fork adopted to most recent VS.
I'm trying to save a series of images (16 bit grayscale pgm) as video. The video has to be compressed. My program has to be independent of the codecs installed in the system.
My initial idea was to use OpenCV for this, unfortunately it depends on codecs installed in the system (unless I'm missing something).
I feel like there should be a way to compile an encoder (H264 or similar would be perfect) into the program or redistribute it as a dll with my program. I just can't find any good up to date guidance/examples.
I've been swimming in the deep vast ocean of AV encoding for a couple of days and would really appreciate it if someone could point me to a right direction.
Thanks.
As Ben suggests, it would be a good idea to use an established library in your code.
FFMPEG is probably the most used at the moment - it can be used on the command line, with a 'wrapper' program or the libraries it is built with can be used directly.
I think the last case sounds like the one you want - you can find documentation here:
https://trac.ffmpeg.org/wiki/Using%20libav*
Note the comment about disambiguation at the start - this is important to understand as the project lib and the library (which is what you want) are different things.
and there is some notes in this answer on how to build it into a program:
FFMpeg sample program
I am having a bit of annoying problem with OpenCV CV_* constants for functions.
I know OpenCV has recently got rid of the CV_ for a lot of constants, however I can not find any updated documentation. And all the documentation that exits it still shows the old constants.
For example CV_BGR2GRAY has been switched to COLOUR_BGR2GRAY.
Where Can I find the new updated documentation for these constants like
CV_AA, CV_HOUGH_GRADIENT. (before someone says their original website, I have already checked and it shows older versions).
Any links would be nice.
Many thanks for your help.
Here's OpenCV 3.0 documentation:
http://docs.opencv.org/trunk/index.html
Conversion constants are described here:
http://docs.opencv.org/trunk/modules/imgproc/doc/miscellaneous_transformations.html
I'm trying to compile my code with opencv 3.0.0 (that worked with previous opencv versions)
cvtColor(img, img, CV_RGB2BGR);
and get compilation error
‘CV_RGB2BGR’ was not declared in this scope
The option also does not exist in the documentation
How can I get the same functionality (RGB2BGR) with the new version?
Use constant cv::COLOR_RGB2BGR instead of CV_RGB2BGR.
It works for other convertions too, just change CV_ to cv::COLOR_ .
Just checked it it works for me.
Maybe you have a namespace issue?
The enum is defined here, and in any case, it is exactly the same as CV_BGR2RGB - it just mixes the channels. You could also use mixChannels() directly.
Be careful, OpenCV 3 is something new, it is very probable that it has changed some macros and also functions and especially functionality. More it is not a stable versions, meaning it is still in dev. I have seen that there are some other names for the macros, like COLOR_RGB2BGR. The CV_RGB2BGR seems to be in types_c.h
I'd like to find a JPEG-writing library that can be statically linked (so there are no DLL dependencies). No JPEG-reading ability is required.
Edit: I got LibGD working, but it had one problem described here:
LibGD library is not working: crash when saving image
libjpeg is the most popular library for saving jpegs, but it can be a bit of a pain to use.
Edit, here is a simple example of how to use it. Look for the function juce_writeJPEGImageToStream.
Have you looked at LibGD? I can't seem to find the license, but neither did you specify a requirement.
If you're running your application on Windows then you should use the standard, built-in "GDI+" library that Microsoft provides. Every computer running XP or later has this library.
GDI+ is intended to supersede GDI, which is what you're probably already using whether you know it or not, but it can co-exist with GDI calls provided you flush the buffers when switching between the two. See:
http://www.cpjj.net/Miscellaneous/CreateJPEGFromDC.htm
(Hans Passant - you should have written your comment as an answer).