python 3.6 opencv3
I don't know how to find one position (x,y) coordinate in numpy ndarray.
The reason why I want to access the numpyndarray address is because I thought that the cv2.Keypoints() argument has rows x, columns y of the matrix, and I have to use the address to get the argument.
patches[x]=
[[[255 255 255]
[255 255 255]
[255 255 255]]
How do I specify the location of 255 in the middle of an array like the one above as a variable?
Array a = [255 255]
[255 255 255]
[255 255 255]
I would like to substitute b for the address of row 1 column 1 in b in python.
The goal is simply to get raw addresses as variables
Am I correct in understanding that you would like to obtain the value in the middle position?
The code presented had a lot of starting parentheses and could not determine whether it was a tertiary or secondary array.
C++ says &a[1][1]
, so I'll interpret it as a secondary array.
import numpy
patches = numpy.array([
[255, 255, 255],
[255, 255, 255],
[255, 255, 255]
])
print (patches[1,1])
# = > 255
patches[1,1] = 100
print(patches)
# = > [[255 255 255]
# [255 100 255]
# [255 255 255]]
ndarray can be a collection of indexes for each dimension.
If not specified, everything you do not specify will be the new ndarray selected.
print (patches[1])
# = > [255 100 255 ]
Note: Memory addresses, such as those in C language, cannot be accessed due to the abstraction of numpy.
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
620 Uncaught (inpromise) Error on Electron: An object could not be cloned
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
582 PHP ssh2_scp_send fails to send files as intended
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.