Camera stream upside down

Discussions about the AI-deck
Post Reply
GriffinBonner
Beginner
Posts: 20
Joined: Thu Oct 08, 2020 2:45 pm

Camera stream upside down

Post by GriffinBonner »

I am trying to run the wifi_jpeg_streamer example, but the image is upside down. I tried changing some of the parameter within the "test.c" file where the camera is rotated, but I have not been able to rotate the image. Can anyone suggest a workaround or what to change? I am unable to use the AI-Deck if the image is upside down.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Camera stream upside down

Post by kimberly »

hi!

Do you see this happening if you are flashing on RAM (make run) or if you are flashing it on the flash memory (make flash) ?
GriffinBonner
Beginner
Posts: 20
Joined: Thu Oct 08, 2020 2:45 pm

Re: Camera stream upside down

Post by GriffinBonner »

It is happening when running from RAM and from Flash memory.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Camera stream upside down

Post by tobias »

That is strange. This code is setting a register in the camera module to rotate the image and it has no effect?

Code: Select all

  // rotate image
  uint8_t set_value=3;
  uint8_t reg_value;

  pi_camera_reg_set(&camera, IMG_ORIENTATION, &set_value);
  pi_camera_reg_get(&camera, IMG_ORIENTATION, &reg_value);
  if (set_value!=reg_value)
  {
    printf("Failed to rotate camera image\n");
    return -1;
  }
  printf("Rotated camera image\n");
Do you get the "Failed to rotate camera image" output if running in RAM though the debugger.
GriffinBonner
Beginner
Posts: 20
Joined: Thu Oct 08, 2020 2:45 pm

Re: Camera stream upside down

Post by GriffinBonner »

The code you posted has no effect without adding the following command to activate the AEG before rotating the image. After appending the following to the code, the camera is properly rotated when running the wifi_jpeg_streamer example from RAM, however, it prevents the example from running from FLASH memory and no image is received.

uint8_t set_value = 3;

// image rotation
pi_camera_reg_set(&camera, IMG_ORIENTATION, &set_value);
// activate AEG
pi_camera_control(&camera, PI_CAMERA_CMD_AEG_INIT, 0);
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Camera stream upside down

Post by tobias »

That is a weird behavior. First thing the image should be rotated in the wifi_jpeg_streamer example. What AI-deck version do you have and what camera? Second thing I don't understand why it does not run from flash.
GriffinBonner
Beginner
Posts: 20
Joined: Thu Oct 08, 2020 2:45 pm

Re: Camera stream upside down

Post by GriffinBonner »

I have the AI-Deck V1.1. It is very strange, but per other posts on the forum, this is not an isolated issue and there are other people reporting it as well.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Camera stream upside down

Post by tobias »

this is not an isolated issue and there are other people reporting it as well.
Are you referring to the problem of running the example from RAM if the JTAG isn't detach between power cycles? That the camera image isn't rotated in the wifi_jteg_streamer example I have never seen before.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Camera stream upside down

Post by kimberly »

please try again with the examples! This is hopefully fixed now..
Post Reply