fixed memory alloc bug in edge detection