0

i have a Flir A615 camera and im getting data from it with this code:

image_result = cam.GetNextImage()
image_data = image_result.GetNDArray()

then to show im using matplotlib

plt.imshow(image_data, cmap='afmhot')

but i cant use it on opencv like

cv2.imshow("frame",image_data)

some one know how to convert the PySpin.Image to Opencv format?

Andre Leon Rangel
  • 1,659
  • 1
  • 16
  • 28
Jasar Orion
  • 626
  • 7
  • 26
  • Add `cv2.waitKey(0)` so that it will show the image until you press the space bar. See https://docs.opencv.org/4.1.1/d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7 and https://docs.opencv.org/4.1.1/d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563 – fmw42 Apr 01 '20 at 22:06
  • thank you i will try it – Jasar Orion Apr 02 '20 at 23:31
  • i see you tagged this question with Spinnaker but this tag is for the devops software tool Spinnaker. Maybe there should be a different spinnaker-Photograph tag. I hope you find your solution soon. – Andre Leon Rangel Apr 21 '20 at 00:56

1 Answers1

0

The PySpin image.GetNDArray method converts and returns the image to a numpy array. In this answer you can find the conversion rules for numpy -> opencv format: Converting Numpy Array to OpenCV Array

Dharman
  • 30,962
  • 25
  • 85
  • 135