Hello everyone
I have been trying to find a good way to cut of the image from the camera in 3 squares in the center of the image cause i don't really need the sides of the image. My solution right now is:
frame = qRgb.get()
aa = frame.getCvFrame()
seg = 0
for square in squares:
image_arr = aa[square[1]:square[3], square[0]:square[2]]
img = dai.ImgFrame()
img.setData(to_planar(image_arr, (320, 320)))
img.setTimestamp(monotonic())
img.setWidth(320)
img.setHeight(320)
img.setSequenceNum(seg)
qIn.send(img)
detections = qNn.get().detections
seg += 1
The squares are the 3 middle squares like this:
For my use case, each side of the squares needs to be 320 pixels.
I just need to know if this is the best way to do it or if there are more effective ways.
Thanks for reading this, I'm sorry if this is hard to follow this is my first real problem post 🙂