Skip to content

Commit

Permalink
Fix deprecation warning Conversion of an array with ndim > 0 to a scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
t20100 committed Apr 11, 2024
1 parent 9734709 commit 360dbd4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/silx/opencl/sift/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Project: Sift implementation in Python + OpenCL
# https://github.com/silx-kit/silx
#
# Copyright (C) 2013-2018 European Synchrotron Radiation Facility, Grenoble, France
# Copyright (C) 2013-2024 European Synchrotron Radiation Facility, Grenoble, France
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -324,8 +324,8 @@ def align(
[transform_matrix[5], transform_matrix[2]], dtype=numpy.float32
)
matrix = numpy.empty((2, 2), dtype=numpy.float32)
matrix[0, 0], matrix[0, 1] = transform_matrix[4], transform_matrix[3]
matrix[1, 0], matrix[1, 1] = transform_matrix[1], transform_matrix[0]
matrix[0, 0], matrix[0, 1] = transform_matrix[4, 0], transform_matrix[3, 0]
matrix[1, 0], matrix[1, 1] = transform_matrix[1, 0], transform_matrix[0, 0]
if double_check and (
len_match >= 3 * 6
): # and abs(matrix - numpy.identity(2)).max() > 0.1:
Expand All @@ -348,12 +348,12 @@ def align(
)
matrix = numpy.empty((2, 2), dtype=numpy.float32)
matrix[0, 0], matrix[0, 1] = (
transform_matrix[4],
transform_matrix[3],
transform_matrix[4, 0],
transform_matrix[3, 0],
)
matrix[1, 0], matrix[1, 1] = (
transform_matrix[1],
transform_matrix[0],
transform_matrix[1, 0],
transform_matrix[0, 0],
)
if relative: # update stable part to perform a relative alignment
self.ref_kp = kp
Expand Down

0 comments on commit 360dbd4

Please sign in to comment.