threshold functions gives illegal error (Bug #1559)
Description
1Mat bwin;
2Mat dst;
3Mat in = imread(inputimage);
4cvtColor(in, bwin, CV_RGB2GRAY);
5dst=Mat::eye(in.rows, in.cols, CV_8U);
6//bwin.copyTo(dst);
7threshold(bwin, dst, 50.0, 1.0, THRESH_BINARY);
This opencv code runs fine in opencv 2.1, but produces following error in opencv 2.3:
Illegal instruction
compiled on linux-x64 using g++
Related issues
related to Bug #3386: illegal instruction on cv::ThresholdRunner::operator() | Cancelled | 2013-11-18 |
Associated revisions
Merge pull request #1559 from SpecLad:Wnull-conversion
History
Updated by Vadim Pisarevsky about 13 years ago
the bug can not be repdouced on any of our machines. Which CPU is in your machine, which version of GCC do you use? What are the CMake flags?
- Status changed from Open to Done
- (deleted custom field) set to worksforme
Updated by Vadim Pisarevsky about 13 years ago
one more question - did you build OpenCV from sources or used a pre-compiled package?
Updated by Andrey Kamaev about 13 years ago
- Status changed from Done to Cancelled
Updated by Jan Nörtemann about 13 years ago
I have the exact same issue. This is my test code:
1#include "opencv/cv.h"
2#include "stdio.h"
3
4int main()
5{
6 IplImage* iplTresh = cvCreateImage(cvSize(89, 49), 8, 1);
7 cvZero(iplTresh);
8 cvThreshold(iplTresh, iplTresh, 100, 255, CV_THRESH_BINARY);
9 cvReleaseImage(&iplTresh);
10
11 printf("done.\n");
12 return 0;
13}
I've compiled it on Ubuntu 10.04: 2.6.32-38-generic #83-Ubuntu SMP Wed Jan 4 11:12:07 UTC 2012 x86_64 GNU/Linux with g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3. I have an Intel Core2Duo L7400 and I am using OpenCV 2.3.1 which I've installed by following your install guide: http://opencv.willowgarage.com/wiki/InstallGuide. This is was gdb says:
(gdb) run Starting program: /tmp/thresTest [Thread debugging using libthread_db enabled] Program received signal SIGILL, Illegal instruction. 0x00007ffff6918da7 in cv::threshold(cv::_InputArray const&, cv::_OutputArray const&, double, double, int) () from /usr/local/lib/libopencv_imgproc.so.2.3 (gdb) bt #0 0x00007ffff6918da7 in cv::threshold(cv::_InputArray const&, cv::_OutputArray const&, double, double, int) () from /usr/local/lib/libopencv_imgproc.so.2.3 #1 0x00007ffff691a333 in cvThreshold () from /usr/local/lib/libopencv_imgproc.so.2.3 #2 0x0000000000400ec5 in main ()
One strange thing is, that the code works with some image sizes. With cvSize(100, 49) the code works fine.
Will you reopen this ticket or should I create a new one?
greetings,
jan
Updated by Andrey Kamaev almost 13 years ago
- Target version set to 2.4.0
- Description changed from Mat bwin; Mat dst; Mat in = imread(inputimage); cvtColor(in, bwin, CV_RGB2GRA... to <pre><code class="cpp"> Mat bwin; Mat dst; Mat in = imr... More
- Category set to imgproc, video
Updated by João Silva over 11 years ago
I think I currently have this bug with:
OpenCV 2.4.5
Snowlinux 4 updated to Saucy Salamander
Intel Pentium M (Intel 915GM Chipset)
I don't see in other machines I've tested:
Manjaro Linux (Intel Atom 330)
Linux Mint 15 (Intel Pentium T2330)
Fedora 19 (older Pentium M)
ARM boards
gdb output:
Program received signal SIGILL, Illegal instruction.
0xb7b96cc3 in cv::ThresholdRunner::operator()(cv::Range const&) const () from /usr/lib/libopencv_imgproc.so.2.4
- Target version changed from 2.4.0 to 2.4.7
- Status changed from Cancelled to Open
Updated by Alexander Smorkalov over 11 years ago
- HW Platform set to x64
- Operating System set to Linux
- Difficulty set to Medium
- Affected version set to 2.4.0 - 2.4.6
Updated by Alexander Smorkalov over 11 years ago
It looks like the issue has been already fixed in 2.4. I cannot reproduce it again. I close the issue.
- Status changed from Open to Cancelled