cap_v4l.cpp: size and pixel format patch (Patch #981)
Description
Because my camera outputs faulty MJPEG, I needed a possibility to change the pixel format. I couldn't figure out how to really change the format of the camera using libv4l, so i fell back to the v4l interface. I more or less rewrote autosetup_capture_mode_v4l2 and implemented CV_CAP_PROP_FORMAT which now takes the formats defined in videodev2.h.
I also had to add the workaround used in cap_libv4l.cpp to fix setting the image size.
For some strange reason I still can't set the size to 800 x 600. All other sizes supported by my camera work just fine. I get a select timeout and eventually the lib crashes in yuyv_to_rgb24. Probably this is just another defect of my camera though. When testing with guvcview 800 x 600 doesn't always work ether.
BTW, what is the progress on rewriting the v4l interface altogether? Will it only be for cap_libv4l.cpp? Ether way, I find it pretty necessary. The code looks very patched up and the styling couldn't be any more inconsistent.
Associated revisions
Merge pull request #981 from SeninAndrew:ximea_camera_support_fix
Merge remote-tracking branch 'origin/2.4'
Original pull requests:
#996 from jet47:gpu-nvcuvid-libraries
#995 from jet47:fix-bug-2985
#999 from snosov1:unreliable-results-fix
#1005 from alekcac:doc_fix
#1004 from jet47:fix-bug-3068
#987 from jet47:bug-3085-fix
#969 from pengx17:2.4_binary_cache
#929 from dominikrose:mingw-libdc1394-2-windows
#1000 from ivan-korolev:fix_sift_bug_2892
#1001 from ivan-korolev:fix_stitching_bug_2405
#998 from asmorkalov:android_cmake_mips_fix
#993 from ivan-korolev:fix_videostab_bug_3023
#988 from snosov1:3071-fix
#986 from pengx17:2.4_initiated_context
#982 from pengx17:2.4_fix_two_bugs
#981 from SeninAndrew:ximea_camera_support_fix
#991 from asmorkalov:android_javadoc_fix
#972 from jet47:mog2-params-bug-2168
#980 from SpecLad:include-config
#973 from pengx17:2.4_oclclahe
#903 from aks2:2.4
#968 from asmorkalov:android_na_cproj_fix
#971 from SpecLad:matchers-ctor
#970 from asmorkalov:dshow_valid_check_fix
#965 from apavlenko:fix_java_empty_mats
Conflicts:
cmake/OpenCVModule.cmake
modules/core/src/matmul.cpp
modules/gpu/CMakeLists.txt
modules/ocl/include/opencv2/ocl/ocl.hpp
modules/ocl/perf/perf_imgproc.cpp
modules/ocl/src/imgproc.cpp
modules/ocl/src/initialization.cpp
modules/stitching/src/matchers.cpp
modules/video/src/video_init.cpp
modules/videostab/src/global_motion.cpp
History
Updated by Filipe Almeida almost 14 years ago
Hi there,
I'm not physically with the project owners and this should be discussed with them.
Some possible rewrites may impact on the current API.
Despite the fact I've suggested the complete rewritting of the v4l hooks on OpenCV, I'm currently unable to assign time to the project (professional reasons).
Nonetheless I'm willing to participate in any discussions and to help anyone who's up for the task.
Please post this issue/request on the forum as well.
Updated by Ezra Bühler almost 14 years ago
Hi, thanx for the answer.
The above patch consists only of minor changes and doesn't affect the API. It's more a bugfix. So it would be nice if it were applied to the trunk. I noticed that you committed the last v4l changes, so I assumed that I should select you as owner. If that is not the case, feel free to assign it to someone else.
The rewrite is an all different subject...
Updated by Kirill Kornyakov about 13 years ago
- Tracker changed from Feature to Patch
Updated by Alexander Shishkov almost 13 years ago
- Priority changed from High to Normal
- Target version deleted ()
Updated by Alexander Shishkov almost 13 years ago
- Priority changed from Normal to Low
Updated by Alexander Shishkov almost 13 years ago
- Assignee deleted (
Filipe Almeida)
Updated by Alexander Shishkov almost 13 years ago
- Target version deleted ()
Updated by Andrey Kamaev over 12 years ago
- Category changed from highgui-images to highgui-camera