NNDetection when camera rotated


So it’s seems that when I setRotation(1), in detection loop example, AI do not find objects correctly. How I can solve this problem, or I need to reteach according turned camera?


Hi @Justinas_Krauleidis ,

Can you try with ObjectDetectionCallback example?

Thank you.


Thank you for the quick reply. I tried the way you suggested and the results are the same.

Hi @Justinas_Krauleidis ,

For the time being, you can try modifying the roi xmax and ymax value in video_drv.c to the highlighted values.

As previously we have fixed it to xmax as 1920 and ymax as 1080. Therefore, the OSD on videostream might be off when you do video rotation.

1 Like


I ran into a similar problem early into my foray into computer vision. While you can do as @pammyleong suggested, it’s much better practice to make sure you train your model against a rotated dataset. See here: How to Rotate YOLO Bounding Boxes? · UR Machine Learning Blog.

Not finding objects correctly when rotated is a sign that your model is overfitted to a given orientation. There are times when you might want to overfit toward a given orientation (e.g., detection of defects on pre-oriented objects on a production line), but in such cases, you usually also want a smaller rotated dataset to allow your detector to at least know that the object you are looking for is in the frame just not in the right orientation to cover any edge cases that may occur.

Hope that helps.

1 Like