mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-30 12:31:08 +08:00
Trying to debug the Segfault-3 : Making the arrays C-contiguous
This commit is contained in:
@@ -55,17 +55,17 @@ def _get_filtered_image(image, no_of_scales, mode):
|
||||
|
||||
def _slanted_integral_image_modes(img, mode=1):
|
||||
if mode == 1:
|
||||
image = np.copy(img)
|
||||
mode1 = np.zeros((image.shape[0] + 1, image.shape[1]))
|
||||
image = np.copy(img, order='C')
|
||||
mode1 = np.zeros((image.shape[0] + 1, image.shape[1]), order='C')
|
||||
_slanted_integral_image(image, mode1)
|
||||
print '7'
|
||||
return mode1[1:, :]
|
||||
|
||||
elif mode == 2:
|
||||
image = np.copy(img)
|
||||
image = np.copy(img, order='C')
|
||||
image = np.fliplr(image)
|
||||
image = np.flipud(image)
|
||||
mode2 = np.zeros((image.shape[0] + 1, image.shape[1]))
|
||||
mode2 = np.zeros((image.shape[0] + 1, image.shape[1]), order='C')
|
||||
_slanted_integral_image(image, mode2)
|
||||
print '7'
|
||||
mode2 = mode2[1:, :]
|
||||
@@ -74,10 +74,10 @@ def _slanted_integral_image_modes(img, mode=1):
|
||||
return mode2
|
||||
|
||||
elif mode == 3:
|
||||
image = np.copy(img)
|
||||
image = np.copy(img, order='C')
|
||||
image = np.flipud(image)
|
||||
image = image.T
|
||||
mode3 = np.zeros((image.shape[0] + 1, image.shape[1]))
|
||||
mode3 = np.zeros((image.shape[0] + 1, image.shape[1]), order='C')
|
||||
_slanted_integral_image(image, mode3)
|
||||
print '7'
|
||||
mode3 = mode3[1:, :]
|
||||
@@ -85,10 +85,10 @@ def _slanted_integral_image_modes(img, mode=1):
|
||||
return mode3
|
||||
|
||||
else:
|
||||
image = np.copy(img)
|
||||
image = np.copy(img, order='C')
|
||||
image = np.fliplr(image)
|
||||
image = image.T
|
||||
mode4 = np.zeros((image.shape[0] + 1, image.shape[1]))
|
||||
mode4 = np.zeros((image.shape[0] + 1, image.shape[1]), order='C')
|
||||
_slanted_integral_image(image, mode4)
|
||||
print '7'
|
||||
mode4 = mode4[1:, :]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#cython: cdivision=True
|
||||
#cython: boundscheck=False
|
||||
#cython: nonecheck=False
|
||||
#cython: wraparound=False
|
||||
#cython: boundscheck=True
|
||||
#cython: nonecheck=True
|
||||
#cython: wraparound=True
|
||||
|
||||
cimport numpy as cnp
|
||||
import numpy as np
|
||||
|
||||
Reference in New Issue
Block a user