Hello all I ran into this error when I tried to display an via imshow: Invalid shape (4951,) for image data
This data is the pixel "peak_vals" output I got from running an image through photutils.find_peaks()
. The original shape was (5820,). I'm pretty sure this error is occurring because of the irregular shape, but I am not sure if it is possible to reshape it to the right dimensions.
So my question is:
If there is a possible method of reshaping, what is it?
If no, how can I find the connected pixels (or hyperpixels) within the image that I am working with? My original approach was to fit the peak_vals data (pixel intensity data) to an ellipse and filter down the data/pixels to those that fit within the ellipse. 2 iterations of this led to the data's reshaping (from (5820,) to (4951,).