I want to use the object tracker node and i need it to work if i decide to rotate the oak device by 90 degrees clockwise/anticlockwise (basically portrait mode). How do i achieve this? i used the manip node to rotate it by 90 degree but doesn't seem to work.

  • Hi @AmunTimilsina
    That would be correct.
    Rotated CamRGB (physically) --> Image manip (return to normal orientation) --> Yolo (detect on normal orientation frames) --> tracker (inputDetections and detectionFrame from yolo, TrackerFrame from manip).

    Thanks,
    Jaka

Hi @AmunTimilsina
If NeuralNetwork produces detections, then object tracker should work regardless of the orientation. It's likely the NN that's causing the problem here.
You have to rotate the frame before you pass it into NN.

Thanks,
Jaka

The NN doesn't produce detection when rotated frame through manip node. I used the following code:

if device_mode == "portrait":
source_rotate = dai.RotatedRect()
source_rotate.center.x, source_rotate.center.y = (
source_node.getPreviewWidth() // 2,
source_node.getPreviewHeight() // 2,
)
source_rotate.size.width, source_rotate.size.height = (
source_node.getPreviewHeight(),
source_node.getPreviewWidth(),
)
source_rotate.angle = 90
manip_node.initialConfig.setCropRotatedRect(source_rotate, False)

Hi @AmunTimilsina
Check the passthrough output of the NN node. This will give you some insight on what the problem is. Usually the model will only be capable of detecting objects if they are oriented in a certain way (for people and cars that have orientation). If your image is upside-down because wrong rotation is applied, the model won't detect unless it was trained to do so.

Thanks,
Jaka

4 days later

Also what would be the linking? I have used camrgb, manipnode, YoloDet node and object tracker node. The manip_node is responsible for rotation.

Hi @AmunTimilsina
That would be correct.
Rotated CamRGB (physically) --> Image manip (return to normal orientation) --> Yolo (detect on normal orientation frames) --> tracker (inputDetections and detectionFrame from yolo, TrackerFrame from manip).

Thanks,
Jaka

6 days later

This is my linking, this doesn't work:

camrgb.preview.link(manip_node.inputImage)
manip_node.out.link(detector_network.input)
detector_network.out.link(object_tracker.inputDetections)
detector_network.passthrough.link(object_tracker.inputDetectionFrame)
manip_node.out.link(object_tracker.inputTrackerFrame)
object_tracker.out.link(tracker_out.input)
object_tracker.passthroughTrackerFrame.link(xlink_out.input)

Hi @AmunTimilsina
Doesn't work as in you are getting errors or just no detection at all. Please omit the object tracker for now and send the detections as well as the passthrough directly to the host and check if it is correct / expected.

Thanks,
Jaka

I think the rotation issue is fixed however i notice that i am getting this as an output:

My preview size is 640x640 and resolution size is 1080p. Does this mean i have to manually code and change the coordinates if i want the bboxes value for the whole resolution? Also why am i getting the back padding here? When i use landscape i don't get this.