Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ippiHoughLine Crashes if the image is too large

hlukeh
Beginner
528 Views
Hello,

I am using the ippiHoughLine routine ippiHoughLine_8u32f_C1R to detect lines in a binary image. The routine is:

[cpp]        IppPointPolar *lines;     
Ipp8u *buffer;
int num_lines;
IppiSize detect_roi_size;
detect_roi_size.width = detect_roi.width;
detect_roi_size.height = detect_roi.height;
IppPointPolar hough_line_delta;
hough_line_delta.rho = 1;
hough_line_delta.theta = 1 * CV_PI / 180;

try
{
IppStatus status = ippiHoughLine_8u32f_C1R((Ipp8u const *)edge_data.roi_row(0), edge_data.step(),
detect_roi_size, hough_line_delta , 15, lines,
5000, &num_lines, buffer);
if (status != ippStsNoErr)
throw Exception("ippiHoughLine_8u32f_C1R() failed [%s].", ippGetStatusString(status));
}
catch(...)
{

}[/cpp]


However, if the image is too large eg. (roi x,y,width,height = 0, 0, 1536, 1783) it crashes in ftime64.c in the routine:

[bash]CRTIMP errno_t __cdecl _ftime64_s (struct __timeb64 *tp)

at the line:

tp->millitm = (unsigned short)((nt_time.ft_scalar / 10000i64) % 1000i64);
tp->time = (__time64_t)((nt_time.ft_scalar - EPOCH_BIAS) / 10000000i64);

[/bash]
If I decrease the height of the image, it does not crash. The catch statement does not catch any exception, the program just crashes in that time routine.

Does anyone happen to know what would cause this and what I could do to prevent it? I know that I could decrease the size of the roi, and that's what I normally do, but I am just wondering why this is crashing the way it is and if there is any way to handle or prevent it.

There is not a lot of memory being used at the time of the crash (100MB).

Thanks a lot,

Luke
0 Kudos
2 Replies
Vladimir_Dudnik
Employee
527 Views
Hi Luke,

could you please add some additional info (ideally would be to attach a compilable sample to reproduce)?

What is IPP version do you use? What is your target processor and OS? How do you link with IPP dynamically or statically? If you link statically do you link with threaded static libs or not-threaded static libs?

Regards,
Vladimir
0 Kudos
RyanS
New Contributor I
527 Views

As a workaround, you could downsample your image, then do the Hough transform on that smaller image. Often people do a gaussian or binomial filter to blur slightly before downsampling to avoid signal loss. The Hough transform should work the same, and also be faster.The theta found on the downsampled image is fine, doesn't need to be modified due to the downsampling. The rho found on the downsampled image must be scaled up to account for the downsampling.

0 Kudos
Reply