ESP32cam access pixeldata

Im using ESP32cam and are trying to access the pixeldata. I cannot figure out how.

Basically I want to downsample the image to say 50 x 50 pixels then access the pixeldata for further processing in an arduino sketch.

This is my code so far:

#include "esp_camera.h"
#include <WiFi.h>

#define CAMERA_MODEL_AI_THINKER // Has PSRAM
#include "camera_pins.h"

// ===========================
// Enter your WiFi credentials
// ===========================
const char *ssid = "******";
const char *password = "******";

void startCameraServer();
void setupLedFlash(int pin);

void getPixels();

void setup()
{
  Serial.begin(115200);
  Serial.setDebugOutput(true);
  Serial.println();

  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sccb_sda = SIOD_GPIO_NUM;
  config.pin_sccb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.frame_size = FRAMESIZE_CIF;
  config.pixel_format = PIXFORMAT_GRAYSCALE; 
  config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
  config.fb_location = CAMERA_FB_IN_PSRAM;
  config.jpeg_quality = 12;
  config.fb_count = 1;

  // if PSRAM IC present, init with UXGA resolution and higher JPEG quality
  //                      for larger pre-allocated frame buffer.
  if (config.pixel_format == PIXFORMAT_JPEG)
  {
    if (psramFound())
    {
      config.jpeg_quality = 10;
      config.fb_count = 2;
      config.grab_mode = CAMERA_GRAB_LATEST;
    }
    else
    {
      // Limit the frame size when PSRAM is not available
      config.frame_size = FRAMESIZE_SVGA;
      config.fb_location = CAMERA_FB_IN_DRAM;
    }
  }
  else
  {
    // Best option for face detection/recognition
    config.frame_size = FRAMESIZE_240X240;
#if CONFIG_IDF_TARGET_ESP32S3
    config.fb_count = 2;
#endif
  }

#if defined(CAMERA_MODEL_ESP_EYE)
  pinMode(13, INPUT_PULLUP);
  pinMode(14, INPUT_PULLUP);
#endif

  // camera init
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK)
  {
    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  }

  sensor_t *s = esp_camera_sensor_get();
  // initial sensors are flipped vertically and colors are a bit saturated
  if (s->id.PID == OV3660_PID)
  {
    s->set_vflip(s, 1);       // flip it back
    s->set_brightness(s, 1);  // up the brightness just a bit
    s->set_saturation(s, -2); // lower the saturation
  }
  // drop down frame size for higher initial frame rate
  if (config.pixel_format == PIXFORMAT_JPEG)
  {
    s->set_framesize(s, FRAMESIZE_QVGA);
  }

#if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)
  s->set_vflip(s, 1);
  s->set_hmirror(s, 1);
#endif

#if defined(CAMERA_MODEL_ESP32S3_EYE)
  s->set_vflip(s, 1);
#endif

// Setup LED FLash if LED pin is defined in camera_pins.h
#if defined(LED_GPIO_NUM)
  setupLedFlash(LED_GPIO_NUM);
#endif

  WiFi.begin(ssid, password);
  WiFi.setSleep(false);

  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");

  startCameraServer();

  Serial.print("Camera Ready! Use 'http://");
  Serial.print(WiFi.localIP());
  Serial.println("' to connect");
}

void loop()
{
  getPixels();
}

void getPixels()
{
  // disable white balance and white balance gain
  sensor_t *sensor = esp_camera_sensor_get();
  sensor->set_whitebal(sensor, 0); // 0 = disable , 1 = enable
  sensor->set_awb_gain(sensor, 0); // 0 = disable , 1 = enable

  camera_fb_t *fb = NULL;

  // Take Picture with Camera
  fb = esp_camera_fb_get();

  if (!fb)
  {
    Serial.println("Camera capture failed");
    return;
  }

  for (int i = 0; i < fb->len; i++)
  {
    Serial.print(fb->buf[i]);
    Serial.print(",");
  }

  Serial.println(F("\n\n---------------------\nPREPARE TO CAPTURE TO FILE\n"));
  delay(600);

  esp_camera_fb_return(fb);
}

The pixels are in the 'fb->buf' array. What problem are you having?

if you can go higher than 50x50, then look at the existing frame size formats, you possibly won't have to down sample yourself (FRAMESIZE_96X96 will be 96 x 96 pixels)

First of all I get a lot of numbers ... 57600 numbers to be exact. When using settings like this:

  config.frame_size = FRAMESIZE_CIF;
  config.pixel_format = PIXFORMAT_GRAYSCALE;

Second is that Im not sure how to read it. Ideal would be to get it in Decimal Code RGB values or in this case grayscale values. But that is indeed not the case. (but I eventually need it in color rather then grayscale though).

I cannot see any direct difference in the output if I hold my hand over the camera lens and pointing it straight into a lamp. Ideal that would return the grayscale color of 0 or something very bright.

So how shall I read it? I actually want to read it on every frame to be able to analyse the image. I basically are going to use the image to trigger ledstripes.

Yes perfect in my case would be to downsample the image all the way down to something like 15 x 15 pixels. Not sure how to do it though.

Actually, the buffer size for those settings is 118400 bytes.

Take a look in 'sensor.h' for the framesize_t enum:

typedef enum {
    FRAMESIZE_96X96,    // 96x96
    FRAMESIZE_QQVGA,    // 160x120
    FRAMESIZE_QCIF,     // 176x144
    FRAMESIZE_HQVGA,    // 240x176
    FRAMESIZE_240X240,  // 240x240
    FRAMESIZE_QVGA,     // 320x240
    FRAMESIZE_CIF,      // 400x296
    FRAMESIZE_HVGA,     // 480x320
    FRAMESIZE_VGA,      // 640x480
    FRAMESIZE_SVGA,     // 800x600
    FRAMESIZE_XGA,      // 1024x768
    FRAMESIZE_HD,       // 1280x720
    FRAMESIZE_SXGA,     // 1280x1024
    FRAMESIZE_UXGA,     // 1600x1200
    // 3MP Sensors
    FRAMESIZE_FHD,      // 1920x1080
    FRAMESIZE_P_HD,     //  720x1280
    FRAMESIZE_P_3MP,    //  864x1536
    FRAMESIZE_QXGA,     // 2048x1536
    // 5MP Sensors
    FRAMESIZE_QHD,      // 2560x1440
    FRAMESIZE_WQXGA,    // 2560x1600
    FRAMESIZE_P_FHD,    // 1080x1920
    FRAMESIZE_QSXGA,    // 2560x1920
    FRAMESIZE_INVALID
} framesize_t;

So, 'FRAMESIZE_CIF' is 400x296 pixels.

Next, find the pixformat_t enum in the same file:

typedef enum {
    PIXFORMAT_RGB565,    // 2BPP/RGB565
    PIXFORMAT_YUV422,    // 2BPP/YUV422
    PIXFORMAT_YUV420,    // 1.5BPP/YUV420
    PIXFORMAT_GRAYSCALE, // 1BPP/GRAYSCALE
    PIXFORMAT_JPEG,      // JPEG/COMPRESSED
    PIXFORMAT_RGB888,    // 3BPP/RGB888
    PIXFORMAT_RAW,       // RAW
    PIXFORMAT_RGB444,    // 3BP2P/RGB444
    PIXFORMAT_RGB555,    // 3BP2P/RGB555
} pixformat_t;

So, 'PIXFORMAT_GRAYSCALE' is 1 byte per pixel gray scale.

Once a picture is taken, you can get the size info from the camera_fb_t struct pointed to by your 'fb' pointer variable. See esp_camera.h for the declaration of that struct:

typedef struct {
    uint8_t * buf;              /*!< Pointer to the pixel data */
    size_t len;                 /*!< Length of the buffer in bytes */
    size_t width;               /*!< Width of the buffer in pixels */
    size_t height;              /*!< Height of the buffer in pixels */
    pixformat_t format;         /*!< Format of the pixel data */
    struct timeval timestamp;   /*!< Timestamp since boot of the first DMA buffer of the frame */
} camera_fb_t;

So, with the settings you used, fb->buf will point to a buffer of 118400 bytes each of which specifies the gray scale of a single pixel (400 x 296 = 118400).

There are various ways of downsampling an image - some are more picture aware than others.

Say you have a picture of 300x300,

One very crude algorithm is just to throw away data ➜ read every 20th pixel horizontally and vertically. That’s quick and would do if there are not lots of changes happening in your original picture.

Another option would be to read a 20x20 square and do some math over those pixels to extract the dominant color of the samples window - for example just taking the average of the 400 components. Again that would be somewhat OK if there are no huge variations in the samples.

There are tons of math techniques being applied - it’s quite a field of study especially for upsampling (here is an article about this) and you can find tons more on line and also code implementation for the various techniques like averaging, maximum, or minimum pooling which are often used. These methods involve grouping several pixels together and calculating a single value to represent that group in the downsampled image.

The choice of the "best" downsampling algorithm depends on your specific requirements and the trade-offs you are willing to make between computational complexity and image quality.

Thanks for replys! Thanks for these hints for downsampling. But I am still a bit confused about the result. I cannot see that the result vary at all when I am for example holding my hand over the lense.

What, exactly, are you looking at?

You print out the captured grey scale values for each pixel in each frame, so what are those values?

It is useful to collect and print a histogram for a frame. This code does so, and also shows you how to calculate the (x,y) position of each pixel (not used in this code):

  // for each pixel in image
long  npix = 0;
unsigned long histogram[256] = {0};

  for (size_t i = 0; i < frame->len; i++) {

    x = i % WIDTH;                   // x position in image
    y = floor(i / WIDTH);            // y position in image
    unsigned int pixel = frame->buf[i];                     // pixel value
    histogram[pixel]++;
    // show data
    //  Serial.print((unsigned int)pixel);
    //  Serial.print("\n");

    npix++;
  }
  Serial.print("***** ");  //separator
  Serial.print(npix);
  Serial.print(" data lines\n");
  for (int i = 0; i < 256; i++) {
    Serial.print(i);
    Serial.print("\t");
    Serial.println(histogram[i]);
  }

These are the result from the camera looking straight into a white, bright part of a screen. The length is 96*96=9216

---------------------
PREPARE TO CAPTURE TO FILE

77,76,76,78,81,81,82,78,85,86,86,87,88,90,90,93,94,94,93,93,95,94,100,94,99,98,99,99,103,104,103,106,101,107,106,105,106,107,104,107,109,110,108,110,108,109,110,114,111,112,114,112,113,108,112,114,110,110,110,110,110,104,101,100,97,94,100,100,99,96,99,103,104,103,97,95,86,78,69,65,55,49,42,49,58,74,83,97,87,65,48,25,18,16,17,18,78,85,86,86,88,90,91,92,93,94,98,98,100,103,104,104,107,109,111,111,114,116,117,119,122,123,123,126,128,129,130,132,132,133,135,135,136,136,137,139,140,140,141,141,142,145,142,142,145,147,147,147,147,147,147,146,147,147,146,145,143,141,140,137,135,137,139,142,142,140,139,139,138,132,124,112,99,88,75,70,60,57,57,64,82,111,127,133,127,105,67,36,20,18,17,17,82,84,84,85,88,89,92,94,94,96,98,100,104,102,105,105,109,111,112,115,116,118,120,121,124,125,126,129,129,130,133,135,136,137,138,139,139,140,142,142,143,143,145,146,146,148,140,120,149,149,151,150,150,151,150,149,152,151,151,148,146,145,146,144,145,146,147,150,150,146,144,141,131,122,106,89,78,73,66,63,63,64,68,76,90,114,132,143,138,126,91,52,26,18,17,17,92,94,97,97,98,102,104,105,109,109,112,112,114,115,117,120,121,125,125,126,127,130,131,132,137,138,138,140,143,144,145,146,149,150,150,151,153,155,155,155,157,156,158,158,159,161,162,174,163,162,163,162,163,163,163,164,164,164,163,161,160,159,160,161,160,161,161,159,156,150,139,128,112,101,87,73,67,65,69,70,78,87,98,103,112,128,142,150,152,142,114,72,28,21,19,18,99,102,104,106,107,109,111,113,116,116,119,119,121,123,123,126,127,129,131,131,133,135,136,138,140,144,144,145,147,149,151,152,152,155,156,156,157,159,159,160,160,160,160,162,164,164,165,165,167,166,166,166,167,166,166,166,167,167,167,164,164,163,165,165,163,163,158,152,143,131,115,100,81,75,69,66,65,66,70,80,92,107,117,120,125,133,144,150,153,148,127,86,44,24,18,18,101,102,106,107,109,111,112,114,116,118,120,119,122,123,124,125,127,129,131,132,134,135,137,139,141,142,143,145,147,149,150,152,154,153,156,155,156,157,158,159,160,160,161,161,163,163,164,163,163,163,164,164,164,164,165,165,164,165,163,163,162,161,161,158,154,146,137,124,107,91,81,70,64,63,64,63,67,69,75,88,102,116,124,127,127,131,137,143,146,143,129,93,55,26,16,17,93,95,98,100,101,102,102,102,107,105,107,108,110,111,114,115,116,119,120,122,124,126,126,128,131,133,134,136,137,138,139,141,142,145,144,145,146,147,148,149,151,151,152,151,153,152,153,153,154,154,153,154,154,154,154,154,155,154,155,154,153,150,144,137,126,112,101,84,70,65,61,61,56,55,56,63,72,77,85,99,109,118,122,123,122,125,129,132,138,136,127,101,58,30,18,16,87,88,90,92,94,96,95,97,102,101,101,103,106,108,110,111,112,116,118,120,120,124,124,126,128,131,132,133,135,135,136,137,140,142,141,143,144,144,146,148,148,149,149,149,151,151,150,152,152,152,152,152,154,153,153,154,154,154,154,154,152,145,134,120,103,89,77,68,60,59,58,58,58,58,62,72,90,100,108,114,120,126,125,126,125,126,129,133,137,140,135,117,74,42,22,16,90,90,92,97,98,100,102,103,101,107,111,110,112,114,115,117,119,122,124,126,128,129,131,134,136,139,140,143,143,144,144,145,148,150,151,151,153,154,155,155,158,158,158,159,159,160,161,162,163,162,163,165,165,165,164,165,164,165,166,166,161,153,138,117,101,92,82,75,68,66,63,65,72,76,84,100,114,123,129,129,131,133,135,137,138,137,137,143,149,152,149,138,110,61,28,18,103,106,109,111,112,115,116,117,118,119,121,123,125,126,128,130,132,134,135,138,140,141,143,145,147,149,151,153,154,155,156,157,159,159,161,162,163,164,165,166,166,167,169,169,169,169,171,172,172,172,173,173,173,173,174,173,173,174,173,174,169,159,143,126,116,105,92,80,71,69,72,77,88,97,106,115,123,130,132,131,132,135,138,142,141,141,142,146,152,155,155,146,124,79,36,21,108,108,113,114,114,116,117,119,120,121,123,124,128,130,131,132,134,136,137,140,142,143,146,147,148,152,153,155,156,157,158,158,161,163,164,165,165,166,166,168,168,169,172,172,172,173,173,174,174,174,175,175,175,175,175,176,176,176,176,177,172,162,150,136,128,115,99,86,78,79,86,96,111,118,121,123,124,124,123,122,123,127,133,137,140,141,140,145,149,152,154,150,131,96,47,24,106,107,109,112,112,113,116,116,119,120,122,121,123,125,126,129,132,132,134,136,138,140,142,143,146,147,148,150,150,154,156,155,156,157,157,159,159,160,161,163,161,163,163,163,163,164,166,166,165,165,167,167,167,167,167,168,167,167,166,166,165,157,147,132,121,108,95,83,79,83,94,108,119,123,121,116,112,111,108,107,109,111,113,117,124,127,128,131,136,140,143,142,130,98,54,26,93,96,98,98,100,99,102,104,108,106,109,112,114,116,117,120,122,123,124,127,128,130,132,134,135,136,138,140,141,144,146,148,149,148,149,152,152,152,154,154,154,156,156,157,156,158,158,158,160,160,159,159,160,160,159,160,160,159,159,159,159,153,143,129,112,96,90,84,89,102,113,122,126,123,119,112,107,105,104,103,104,102,106,110,114,117,121,125,130,135,138,138,130,110,64,33,92,92,94,96,96,100,101,102,104,105,108,111,113,113,116,118,120,123,125,126,128,129,129,133,135,138,139,140,142,144,145,147,148,149,150,152,152,153,153,155,155,156,157,158,159,158,160,160,159,160,161,161,161,162,161,161,163,163,162,163,163,160,150,135,110,92,91,97,110,124,128,134,131,126,118,113,110,110,108,108,107,107,108,110,113,117,121,127,133,137,144,143,139,124,83,49,100,106,104,105,109,109,111,113,114,116,120,121,123,125,128,129,131,135,136,137,140,142,145,146,148,151,151,154,155,156,156,158,160,162,163,165,165,165,166,167,169,170,170,172,172,172,173,176,173,175,175,175,176,176,177,176,176,177,176,177,177,174,167,150,126,106,108,127,142,148,151,150,141,134,128,125,124,124,122,121,121,120,118,119,120,123,130,137,146,151,154,157,153,142,115,68,113,113,115,115,118,118,120,121,124,124,127,128,130,133,134,137,139,141,141,143,146,148,150,152,154,156,158,158,162,162,163,165,164,166,167,169,169,171,171,172,174,174,175,176,177,177,178,180,179,181,181,182,181,182,181,181,182,182,181,181,180,180,175,158,133,115,123,141,151,155,154,149,140,133,129,127,127,126,125,124,123,123,121,121,122,126,135,144,151,155,156,157,156,147,128,87,113,114,115,117,117,120,121,122,124,126,128,129,131,133,136,138,141,142,144,147,149,150,150,151,155,156,158,159,162,163,164,165,166,167,167,169,170,172,173,173,175,174,176,176,176,178,180,178,178,180,180,179,180,180,180,180,180,180,179,178,179,178,174,161,146,132,134,146,152,155,150,145,134,127,126,125,124,124,121,121,120,120,122,126,130,134,140,146,148,150,150,150,150,146,131,95,104,104,106,110,110,110,111,114,115,115,118,120,124,125,127,129,131,133,135,138,139,141,143,144,145,147,149,150,151,152,153,153,156,156,157,159,159,159,161,163,163,164,164,163,165,167,167,167,166,168,167,167,167,166,168,168,167,166,167,167,167,166,164,155,145,135,134,141,143,144,140,133,123,118,116,116,115,114,113,115,117,120,124,128,132,135,137,137,135,135,134,135,139,138,127,101,95,97,97,100,101,104,105,106,108,110,112,115,117,119,121,125,126,128,130,133,134,137,139,139,142,142,144,147,147,148,149,150,152,152,153,155,155,155,156,158,159,160,160,160,161,162,162,162,164,163,164,165,165,165,164,164,165,164,164,164,163,162,161,158,152,146,143,143,143,142,139,132,121,117,117,116,115,117,120,123,128,133,136,137,138,137,132,127,118,116,123,128,135,138,131,114,98,99,100,103,103,107,109,110,114,116,115,118,122,123,124,127,129,132,134,137,138,142,143,144,147,149,149,150,152,152,154,155,158,158,161,160,160,162,165,165,166,167,168,169,168,169,170,171,172,172,173,173,174,176,174,173,175,174,175,175,174,173,172,172,168,163,156,156,156,154,148,141,131,128,127,132,135,140,145,148,152,152,151,147,142,135,124,112,100,100,112,128,142,148,146,131,110,113,115,117,117,119,123,124,124,127,129,131,134,135,139,141,143,145,147,150,151,153,155,157,158,161,162,163,164,166,167,168,170,172,172,174,175,176,177,178,180,181,181,181,182,183,184,184,186,185,186,186,187,187,187,186,186,186,186,187,186,185,185,184,180,174,168,165,163,163,157,151,145,145,148,151,155,158,161,161,160,154,148,139,128,113,97,88,83,79,97,121,141,152,154,143,115,116,118,119,121,122,126,127,127,130,133,133,137,140,141,143,146,149,151,153,154,156,158,159,160,162,165,166,167,168,169,171,173,174,175,176,177,179,179,180,182,183,184,184,185,185,186,187,188,189,189,189,189,188,189,189,188,189,189,189,187,187,187,186,182,177,170,167,164,164,162,159,156,157,161,163,163,164,160,155,145,134,122,111,97,84,81,75,74,74,91,115,135,149,154,148,117,117,118,120,122,123,125,127,129,130,131,134,136,140,141,142,146,147,148,150,152,153,154,157,159,161,162,162,164,164,167,168,167,169,171,173,173,175,175,176,176,176,177,178,179,180,180,180,179,182,183,182,182,181,182,180,181,181,180,178,178,177,177,178,175,170,165,160,160,160,159,159,158,159,157,154,149,142,131,118,104,84,75,69,65,66,66,65,68,73,83,103,122,135,143,141,105,100,104,109,110,111,113,115,118,119,122,123,126,127,130,132,135,136,136,139,141,142,145,147,149,150,151,152,153,155,155,157,158,158,159,162,161,163,163,164,166,165,166,166,167,168,169,169,170,170,170,170,171,171,171,169,171,171,170,170,169,168,168,168,166,164,160,157,156,157,157,156,153,148,139,136,121,104,86,70,66,63,60,59,59,61,64,67,77,84,89,102,115,126,135,136,99,98,101,106,107,108,110,113,115,116,119,120,124,125,128,129,132,134,133,138,140,141,143,145,146,147,148,150,151,152,153,154,156,157,158,159,160,160,162,162,163,164,165,166,166,166,168,168,168,169,169,170,171,170,170,169,172,171,170,171,170,169,169,166,168,168,164,162,161,159,156,150,141,132,117,103,86,74,66,61,58,63,61,63,62,65,74,86,100,108,109,109,116,124,135,140,107,110,109,113,115,116,117,121,123,125,126,130,131,135,137,139,141,144,146,148,149,151,153,154,156,158,159,161,162,164,165,166,168,170,171,172,172,175,176,175,178,178,179,180,182,181,183,183,184,184,185,185,185,185,185,185,186,186,186,185,185,185,184,184,184,183,181,175,168,159,149,142,123,111,91,81,75,74,74,75,75,75,76,76,82,93,109,122,133,136,133,125,126,132,143,150,118,119,120,122,123,125,127,130,131,134,137,139,141,144,145,147,149,153,154,156,157,159,160,163,164,165,167,169,171,172,173,175,176,178,179,180,180,183,183,183,184,185,186,187,188,188,189,190,191,190,191,192,192,192,192,192,191,192,192,191,190,190,190,189,190,189,184,172,157,140,122,105,85,79,76,74,74,81,82,83,83,85,87,95,101,113,128,138,145,145,139,130,129,133,143,151,120,120,122,125,125,126,129,131,133,135,138,139,142,145,148,150,152,154,155,157,159,161,161,165,165,167,168,169,171,173,175,175,177,177,179,181,182,183,184,185,186,187,187,188,188,189,190,190,190,191,191,191,193,192,192,192,191,191,190,190,190,189,189,188,190,187,181,164,141,102,80,77,75,72,74,74,78,82,84,90,96,105,111,118,124,130,136,142,144,143,139,131,126,127,136,146,113,115,117,118,120,121,124,126,129,130,130,133,136,137,139,142,145,147,149,149,151,153,154,155,157,158,159,159,160,162,163,164,166,166,168,169,168,169,169,172,173,175,176,175,174,175,176,177,176,177,179,178,177,179,178,178,177,178,176,178,176,176,176,175,173,174,167,151,123,73,65,64,65,62,60,64,69,74,79,92,106,115,120,125,129,129,132,133,133,131,128,123,115,116,123,132,104,106,106,108,109,112,114,116,119,121,124,126,128,130,132,135,137,140,141,142,143,145,147,148,151,151,151,153,155,155,157,159,161,160,161,162,163,164,164,167,168,168,167,169,171,171,170,171,172,172,173,174,172,174,173,173,173,173,171,172,172,172,170,170,171,168,165,152,131,85,66,62,61,61,63,67,70,73,85,109,121,129,133,135,135,135,133,133,131,130,129,123,116,117,121,128,106,106,107,110,113,116,117,119,122,123,126,127,131,133,135,138,141,143,145,146,146,148,150,151,152,155,154,157,159,159,161,162,164,165,165,167,167,170,170,169,172,173,174,175,175,176,178,178,178,178,179,180,180,181,180,179,179,179,178,179,179,179,179,178,178,179,176,164,144,107,73,69,66,73,76,78,81,81,99,124,138,146,147,147,146,142,143,143,141,139,137,135,129,129,132,139,116,118,121,123,126,127,130,130,135,137,138,141,144,146,148,150,153,155,156,158,160,162,162,164,164,166,169,170,171,172,173,174,177,178,179,181,183,184,185,186,187,190,190,190,191,191,193,193,194,193,194,195,195,195,195,194,194,194,194,193,194,194,193,192,192,190,189,180,161,132,88,82,85,92,101,106,104,111,123,140,151,155,156,156,154,154,153,153,150,149,146,146,142,140,143,147,123,125,127,129,131,131,134,135,138,142,142,146,148,151,153,154,157,159,160,162,163,165,166,167,168,170,172,175,175,177,177,179,180,182,183,184,186,188,189,190,191,192,192,194,195,195,195,195,197,198,197,198,198,198,198,197,197,198,197,198,197,197,195,196,194,193,191,187,168,147,106,92,97,110,125,132,132,130,137,148,154,157,157,156,154,154,154,153,151,149,149,146,145,143,144,147,122,125,126,128,129,132,134,135,138,139,142,145,148,149,151,153,155,157,158,160,161,163,164,165,167,169,170,171,172,174,175,176,178,179,181,181,183,185,185,187,188,188,187,189,190,191,191,191,191,191,191,191,192,191,193,192,193,191,191,191,189,189,188,186,188,186,186,183,170,151,119,104,112,126,136,141,142,140,140,145,147,146,147,145,144,144,143,144,142,140,140,138,136,134,135,136,109,113,115,118,120,122,123,125,129,129,130,134,136,138,140,142,145,146,148,150,151,152,154,154,157,156,158,158,160,162,164,164,165,167,168,169,170,171,171,173,173,176,175,176,177,177,177,177,178,178,178,178,178,179,178,179,177,177,178,178,177,177,176,174,175,174,173,171,164,150,134,122,125,132,140,142,141,137,137,136,136,134,133,131,131,131,133,134,133,131,131,129,128,126,125,128,105,107,110,113,114,118,120,121,124,126,128,132,133,135,137,138,142,142,144,146,148,148,150,151,152,154,155,155,158,160,160,160,162,163,164,165,166,168,168,169,170,171,172,172,173,174,174,174,175,174,175,175,175,175,175,176,175,175,176,175,175,175,174,174,172,172,171,171,167,159,146,138,139,144,146,143,140,136,134,132,131,129,127,125,126,127,129,131,132,133,132,132,129,127,130,131,110,113,115,118,121,123,124,128,131,134,135,138,139,142,144,146,148,149,150,154,156,156,157,159,162,161,164,166,166,168,170,170,173,175,177,176,177,179,180,180,184,184,184,186,186,187,187,187,187,189,189,190,189,190,189,190,189,190,190,190,188,189,188,188,187,187,187,186,183,179,170,165,161,160,158,152,146,143,139,139,137,133,132,130,130,132,136,139,143,147,149,148,147,147,148,148,123,124,126,128,130,131,135,138,141,144,147,147,149,152,153,155,157,158,160,161,164,165,166,168,170,171,173,175,176,177,178,180,181,184,185,185,187,188,189,190,191,192,193,194,194,195,195,196,195,197,197,198,199,198,197,197,197,197,197,196,195,195,195,194,193,193,192,191,190,187,180,174,168,165,159,154,147,143,141,139,137,134,134,133,132,133,138,142,148,152,155,154,155,155,154,154,126,128,128,131,132,134,137,139,142,145,147,149,152,153,155,157,159,160,161,164,166,167,169,170,173,173,175,177,177,179,179,182,183,187,186,187,188,190,191,192,194,194,196,196,195,196,198,198,198,198,199,199,200,200,200,201,199,199,199,198,198,197,197,196,195,195,192,193,192,190,184,176,168,162,156,148,143,143,140,139,137,135,135,134,135,137,142,148,153,156,158,159,158,158,157,156,121,124,126,125,128,131,133,136,137,140,141,144,147,149,150,152,154,155,156,159,159,160,160,162,166,167,167,169,168,171,171,173,173,173,176,176,176,177,179,179,181,180,184,182,184,184,186,185,184,184,184,183,185,185,185,185,183,183,182,183,181,181,181,181,180,179,178,178,176,175,172,164,154,146,138,134,130,130,129,128,126,129,131,134,136,140,142,145,149,150,149,149,148,147,146,145,112,114,115,116,119,121,124,126,128,129,132,133,135,138,139,141,144,146,147,148,150,151,153,154,155,156,159,159,160,161,163,164,164,165,167,168,169,170,171,173,173,174,174,174,175,175,176,177,177,177,177,178,178,176,177,178,178,177,176,176,175,176,176,176,174,173,171,170,171,170,167,160,149,138,133,127,127,127,129,131,133,136,139,141,145,147,148,149,150,148,148,146,144,141,139,139,110,114,114,117,119,123,125,126,129,129,133,135,136,140,141,142,144,146,147,149,150,152,154,156,156,156,159,160,162,163,164,166,166,167,170,172,171,172,172,174,174,176,176,178,179,179,179,181,182,181,183,182,183,181,181,181,181,180,180,180,180,180,180,180,181,177,176,176,176,175,171,164,153,141,136,136,136,141,145,147,151,153,155,158,157,158,158,157,158,156,154,152,148,145,143,141,122,125,125,128,130,133,134,137,140,143,146,146,148,151,153,154,156,158,160,161,164,166,165,167,169,171,173,175,175,176,178,180,182,182,184,186,188,188,189,189,190,192,193,195,196,196,197,197,198,198,198,198,199,199,200,199,200,198,198,198,197,195,196,195,195,193,192,192,192,191,188,181,171,162,159,161,163,166,169,170,172,173,174,174,173,172,171,170,168,167,165,161,156,152,152,151,128,130,133,134,137,139,140,144,145,149,151,152,154,156,157,159,162,163,164,167,169,170,172,173,174,177,179,179,181,182,184,185,187,187,188,191,191,193,193,195,195,197,198,198,198,200,201,201,201,203,202,203,203,202,202,204,203,202,201,201,201,200,199,199,197,196,195,194,195,193,192,187,180,173,172,174,176,178,180,179,180,178,178,177,175,174,173,172,170,169,166,161,157,153,152,153,129,131,133,135,137,138,141,144,146,148,152,153,155,155,158,160,161,163,165,166,167,169,170,172,174,175,177,179,181,181,182,183,185,186,188,190,189,191,192,193,193,194,195,195,197,196,198,198,198,199,199,199,200,198,199,200,199,199,197,196,196,196,195,194,192,192,191,190,189,187,187,185,180,177,176,176,177,177,177,177,174,175,173,170,170,169,167,166,163,161,159,156,152,150,149,148,116,120,122,124,124,127,131,131,135,136,140,143,144,145,147,149,149,151,153,153,155,156,158,159,162,161,163,164,166,168,168,170,171,173,172,173,174,175,174,177,179,179,180,179,180,181,182,181,182,184,183,184,184,182,182,182,182,182,181,180,179,180,179,177,178,177,177,174,174,173,172,172,168,163,160,160,163,164,164,164,163,161,159,158,158,156,155,154,151,150,148,146,144,142,140,140,112,113,117,119,121,123,125,128,131,132,135,137,137,138,142,144,146,147,150,150,151,153,153,154,156,158,158,159,161,163,164,165,166,167,168,169,170,171,171,172,174,174,175,175,176,175,177,178,177,178,178,179,178,178,178,177,178,177,177,177,176,176,174,175,174,172,173,172,171,170,169,168,163,156,150,151,158,161,161,161,161,159,158,157,156,155,153,152,150,148,146,145,143,143,141,140,116,118,121,123,125,129,130,133,135,138,139,141,143,145,146,149,152,153,153,154,156,158,158,159,163,164,165,167,167,169,171,171,174,175,176,177,178,179,180,181,183,184,185,186,187,186,187,187,189,189,189,188,188,191,191,190,190,189,190,189,189,187,187,186,187,185,185,184,184,182,180,181,174,162,152,151,165,172,173,173,171,170,170,169,167,166,165,164,161,159,157,155,154,155,153,151,126,130,131,133,136,137,140,144,146,147,150,152,153,155,157,158,161,162,163,165,167,169,170,170,173,175,176,178,179,180,182,183,185,186,187,188,190,191,191,193,194,195,196,197,197,197,198,198,200,200,200,201,201,200,200,200,199,199,199,199,199,198,197,197,195,193,193,193,192,191,190,189,182,166,153,151,168,179,181,177,175,176,177,175,173,171,170,169,166,164,162,161,159,160,158,156,129,132,134,135,138,141,142,146,148,149,153,154,157,158,159,160,163,164,165,167,169,171,170,172,175,177,178,180,181,182,185,186,186,189,189,190,192,193,193,194,196,197,199,199,199,199,201,200,202,202,202,202,202,202,203,201,201,201,201,200,199,199,197,197,195,195,194,193,191,192,190,190,184,169,154,149,160,175,178,174,171,173,176,174,170,169,170,170,167,164,163,161,160,160,158,154,126,129,132,134,135,138,139,142,144,145,148,151,153,154,155,157,159,160,161,162,164,165,167,168,170,171,172,174,174,173,177,179,179,181,182,183,181,184,185,186,187,186,186,188,189,188,188,188,189,190,190,191,190,191,190,190,188,189,186,186,185,184,184,182,181,181,180,179,177,177,176,175,171,164,147,137,143,160,163,158,157,159,160,159,156,153,157,157,156,154,151,149,149,148,146,142,115,118,120,123,125,127,130,132,134,136,138,139,142,144,144,145,149,151,151,153,153,155,157,158,158,160,161,163,162,164,166,165,168,168,170,171,171,172,173,175,175,175,177,177,178,178,178,179,180,180,180,181,182,180,180,179,179,180,179,177,177,177,176,176,174,173,172,172,170,169,168,168,167,160,143,132,133,149,156,152,149,151,154,152,148,148,150,150,149,147,144,142,142,141,139,137,115,118,119,122,123,126,128,130,131,134,137,139,141,141,144,144,148,149,150,151,152,154,156,156,158,159,160,162,162,163,163,165,166,168,170,171,171,172,173,174,175,176,177,176,178,179,179,180,180,180,181,181,181,180,181,182,179,178,179,178,176,176,175,175,176,175,176,175,171,171,171,171,168,166,150,135,132,145,157,155,152,152,155,155,150,149,152,153,151,148,147,143,141,142,141,140,125,127,128,132,133,134,137,139,143,144,147,148,152,152,155,155,157,159,161,163,164,165,166,167,169,171,172,175,177,178,179,179,181,184,184,185,186,188,188,190,190,190,192,192,195,195,194,195,196,196,196,197,197,196,198,197,197,196,196,195,195,193,193,194,192,190,190,189,188,187,186,186,184,182,168,152,145,153,168,171,166,164,166,166,163,162,163,165,164,161,158,154,153,154,154,153,131,133,136,138,141,143,145,147,150,151,153,155,158,158,159,160,163,165,167,168,169,172,172,172,175,177,177,180,182,183,184,186,187,188,190,191,192,193,194,193,194,195,197,199,198,198,201,200,200,201,201,202,201,200,201,200,199,200,199,199,198,197,196,196,196,194,193,192,191,190,190,189,187,185,176,158,147,151,167,173,169,166,166,169,166,163,164,165,165,161,159,157,155,154,154,154,133,133,136,138,141,142,146,147,150,152,154,155,158,159,161,163,164,165,166,168,169,172,171,173,174,176,177,179,181,182,183,186,187,187,189,190,191,191,193,194,194,194,196,197,198,198,198,198,198,198,200,200,200,199,198,198,197,197,196,196,195,194,194,193,191,190,189,189,190,187,186,184,183,180,176,162,146,144,157,167,166,163,161,166,163,159,158,160,158,157,155,154,153,151,151,149,124,126,128,128,131,134,136,137,140,142,145,144,147,148,150,152,153,155,157,158,158,159,159,161,162,165,166,165,167,168,169,171,171,173,175,175,174,175,175,177,180,181,182,179,180,182,182,182,182,182,182,182,182,182,182,182,181,180,181,180,179,179,177,176,176,175,174,173,173,172,169,169,167,166,164,154,137,131,139,153,153,149,149,151,151,148,146,147,146,146,143,141,140,138,138,136,116,118,120,123,124,127,129,130,132,134,136,137,140,141,143,144,146,148,149,151,152,152,153,155,157,158,160,161,162,162,163,164,165,167,168,168,169,169,170,171,172,174,174,174,175,175,175,176,176,177,177,177,178,176,176,177,174,175,174,174,173,172,172,171,170,169,169,167,167,166,165,165,164,162,160,154,137,129,131,147,150,147,146,147,148,146,144,145,143,141,138,138,136,135,135,133,118,119,122,125,127,128,129,134,135,137,138,140,143,144,146,148,149,152,152,154,156,156,156,157,159,162,162,163,165,165,167,168,170,170,171,172,174,174,176,176,177,177,179,180,180,181,181,181,182,182,181,182,183,183,183,183,182,183,181,182,181,180,179,180,177,177,178,176,176,175,173,172,173,171,170,166,151,137,135,149,159,159,157,158,157,155,152,154,153,151,148,146,146,146,146,145,129,131,133,136,139,139,142,144,147,148,150,151,153,153,155,157,159,160,161,164,165,167,167,169,172,172,175,176,178,178,180,181,182,184,185,186,187,188,188,189,191,190,192,192,193,193,193,194,195,195,194,194,195,196,195,194,194,193,193,194,193,192,190,189,188,188,189,187,186,185,185,183,182,180,180,176,163,146,140,151,167,169,168,168,166,164,162,162,161,160,157,154,155,154,153,152,132,135,135,139,140,142,146,147,147,149,153,153,155,157,158,161,162,162,164,166,167,168,169,171,174,174,176,177,179,181,182,182,184,185,187,187,189,189,190,191,192,193,193,194,194,195,195,195,196,197,196,196,196,196,197,196,195,194,194,195,193,193,191,191,191,190,189,188,188,187,185,183,182,181,180,178,167,150,140,145,162,172,171,169,167,164,163,162,162,160,158,156,156,154,153,153,130,130,132,135,137,138,141,143,145,147,149,151,152,153,155,156,159,159,161,161,163,164,165,166,168,170,170,172,173,175,175,176,178,181,180,181,182,182,184,185,185,185,187,186,188,187,188,188,189,188,188,188,188,187,187,187,186,186,185,185,185,181,181,182,181,181,180,179,176,176,174,173,171,170,169,168,162,147,134,133,146,159,161,159,156,154,153,153,152,150,147,146,145,143,142,143,118,119,120,124,125,126,128,130,134,135,137,139,140,142,144,144,146,149,150,150,152,153,153,154,156,158,159,159,161,163,163,163,165,165,166,168,169,169,169,170,172,170,173,173,172,172,173,173,174,174,174,174,175,174,174,175,173,172,172,171,171,170,170,168,168,167,167,167,167,164,164,164,162,161,160,159,156,144,130,128,138,150,153,150,149,148,146,146,144,142,141,138,138,136,135,135,116,117,119,121,123,124,126,128,130,133,134,134,138,140,141,141,143,146,148,150,149,150,151,152,154,155,157,158,158,159,160,161,163,163,165,166,167,167,168,168,169,168,170,171,171,171,171,172,172,172,172,172,173,171,172,172,171,171,171,171,170,170,169,167,167,166,165,165,164,163,163,162,162,161,160,159,157,149,140,134,143,150,151,150,149,148,147,145,144,142,143,141,139,139,137,135,124,126,127,129,130,132,135,139,141,142,143,145,149,149,150,152,154,156,158,159,160,159,161,164,166,167,168,169,171,171,173,174,175,178,178,179,179,179,181,182,183,183,185,186,187,187,188,188,187,188,188,187,188,189,187,187,186,185,186,186,186,186,184,184,183,182,181,181,179,177,177,177,176,175,173,173,171,169,163,160,161,164,165,163,163,161,160,159,158,158,157,155,153,152,152,150,131,133,135,137,138,141,143,144,148,149,151,153,155,156,158,159,160,162,163,166,166,167,168,170,173,174,174,174,178,179,178,180,182,183,184,184,185,186,187,188,190,189,190,191,192,192,193,192,194,193,193,193,193,193,192,192,192,192,190,191,190,189,188,188,188,186,185,185,183,180,180,179,180,178,177,176,175,174,172,168,165,165,165,167,165,165,164,163,160,159,158,157,155,155,154,152,131,133,136,137,140,142,143,145,149,149,151,153,155,156,158,160,161,162,164,166,167,168,168,171,171,173,175,176,177,177,179,179,180,181,183,184,185,186,186,187,189,190,189,189,191,190,191,192,192,192,191,191,192,192,190,191,191,191,190,189,188,188,187,186,185,184,185,182,180,178,178,177,177,176,174,174,172,171,169,162,157,155,158,162,163,162,162,159,158,157,155,154,153,151,150,148,124,125,126,129,131,134,135,137,138,140,143,144,147,147,148,151,152,153,154,155,156,157,159,159,160,162,161,164,164,166,167,166,168,169,170,170,171,172,171,172,174,173,172,175,176,175,176,176,177,177,176,177,176,176,174,173,176,174,173,173,172,171,172,172,168,170,168,167,166,164,162,161,163,162,160,160,159,158,155,143,133,130,139,149,150,150,148,146,145,144,142,141,139,139,137,136,115,117,117,120,122,124,127,128,130,130,133,135,138,139,139,141,142,144,145,146,147,150,151,151,152,153,154,155,156,158,159,159,159,161,162,162,163,164,164,164,165,166,167,166,168,168,168,168,169,167,168,168,168,169,168,167,167,168,167,166,165,164,165,165,162,162,161,160,160,158,157,158,157,156,154,154,152,151,148,137,123,117,128,141,145,142,141,140,139,138,136,135,135,134,132,130,114,117,119,121,122,124,126,129,130,130,133,134,137,139,139,141,144,146,147,148,149,149,152,154,154,155,157,157,158,159,159,161,161,162,162,165,165,166,166,167,166,167,168,169,169,171,172,171,171,171,171,171,172,172,172,170,170,171,170,170,169,168,168,168,167,166,166,165,164,163,162,162,161,160,159,159,157,157,154,144,128,120,128,145,149,145,144,144,145,144,142,141,140,139,138,138,126,128,129,133,134,133,135,138,141,142,144,145,147,149,150,153,153,156,158,159,159,160,162,164,165,165,167,167,169,170,172,173,174,175,175,176,177,177,177,180,181,182,182,181,182,183,183,183,185,184,184,184,184,184,183,182,183,183,183,182,181,181,180,180,179,177,176,176,175,175,174,173,172,172,170,169,169,166,165,157,140,129,132,149,156,154,150,151,154,152,150,148,148,148,149,147,129,131,132,135,135,137,139,141,144,146,148,148,149,151,153,156,157,159,160,161,162,164,165,166,167,169,170,171,172,174,175,175,176,177,177,179,180,179,179,182,182,182,183,183,183,184,184,186,186,186,186,186,185,186,185,185,185,185,184,184,183,182,182,180,180,179,178,176,177,176,175,174,173,172,171,170,169,167,167,161,146,130,130,143,154,153,149,148,151,151,148,146,146,147,148,147,127,129,129,132,133,134,137,139,142,143,144,146,149,149,151,152,155,156,157,159,160,162,161,162,164,166,167,168,169,170,171,172,171,173,173,174,175,177,177,178,176,178,179,178,178,179,180,180,181,181,180,180,181,180,179,180,178,177,177,176,176,175,174,174,173,173,172,170,168,169,169,165,166,165,162,162,161,160,158,157,145,128,119,129,144,144,141,139,140,141,137,136,136,138,139,139,114,117,117,119,121,122,126,128,129,132,132,133,135,136,138,139,142,143,145,146,145,147,149,150,151,151,152,154,155,156,157,156,158,159,159,160,161,161,162,162,163,164,165,164,165,165,166,166,165,165,165,165,165,164,165,164,163,163,162,162,162,161,160,159,160,159,158,158,157,156,155,154,154,153,152,151,149,149,147,146,137,122,110,114,129,134,131,128,129,130,128,126,126,128,128,127,112,113,115,117,118,119,122,124,126,128,129,130,132,133,135,135,138,137,142,143,143,144,146,148,147,149,150,151,152,153,154,154,156,157,157,157,157,158,158,159,161,160,159,161,162,162,163,163,161,162,162,162,161,162,162,162,161,160,160,160,159,159,159,158,157,157,156,156,155,155,154,153,152,152,150,149,148,147,146,146,140,125,111,109,124,132,130,127,127,129,127,124,124,126,126,126,116,116,122,124,125,126,128,130,133,133,136,138,138,141,143,144,146,147,148,148,150,152,153,153,155,157,158,159,160,160,160,160,163,164,165,166,166,167,169,170,171,171,171,172,172,172,174,172,173,174,173,174,174,173,174,173,174,173,172,172,171,170,170,171,169,169,169,168,167,167,165,165,163,162,161,160,160,159,158,157,153,139,123,117,127,141,144,139,137,140,141,137,135,136,136,135,126,128,130,131,132,135,136,139,141,143,144,145,147,148,152,151,152,154,155,156,157,159,160,161,162,164,166,166,166,167,168,169,170,171,172,173,174,175,176,177,178,178,178,179,178,178,180,180,181,181,180,181,180,180,180,179,179,180,179,179,177,177,177,176,175,175,175,173,172,172,171,170,168,167,167,165,164,163,163,161,158,147,130,121,127,143,148,144,141,142,143,141,138,139,138,138,127,128,130,131,132,135,137,138,141,143,146,147,148,149,152,153,154,154,156,158,158,159,161,163,163,165,168,167,167,169,170,169,170,171,172,172,174,174,176,177,177,176,178,179,179,179,180,179,180,180,181,180,180,178,179,179,178,178,178,177,176,176,176,176,174,173,172,173,171,170,168,168,167,165,165,164,163,162,160,159,158,151,135,120,121,136,145,143,138,138,141,139,135,136,135,136,119,122,124,124,127,129,131,132,134,137,138,138,139,142,143,145,146,146,147,150,151,151,152,154,155,155,155,159,158,157,159,160,160,159,161,163,164,164,164,166,164,167,166,167,167,167,167,167,168,166,167,168,167,167,166,167,165,164,163,164,163,163,163,161,159,159,158,158,157,157,157,156,153,152,152,150,150,149,147,146,144,140,128,112,104,118,131,131,127,126,128,128,125,124,125,125,107,111,111,115,115,118,118,121,121,124,128,128,129,131,131,133,135,136,136,138,140,140,140,143,144,146,147,148,147,148,149,150,151,151,153,152,153,154,155,154,156,157,156,156,157,158,158,158,157,158,157,158,158,157,157,157,157,156,156,155,155,154,154,154,153,151,151,151,149,149,149,148,146,146,145,143,143,143,141,139,137,136,126,110,99,105,123,127,123,123,125,123,119,120,120,119,108,111,111,115,116,116,117,118,122,123,127,127,128,129,130,133,134,136,136,138,139,139,141,142,143,145,146,147,147,147,149,150,150,152,153,153,152,154,155,156,154,157,157,156,157,158,159,158,158,158,158,158,159,158,159,159,157,157,156,156,157,156,155,154,155,154,154,152,152,152,153,150,148,148,146,144,146,145,143,143,141,139,133,119,103,104,121,130,130,130,129,126,125,124,125,122,118,119,121,124,127,126,128,129,132,133,135,136,138,139,139,142,144,146,148,148,150,150,151,152,153,155,156,156,157,158,160,161,161,161,163,164,164,165,166,167,168,168,168,168,168,169,169,169,170,170,169,169,171,169,169,170,169,168,168,169,168,168,166,166,166,164,163,162,162,162,161,160,160,160,158,157,155,155,153,153,152,150,146,132,117,112,125,140,143,142,141,136,135,134,133,134,123,125,127,128,130,131,133,133,136,137,140,141,142,142,144,146,149,149,149,152,153,153,154,155,156,158,159,161,160,161,163,163,164,164,165,166,167,168,167,169,170,170,171,171,171,171,170,171,172,172,172,172,173,171,171,172,171,171,170,170,170,170,167,167,168,166,166,164,163,164,163,161,161,161,158,158,157,155,154,153,152,151,149,139,122,112,121,137,145,144,141,138,137,135,136,135,122,123,125,127,127,129,131,133,135,135,138,140,139,141,143,146,145,147,148,149,151,152,152,153,154,156,157,158,158,159,160,160,162,162,163,163,165,165,164,166,166,165,167,166,168,169,168,168,168,168,168,167,167,168,168,166,167,165,165,166,165,163,163,162,163,162,161,159,158,159,157,157,156,154,153,153,152,151,149,149,147,146,146,137,125,116,118,129,139,137,136,134,133,132,130,130,109,110,111,114,114,115,119,122,122,123,124,125,127,129,130,131,132,134,136,136,137,139,139,139,141,143,144,145,145,147,146,148,149,150,150,150,151,151,151,152,153,153,153,154,154,154,154,154,155,154,153,154,154,154,153,153,152,152,152,152,152,152,150,150,149,148,148,147,146,145,145,145,143,142,140,139,138,137,137,135,134,133,133,129,120,114,111,118,126,124,123,122,118,116,112,108,102,104,104,108,109,111,115,115,116,117,120,121,123,126,126,126,128,130,130,132,133,134,134,135,137,137,139,139,140,142,143,143,144,145,146,147,147,148,148,148,147,148,148,150,149,150,149,150,150,150,151,150,150,150,149,150,149,148,148,148,148,148,147,145,146,144,144,143,142,141,140,140,138,137,138,136,134,133,134,132,131,130,129,127,123,119,117,118,120,119,114,109,101,95,85,76,107,109,111,114,116,116,117,120,122,125,126,125,127,130,129,131,133,134,136,137,138,139,141,142,141,143,144,145,146,146,147,148,149,149,151,151,153,153,154,153,154,154,155,154,155,155,155,155,156,157,157,156,156,156,156,156,156,156,155,155,155,153,154,155,152,153,152,151,151,151,150,148,148,147,146,145,144,144,143,141,142,139,137,137,136,133,128,123,119,113,103,94,78,69,60,52,116,119,118,122,124,126,128,129,130,132,135,134,136,138,138,139,142,142,145,146,146,148,149,150,150,151,153,154,154,155,156,156,157,158,159,160,161,160,161,161,163,162,162,163,162,163,163,163,164,164,165,164,164,164,163,163,164,164,162,163,162,162,163,161,160,159,158,158,157,157,156,154,155,154,152,151,151,151,149,148,146,145,145,143,142,138,129,115,101,88,78,63,48,36,29,26,117,119,120,124,126,126,129,130,130,132,134,134,137,139,140,140,144,143,146,146,147,149,150,151,151,152,153,154,155,155,156,158,159,159,159,160,161,161,160,162,163,163,163,164,163,164,165,163,165,165,165,165,164,163,163,164,163,163,163,163,163,163,162,161,160,159,158,157,156,155,155,155,154,153,152,151,150,150,148,148,147,145,145,143,142,136,121,95,70,63,54,43,29,21,17,17,113,113,116,118,120,120,122,124,126,127,128,128,131,133,136,136,138,138,138,139,141,141,143,144,144,145,146,147,149,148,149,150,150,151,152,152,151,154,154,154,154,154,155,154,155,154,154,155,156,156,154,154,155,155,154,154,154,152,152,152,153,151,149,151,151,148,147,147,147,145,144,142,141,140,138,139,138,139,138,135,135,134,133,133,130,123,106,72,53,49,47,38,26,18,16,15,98,99,100,102,105,108,110,111,115,114,115,116,119,120,120,122,124,126,127,128,128,129,130,131,132,133,134,134,135,135,134,136,138,138,139,139,140,141,140,141,141,141,142,143,143,143,143,143,145,144,143,144,143,143,142,142,141,142,140,139,141,140,139,139,138,138,137,135,134,134,133,133,132,132,131,130,130,129,128,127,126,125,123,124,123,117,100,69,50,46,45,40,29,20,14,13,95,97,99,100,104,105,108,107,112,112,112,114,117,118,120,121,123,123,126,126,127,128,129,129,131,132,132,132,133,135,133,134,135,136,136,137,138,138,138,139,140,140,141,142,141,141,141,142,142,141,142,141,141,142,141,140,139,141,140,140,141,140,139,138,138,137,136,135,135,134,134,132,132,132,131,131,129,129,128,128,126,125,125,125,123,120,105,71,52,48,48,44,33,23,16,14,104,109,108,110,112,114,115,119,119,120,122,124,124,126,129,129,132,132,133,136,136,138,138,139,139,140,141,142,143,144,144,144,146,147,148,148,148,148,149,149,150,149,151,150,150,151,151,152,151,152,153,152,152,152,152,151,151,151,151,151,151,150,149,149,148,148,149,146,146,145,145,144,143,143,142,142,142,139,137,137,136,136,135,134,133,132,123,101,65,53,54,49,40,27,17,14,110,112,113,115,117,120,120,122,124,125,127,129,131,131,133,133,135,137,138,139,139,140,142,142,144,144,145,146,146,147,149,148,150,150,151,151,150,151,152,153,153,152,153,153,153,154,154,154,155,155,156,155,155,155,155,154,154,153,153,153,153,152,150,151,150,150,150,149,148,148,147,146,146,145,144,145,142,143,141,140,138,137,135,135,135,133,127,108,73,57,51,49,41,30,20,15,108,110,112,114,117,119,119,121,124,124,126,127,129,130,132,132,133,134,137,136,138,139,140,141,142,143,143,143,144,146,145,146,148,149,148,149,150,150,150,151,151,150,151,152,151,153,153,151,153,152,152,152,152,152,152,151,151,151,151,150,150,149,148,149,147,147,146,146,145,145,144,143,142,141,141,140,137,138,137,137,135,133,133,132,132,130,126,112,80,57,48,47,41,31,21,16,96,99,100,99,104,105,107,109,111,113,114,115,117,118,120,122,121,125,125,124,127,127,128,129,130,129,131,131,133,133,132,133,133,134,135,135,136,137,137,137,138,137,139,137,138,139,139,138,139,139,140,138,139,139,138,138,138,136,136,138,136,136,136,134,135,133,133,133,132,131,131,130,129,128,128,128,127,126,126,125,123,121,122,120,119,119,116,106,78,53,41,38,37,30,20,15, Length: 9216

and this is when I put my finger over the lense. It should be black then ...

---------------------
PREPARE TO CAPTURE TO FILE

39,36,35,36,36,30,32,43,38,38,40,34,41,35,38,34,34,44,40,36,43,42,43,41,32,38,42,43,39,43,44,47,34,39,49,37,36,41,42,43,37,41,41,40,40,36,40,39,34,36,38,37,40,39,40,35,37,33,36,34,42,39,35,28,39,44,45,39,39,34,39,34,38,33,35,37,34,33,31,34,37,37,32,33,33,33,32,27,27,29,27,27,28,38,30,25,46,49,54,48,45,44,48,51,53,47,53,57,55,54,55,53,54,47,46,50,50,53,54,55,49,50,50,53,55,52,54,52,52,54,55,57,50,55,55,54,55,53,54,52,54,54,53,53,55,55,55,50,53,52,46,51,50,50,49,54,52,52,48,47,52,53,46,47,50,48,49,47,44,45,44,44,47,39,43,44,40,42,42,47,42,42,40,42,41,37,46,41,40,37,34,36,52,54,43,45,55,49,47,51,47,50,54,53,49,53,50,38,51,33,54,52,55,56,54,50,51,54,51,51,47,52,55,53,57,55,55,62,57,52,52,45,54,49,54,54,53,52,46,38,52,52,52,52,54,50,50,50,40,50,52,55,51,55,49,51,49,50,52,48,49,50,49,53,46,47,42,45,47,47,44,45,45,43,41,45,40,41,43,39,42,40,41,41,36,37,39,35,51,47,45,44,48,51,59,50,53,53,54,55,52,50,52,55,58,58,51,51,53,56,55,53,45,56,53,56,57,53,50,53,53,54,38,58,71,56,56,52,56,55,52,55,57,70,58,50,52,54,54,51,55,53,51,51,53,53,52,51,52,53,48,51,50,47,49,49,53,50,50,50,42,47,45,41,44,42,36,46,44,42,45,42,44,43,43,38,43,38,42,38,34,39,40,37,42,49,51,47,47,51,53,54,49,54,52,53,45,54,55,52,63,51,52,60,57,59,54,52,55,56,54,56,56,49,55,55,49,52,47,51,50,54,55,54,56,53,54,53,55,51,55,54,56,56,54,54,55,53,48,51,52,54,56,53,53,45,57,49,47,48,51,49,48,47,47,45,40,43,45,45,47,50,46,43,41,41,44,43,43,44,41,41,38,40,38,40,37,37,41,37,51,48,52,45,49,53,48,51,58,55,61,58,57,59,59,55,53,53,54,54,56,54,54,55,52,54,52,55,58,54,54,61,51,56,50,54,54,58,57,59,59,58,58,56,52,55,54,52,55,48,57,54,56,54,58,48,56,58,53,57,50,52,54,50,45,49,49,47,50,49,46,51,47,49,52,49,53,43,45,44,44,41,44,44,42,45,40,41,38,42,41,41,38,38,38,40,45,48,49,50,50,51,51,45,59,50,50,54,51,55,53,56,58,52,56,54,58,56,50,60,55,53,54,58,59,56,56,56,57,59,57,55,55,61,53,57,55,59,57,55,58,55,57,56,56,57,53,52,51,56,58,56,56,55,55,56,53,51,44,52,56,51,50,49,51,51,50,48,49,49,48,53,47,43,43,45,45,44,42,43,44,41,43,42,37,41,43,41,39,39,45,42,54,48,50,52,51,49,62,51,58,50,57,52,52,57,54,52,53,54,51,57,56,54,55,53,60,58,57,53,56,60,57,54,57,49,58,56,52,56,59,56,58,59,59,59,56,57,55,59,57,57,56,54,52,55,56,53,46,54,53,55,53,51,49,52,52,51,49,51,51,52,52,49,50,50,48,47,46,46,47,43,43,41,44,42,43,44,43,42,40,45,38,40,40,40,41,40,51,48,47,48,50,47,50,59,49,53,55,51,55,56,57,50,54,54,56,55,53,59,56,55,59,54,59,55,55,50,55,55,58,56,53,60,57,54,55,56,56,58,58,58,58,58,55,59,59,58,57,56,57,61,55,54,52,55,54,55,57,55,52,54,55,51,51,49,50,50,51,50,51,51,50,46,47,46,48,31,41,42,43,46,41,43,38,42,45,43,40,40,37,40,42,41,49,53,54,52,50,52,56,56,51,54,57,54,56,55,54,55,55,56,58,58,39,57,56,56,57,57,57,53,54,63,62,59,57,58,61,58,62,55,58,55,58,58,56,59,59,59,59,58,58,61,58,55,56,56,57,58,53,58,55,47,56,56,54,55,55,51,48,53,54,52,49,51,44,49,45,54,46,45,47,45,46,43,46,40,43,46,46,42,42,41,43,42,42,45,43,42,56,50,50,49,52,52,53,53,53,45,56,53,56,56,59,55,51,56,56,56,54,56,56,60,59,58,58,57,58,61,59,59,59,57,58,57,58,57,58,57,60,61,60,60,60,58,60,62,59,57,53,53,58,58,57,57,52,55,60,53,58,57,54,55,51,52,53,52,53,51,51,48,49,56,47,52,51,46,45,44,44,45,44,41,44,43,45,40,43,44,41,41,42,42,42,40,52,53,52,53,54,52,54,56,52,58,51,54,53,57,49,53,55,58,56,58,60,50,58,61,57,56,60,59,59,60,60,61,58,59,46,58,58,60,58,61,63,61,56,58,57,63,62,58,61,64,60,56,58,60,59,55,57,59,51,54,59,54,53,54,55,55,54,53,54,50,47,49,52,48,50,48,48,48,47,49,43,44,46,46,46,44,45,47,44,45,44,43,44,42,39,42,43,39,53,52,50,55,54,53,57,50,58,55,52,56,55,57,55,62,56,56,58,59,56,56,65,62,55,61,61,60,59,60,59,62,59,57,66,62,60,60,48,60,62,61,59,58,65,63,61,62,65,57,54,59,59,60,59,59,61,57,58,55,55,55,51,55,53,52,50,53,53,52,52,50,51,51,48,50,48,47,46,41,44,48,46,45,44,44,42,41,42,40,43,43,40,39,54,56,54,52,49,53,54,53,54,52,50,53,54,52,57,54,52,60,56,59,52,51,58,63,61,58,64,69,60,60,60,65,58,52,61,60,63,60,63,59,63,65,60,60,60,59,61,61,65,60,53,60,57,59,60,62,60,62,60,59,58,56,58,56,57,55,56,55,54,57,50,54,51,49,53,51,49,49,48,48,48,48,48,53,46,44,47,45,44,43,43,43,40,41,42,43,57,52,50,54,57,49,47,53,50,55,48,59,54,57,58,52,33,61,58,57,61,57,58,56,60,61,70,68,62,63,57,57,60,57,58,61,65,66,59,62,63,63,58,62,58,62,62,62,65,61,58,62,58,59,61,61,53,65,57,59,56,57,59,57,55,53,53,59,56,53,52,54,52,54,56,43,53,52,49,46,48,50,45,44,47,48,43,43,45,46,44,43,41,44,38,42,49,52,54,51,56,58,57,56,53,55,54,49,53,56,58,56,55,61,60,62,59,63,59,57,60,62,63,62,61,62,63,63,65,61,61,62,62,63,65,65,61,66,59,64,61,60,58,65,68,64,59,62,63,62,60,59,59,60,55,60,58,66,56,56,55,54,53,58,56,54,53,54,51,50,50,56,53,50,55,50,49,52,45,48,48,45,46,47,58,41,43,42,44,42,41,43,52,51,57,56,55,57,53,54,54,62,60,56,67,60,54,58,59,61,55,62,64,59,59,62,61,61,61,63,60,64,64,61,62,62,62,65,64,60,68,67,65,62,59,60,63,65,63,64,68,62,64,59,68,62,60,63,58,59,56,58,58,59,57,58,61,55,55,59,53,53,56,55,52,54,48,56,54,52,49,47,49,62,51,51,46,43,45,44,46,46,45,44,41,42,42,42,57,45,38,59,50,50,52,55,55,58,60,55,58,64,61,61,58,58,56,61,62,53,60,61,58,64,64,61,62,62,61,61,61,64,65,61,66,63,61,62,89,71,62,62,61,68,63,65,64,75,63,61,61,62,60,60,60,57,57,60,58,60,59,57,58,56,58,57,57,57,58,55,60,52,53,53,54,50,49,41,50,51,49,45,48,40,43,46,46,45,46,45,41,45,41,41,55,47,57,54,55,54,53,58,55,53,60,57,60,59,58,58,60,60,61,59,62,61,58,60,63,59,64,63,59,64,61,64,63,65,66,66,66,66,62,67,78,75,63,66,67,63,64,67,65,62,66,66,64,64,65,62,58,61,59,58,56,57,58,60,58,59,58,58,58,52,58,58,55,57,51,54,51,51,52,52,48,51,45,49,48,46,47,40,45,46,47,45,41,44,42,37,58,52,54,57,52,56,57,55,56,59,59,61,63,57,61,61,63,63,58,60,67,58,55,62,62,71,61,65,64,64,62,66,62,64,63,66,66,65,65,65,67,67,67,67,68,66,68,62,68,65,64,64,66,67,60,61,69,67,62,62,64,61,62,61,61,63,55,59,59,59,55,57,60,54,54,54,54,53,51,51,49,51,47,51,48,49,45,45,44,45,50,45,45,44,44,43,56,51,61,55,54,56,59,55,55,56,57,56,58,63,58,60,57,60,61,61,61,61,63,65,61,60,70,60,66,65,66,64,66,62,64,66,66,67,66,67,66,69,66,67,66,66,68,65,71,67,64,64,63,65,66,66,60,60,63,62,63,63,63,62,61,60,58,56,58,60,57,58,57,54,57,56,53,54,51,51,47,52,51,51,50,47,48,49,45,43,44,45,41,44,45,44,53,54,59,57,57,59,64,58,57,57,57,57,59,60,64,63,59,61,60,62,65,62,64,64,61,68,64,63,67,65,66,61,68,65,69,70,66,66,68,69,69,64,61,66,68,69,66,66,71,69,68,67,65,68,63,64,63,64,62,64,64,64,63,62,61,60,63,58,59,58,56,57,64,59,56,54,56,54,50,53,50,51,54,50,51,48,47,48,46,44,44,46,44,42,44,41,50,54,60,60,54,57,58,60,54,58,53,57,57,61,61,61,61,73,66,63,64,61,64,64,62,62,58,63,64,66,70,66,62,68,69,68,65,69,64,62,60,67,69,66,66,71,66,68,72,63,67,66,65,69,59,64,64,63,60,62,63,62,61,64,60,61,58,57,62,60,56,57,65,55,57,56,54,55,51,52,51,50,49,47,48,47,45,49,45,47,46,46,49,41,43,42,54,62,55,59,55,59,57,53,72,57,50,60,56,61,59,60,59,65,73,62,62,62,63,65,61,65,62,62,62,69,69,66,64,61,66,62,67,68,62,70,68,69,66,70,65,67,65,66,68,67,64,67,66,65,64,62,65,66,63,62,61,62,63,62,62,62,58,58,60,60,60,56,57,56,53,57,54,53,52,53,52,50,50,49,49,50,46,53,45,47,46,45,47,44,43,42,59,57,55,60,58,55,55,56,55,59,59,62,62,62,58,61,57,58,68,65,63,62,65,67,67,71,60,67,67,68,65,64,67,55,69,67,67,67,69,68,68,72,69,69,68,67,66,72,71,71,70,69,67,66,69,66,64,50,66,65,62,63,68,63,61,61,62,62,59,59,60,57,59,60,59,54,60,54,47,47,51,52,51,47,49,48,47,48,46,47,47,45,44,41,43,44,56,54,58,58,52,59,58,59,56,61,60,62,61,62,63,60,58,63,64,62,60,63,61,69,68,57,65,67,68,58,53,68,78,69,71,69,70,65,69,71,71,70,66,66,68,68,70,68,69,72,71,70,70,67,68,65,65,63,68,67,67,64,69,66,64,59,61,60,61,63,62,59,56,55,55,57,57,53,53,53,55,50,50,49,52,50,51,50,47,44,46,46,46,43,45,44,57,59,62,57,58,60,59,58,59,60,58,69,59,63,67,65,61,56,58,66,65,65,61,66,63,66,72,70,72,69,69,69,72,71,69,72,70,65,71,71,71,72,72,71,72,69,67,68,69,71,69,67,65,67,67,66,67,64,66,63,65,64,63,65,62,62,65,61,59,60,63,59,58,58,60,57,56,55,54,54,53,49,52,53,53,48,51,48,48,48,46,47,49,45,44,45,42,59,62,58,59,60,60,64,57,59,62,61,63,64,59,69,57,67,63,65,64,64,67,63,66,69,69,68,69,67,67,65,84,65,71,68,76,69,68,70,70,68,73,70,68,71,67,70,71,70,70,70,68,64,72,64,66,62,66,66,67,67,67,63,64,66,62,59,61,62,59,61,64,62,57,49,57,56,50,55,50,52,52,50,50,51,48,48,47,47,48,49,46,46,43,47,59,59,60,52,59,58,60,60,60,61,60,59,65,66,74,59,64,67,63,66,65,65,67,66,64,67,62,68,65,68,70,71,72,70,71,69,69,71,70,72,72,70,72,73,73,71,70,72,67,68,71,72,69,68,68,69,67,62,65,66,66,68,64,65,61,61,61,61,59,63,58,57,58,58,58,56,61,55,55,55,52,53,54,51,52,51,48,49,47,52,55,46,43,48,45,43,57,56,62,60,60,54,58,62,58,59,62,61,63,64,64,64,65,65,63,66,67,65,65,67,65,62,74,65,72,66,69,66,69,71,71,70,73,73,68,67,75,68,70,71,72,73,71,69,67,68,67,67,68,71,66,70,70,64,69,67,68,65,63,65,65,66,63,61,60,63,60,61,59,58,56,55,56,54,56,55,52,57,54,50,50,49,47,47,45,45,48,47,48,46,44,44,59,56,56,64,55,56,63,59,57,61,61,62,61,62,60,60,63,70,68,66,65,66,66,67,69,67,69,73,70,70,66,71,72,74,66,72,72,72,72,71,69,70,72,71,69,72,71,71,69,70,69,70,69,68,67,71,69,63,69,70,68,64,65,64,67,63,67,62,62,63,58,64,61,58,58,57,56,57,56,55,55,55,48,53,51,50,50,48,48,47,49,46,44,49,45,41,59,57,63,44,54,60,56,62,60,54,73,60,64,66,64,64,64,68,64,64,66,64,69,67,68,68,69,69,68,71,71,68,69,70,71,70,75,72,73,73,71,71,66,70,74,72,73,70,88,71,67,73,70,68,70,68,70,71,69,68,67,67,65,70,68,65,65,64,61,63,61,60,60,63,60,59,56,54,53,53,51,54,52,54,53,52,49,50,48,48,45,44,46,49,44,43,50,60,58,61,60,61,72,69,60,61,61,69,64,62,64,67,66,65,71,80,66,64,62,69,67,67,67,69,70,69,72,73,69,70,70,72,68,70,72,75,74,75,72,73,71,73,75,72,73,71,72,75,70,70,69,73,70,69,70,67,68,68,65,66,65,65,66,66,64,63,61,61,60,59,59,59,59,57,57,55,57,55,53,54,52,53,52,48,47,48,49,47,46,45,44,44,60,52,58,60,60,57,64,64,64,55,62,62,62,66,67,66,65,64,69,65,71,68,65,69,69,67,69,70,71,70,72,69,71,72,68,71,76,74,72,72,75,73,73,70,74,74,75,70,72,73,72,69,73,67,70,68,68,65,68,67,69,68,68,67,65,66,65,62,63,64,60,64,63,61,59,56,56,56,58,51,56,54,52,54,52,52,52,52,50,51,51,50,45,46,45,45,64,57,54,55,58,61,60,65,59,59,63,63,66,66,66,64,62,67,68,68,67,70,67,71,73,69,70,70,67,72,72,71,70,71,72,71,74,70,72,72,75,75,73,74,75,75,71,75,72,70,69,71,72,69,70,71,71,70,67,67,70,68,68,67,65,67,66,62,64,66,62,63,64,61,62,61,60,60,59,58,54,56,56,54,52,53,52,51,50,49,48,51,44,46,48,46,55,57,58,60,60,60,60,63,63,61,63,63,63,65,67,67,68,68,70,66,70,72,69,69,69,72,71,76,73,72,73,71,71,74,72,75,71,68,72,74,71,75,72,72,73,69,71,75,72,74,73,72,73,73,71,69,70,72,70,69,65,67,70,68,65,66,63,65,65,64,65,61,63,62,64,60,59,60,61,58,59,50,57,55,53,53,52,53,52,47,49,49,48,48,47,46,60,61,64,60,64,63,58,65,55,66,64,65,66,64,63,63,70,66,67,70,68,71,68,70,72,71,71,70,75,67,73,69,72,69,73,73,75,75,75,75,75,80,71,71,74,75,76,73,74,75,70,72,73,71,74,72,71,72,69,71,69,71,70,68,67,66,67,67,64,65,63,62,63,61,61,59,58,58,57,58,54,55,57,54,53,53,52,51,48,51,50,50,50,44,47,45,63,58,63,61,61,61,62,62,64,62,65,67,65,68,71,69,63,70,70,66,72,70,69,67,70,70,70,73,70,69,73,73,72,71,72,75,72,75,75,77,74,70,68,79,73,76,76,75,75,74,71,75,75,73,73,72,70,72,70,70,70,71,70,70,71,68,66,67,65,63,62,64,65,61,62,61,59,60,56,59,55,55,56,58,51,52,53,53,45,54,48,50,47,49,47,46,62,56,60,63,63,61,62,64,64,65,65,68,68,68,67,65,59,70,69,66,69,68,70,67,71,74,73,74,77,73,72,71,75,72,72,72,74,74,72,74,78,72,71,77,67,72,74,74,72,75,76,75,71,73,76,74,71,71,72,69,69,70,70,70,66,70,68,68,68,64,64,66,61,60,63,61,61,60,59,60,57,58,56,54,53,53,52,52,54,49,51,49,47,47,47,47,59,57,61,63,64,62,62,64,65,62,67,66,67,69,66,68,69,66,68,71,70,70,71,74,75,72,72,72,74,74,74,74,73,69,76,76,75,77,75,78,76,74,73,73,75,75,75,75,75,72,72,77,75,75,76,73,74,65,70,70,67,72,70,67,69,67,67,65,68,66,64,62,60,63,63,61,61,62,62,60,57,57,58,54,55,55,54,51,52,49,50,50,49,49,47,45,72,68,58,59,59,64,64,63,61,62,67,68,70,69,70,64,65,70,69,66,70,74,71,72,71,75,70,72,73,76,76,74,71,72,77,76,75,74,78,78,80,77,79,78,77,79,74,73,75,76,76,74,73,75,73,73,71,69,72,73,71,72,71,69,69,71,68,70,66,64,68,67,64,65,63,59,60,61,60,58,58,59,57,54,55,55,53,57,48,51,52,49,46,49,47,47,59,60,59,63,62,61,66,67,63,64,66,62,68,68,69,70,67,71,73,71,71,74,67,74,66,74,74,74,72,74,77,76,72,76,73,74,76,75,78,78,78,77,78,76,77,78,80,62,77,76,76,75,76,75,75,76,73,70,73,73,71,68,71,69,67,68,66,70,66,66,65,68,63,64,64,61,59,60,60,59,60,57,55,54,55,54,56,55,54,56,53,52,49,47,49,44,61,60,61,66,65,63,58,66,63,65,64,68,65,69,69,67,72,69,72,74,69,70,71,77,71,71,71,74,76,73,74,73,78,70,75,76,76,70,76,76,72,78,76,77,75,77,77,93,74,73,75,73,73,72,72,72,74,72,69,72,73,77,71,71,68,70,68,70,64,67,66,66,63,60,60,60,60,59,63,60,57,58,57,54,57,55,53,54,47,50,52,52,50,48,47,44,53,59,61,58,55,64,64,64,62,63,66,66,66,66,65,72,67,70,70,71,61,77,73,70,69,74,72,71,74,72,75,74,72,74,76,79,75,74,75,74,74,79,76,75,76,75,73,74,77,75,73,75,75,73,73,77,74,74,73,73,73,72,72,69,68,67,71,69,68,69,64,62,64,62,62,63,60,62,60,58,57,58,54,56,56,53,53,54,54,48,50,50,50,49,44,46,58,64,56,60,61,67,59,61,68,70,66,64,67,66,63,73,68,69,70,70,73,73,74,70,77,76,73,73,74,73,74,74,75,76,75,74,72,76,71,76,76,78,67,79,80,75,77,72,77,69,76,71,75,72,73,75,76,75,72,73,71,70,71,70,71,69,69,69,70,67,66,63,65,63,64,60,59,62,60,58,59,58,57,56,57,53,54,55,53,51,51,50,49,47,46,47,59,65,67,62,63,61,62,63,66,69,65,67,68,66,67,66,66,67,73,70,70,70,73,73,69,73,75,79,72,75,71,71,75,89,73,75,77,74,75,74,76,78,70,77,77,76,78,78,78,74,72,77,75,74,75,75,76,74,71,74,73,72,70,71,72,70,67,71,68,65,66,67,64,64,65,60,61,62,60,59,60,63,57,57,56,56,55,53,53,54,52,49,47,47,48,49,60,59,60,63,62,60,59,64,72,65,62,69,70,71,68,69,71,69,68,72,71,74,69,73,84,71,72,77,75,75,84,77,78,78,76,76,76,75,74,76,78,76,76,76,74,76,76,78,76,74,72,75,77,76,76,77,74,76,73,76,72,69,71,71,76,73,68,70,67,67,67,68,60,62,63,63,61,62,60,59,58,55,54,56,57,54,51,54,52,52,52,49,50,48,49,47,62,61,61,63,62,61,62,65,66,66,67,67,67,68,66,69,66,67,72,74,72,73,72,73,84,74,70,75,77,75,75,75,76,75,74,75,76,76,78,74,79,81,77,80,75,77,78,78,76,82,80,78,76,76,76,74,76,76,70,74,76,72,75,74,73,70,70,69,65,66,66,67,63,62,67,60,60,63,63,60,58,58,59,57,56,59,54,52,51,51,49,51,49,49,47,49,64,62,62,63,66,64,61,65,66,64,67,71,68,66,67,69,71,71,71,70,72,73,71,75,71,75,70,70,73,73,74,75,79,77,74,76,79,80,78,75,78,77,76,75,76,77,79,77,77,79,78,78,69,75,78,76,74,74,73,75,75,70,74,72,72,68,68,68,68,68,67,66,66,65,61,57,60,60,60,59,57,59,59,60,54,54,53,54,54,52,54,52,50,49,47,46,58,60,58,64,63,75,63,63,64,65,65,68,69,66,71,67,70,68,70,73,72,72,73,73,74,72,74,72,69,75,76,76,75,75,77,77,78,76,76,76,78,79,76,77,79,81,77,77,79,79,78,76,76,76,75,75,76,75,73,74,74,71,71,72,70,71,68,69,67,68,65,64,66,63,62,63,61,61,59,59,60,57,58,55,57,57,56,53,52,52,52,53,49,49,47,47,58,61,62,62,63,64,62,66,64,65,66,65,68,69,70,67,80,72,73,70,72,73,72,73,72,72,73,74,74,74,74,78,75,77,76,75,79,78,75,74,77,78,72,78,78,76,78,76,79,78,78,77,78,76,77,76,77,73,73,75,72,71,73,71,68,71,70,68,71,66,67,67,64,66,65,66,62,60,59,60,58,59,57,57,58,51,54,55,54,50,48,54,51,49,50,47,59,61,64,63,63,68,62,67,66,62,65,64,70,66,67,73,71,71,72,73,73,70,72,75,73,75,73,76,75,76,74,77,74,73,76,75,79,78,77,78,79,76,76,76,77,75,75,78,80,76,77,78,77,77,77,74,74,73,74,73,73,71,73,74,73,70,71,69,71,65,68,67,67,66,63,63,66,62,59,57,57,58,58,56,55,60,53,54,53,53,48,51,52,50,48,48,62,58,64,64,64,61,64,64,64,66,67,68,67,70,70,71,70,70,67,72,70,76,72,73,72,74,74,78,70,77,73,77,77,76,75,69,76,77,77,76,76,78,78,78,78,80,70,75,78,79,78,77,77,79,74,74,71,73,70,73,74,71,73,73,72,73,71,70,69,67,64,73,65,65,65,62,61,61,62,59,58,61,59,51,56,56,55,56,54,53,53,50,49,48,49,48,59,59,62,62,64,66,63,64,66,65,67,64,67,68,70,67,72,70,71,75,71,70,70,72,74,76,74,76,77,73,75,76,80,72,75,78,76,75,77,79,77,78,76,83,79,77,80,75,79,78,80,79,77,77,75,74,75,72,75,74,73,74,71,70,70,69,69,63,69,68,66,62,66,63,62,64,63,62,63,58,59,59,61,54,56,56,55,53,57,53,49,51,49,48,49,49,62,58,61,61,65,63,63,64,65,71,68,68,69,69,68,68,72,73,78,76,73,69,76,74,75,73,74,74,76,74,73,77,74,78,79,78,78,77,78,76,76,78,76,79,79,77,73,80,75,76,74,74,76,75,71,77,76,73,75,73,75,70,70,70,71,69,72,71,69,66,67,68,65,64,69,61,63,61,59,59,59,59,59,56,55,54,55,54,55,54,50,49,49,48,50,49,64,60,59,64,60,62,64,63,66,67,66,69,66,70,72,71,67,70,66,76,74,72,75,72,72,74,74,74,75,78,76,75,77,82,76,76,74,76,79,83,79,76,74,76,77,78,78,79,75,75,77,73,78,76,75,79,77,76,75,75,73,70,70,72,72,71,70,71,68,67,65,68,65,66,64,62,63,60,61,60,58,57,58,59,54,55,54,56,56,54,53,50,49,47,48,47,60,61,59,61,62,64,62,67,67,69,66,68,68,70,67,68,67,72,71,64,74,75,71,74,73,73,73,75,75,76,72,72,74,79,78,75,76,77,78,74,77,78,75,76,78,78,76,77,77,76,78,74,76,75,75,75,75,75,74,71,72,73,71,71,72,71,69,71,67,64,66,66,66,65,66,62,62,59,61,59,59,57,56,55,55,54,53,56,55,52,52,49,50,48,46,47,46,61,60,71,56,65,63,66,68,71,66,68,69,69,68,68,71,69,69,70,67,72,74,72,75,72,73,71,73,76,74,83,76,79,76,73,76,77,76,75,75,82,77,78,75,76,76,78,76,77,77,77,78,74,73,73,74,75,75,74,70,73,73,70,70,70,68,70,67,65,64,65,64,65,66,62,61,61,59,59,59,58,57,57,53,57,54,53,53,53,52,50,50,49,46,45,63,60,60,65,66,59,59,60,67,65,68,69,67,67,71,70,70,72,69,69,70,74,72,73,73,73,74,74,72,73,72,74,76,78,75,75,76,76,73,76,77,75,74,77,77,75,74,78,77,73,76,76,76,75,73,73,74,76,75,73,73,72,73,73,71,66,69,68,66,69,66,68,66,63,60,62,59,60,60,57,61,57,59,55,54,56,54,53,51,51,51,51,47,48,49,47,59,62,64,65,64,65,63,66,67,62,61,63,67,68,66,70,70,70,70,70,72,74,72,72,74,73,76,76,75,76,74,73,73,75,76,76,77,77,76,75,73,77,79,78,78,76,78,76,77,76,77,75,75,76,73,78,78,74,73,73,73,71,71,71,71,70,69,67,65,67,64,66,67,65,64,62,60,61,61,61,61,57,58,57,55,51,54,52,52,50,52,50,49,48,46,45,57,61,60,58,63,65,66,63,63,63,67,66,69,69,70,76,68,71,70,70,70,72,72,72,74,71,75,74,75,74,74,77,78,76,74,77,78,77,77,75,75,77,72,77,73,78,76,74,79,77,76,76,76,74,73,73,73,72,73,73,74,70,72,69,72,69,68,67,65,64,65,65,65,65,62,65,63,59,61,58,60,57,56,56,53,55,55,53,54,52,52,50,50,48,50,48,60,58,59,62,58,64,62,66,64,64,63,65,65,66,61,67,70,64,67,71,69,71,71,73,71,71,72,72,72,74,74,69,76,75,75,72,75,76,77,79,75,78,76,73,76,77,75,78,76,76,77,74,74,71,74,72,73,74,71,73,71,67,72,69,68,70,69,68,68,67,65,65,63,66,62,64,63,62,60,59,59,56,58,58,52,54,53,50,51,50,52,53,48,47,47,46,56,62,60,61,60,60,59,64,58,65,64,63,67,65,68,69,73,73,69,70,71,71,74,73,71,73,75,73,73,74,76,74,75,73,76,80,75,75,76,74,77,76,73,74,75,75,74,75,76,76,75,71,76,77,73,71,73,75,71,70,73,70,70,70,70,67,69,69,67,66,64,66,66,63,62,61,64,59,60,58,59,59,56,56,53,53,53,53,53,52,48,51,48,49,50,49,58,58,60,62,66,69,53,64,60,63,65,66,66,69,69,68,69,68,70,68,69,71,70,70,73,71,72,71,72,73,75,74,75,74,75,75,75,75,75,78,73,75,73,74,74,74,77,75,75,76,75,74,76,74,71,72,74,76,74,73,72,71,75,64,69,66,67,67,67,66,64,65,66,62,60,62,61,59,59,59,58,57,55,56,56,53,54,55,52,51,49,48,48,48,46,51,60,62,61,61,61,58,58,64,64,57,65,63,65,69,69,69,62,63,70,71,69,72,74,69,73,72,75,73,73,74,76,69,73,73,74,74,73,75,74,75,73,77,77,76,81,74,74,73,74,76,73,72,73,74,70,74,72,73,70,70,70,69,63,69,71,71,68,64,68,67,67,64,64,62,62,60,59,59,59,59,56,60,59,58,57,56,53,53,47,50,52,48,49,48,47,46,61,59,61,63,63,57,65,59,65,63,66,66,66,66,69,68,64,66,69,70,71,72,65,70,68,72,70,74,70,75,73,70,72,75,76,74,76,75,76,77,76,75,77,77,74,76,76,74,72,74,77,72,73,71,68,71,74,74,73,70,76,68,68,66,69,71,67,68,66,68,65,63,63,63,65,60,59,58,57,57,58,56,56,57,58,56,53,53,47,52,53,51,50,51,49,48,57,58,62,63,62,62,61,62,61,66,63,62,66,64,65,69,72,69,66,67,70,72,72,70,66,72,74,74,77,72,71,64,73,75,75,75,75,77,72,72,72,74,75,74,75,75,73,76,76,76,71,74,70,74,73,68,69,68,71,72,72,72,68,67,68,69,66,66,68,64,65,63,63,62,61,62,58,58,59,59,58,56,55,55,50,54,55,51,51,51,48,50,47,50,48,46,59,60,62,65,61,62,63,63,42,59,64,63,65,63,62,66,65,63,66,68,68,69,70,71,69,68,68,67,73,74,71,71,73,68,71,74,74,76,72,74,76,73,72,74,74,75,75,74,74,75,76,73,73,70,69,71,73,67,71,71,72,70,67,67,67,66,64,64,66,65,62,65,64,62,60,58,59,58,59,57,58,54,47,55,53,51,50,52,47,51,51,49,49,42,47,46,59,62,61,57,60,62,62,61,66,60,63,64,64,67,67,65,68,69,70,65,67,68,70,70,69,70,73,70,72,73,72,72,75,70,73,74,72,71,75,73,76,74,74,73,71,77,74,76,75,72,72,72,71,70,74,74,74,71,70,67,70,67,67,68,67,67,66,66,67,61,65,63,60,61,63,61,57,59,58,57,54,54,56,58,54,54,54,50,49,49,51,49,46,47,44,46,59,62,57,64,59,66,63,65,61,61,65,68,66,67,63,66,67,69,64,71,70,68,70,69,68,71,71,69,71,67,72,74,75,74,73,72,71,75,70,73,74,74,74,73,74,81,72,76,72,72,71,74,71,72,70,74,73,71,70,70,69,69,68,68,67,66,66,65,64,63,66,64,63,62,59,64,60,58,59,58,54,55,53,57,55,51,52,51,49,52,51,47,47,49,43,46,56,58,60,61,58,59,60,63,60,60,60,60,62,65,64,64,65,66,66,69,68,66,68,69,76,70,67,70,78,70,71,72,73,72,73,75,73,74,73,69,73,70,70,72,73,75,71,74,72,72,74,72,72,71,72,71,68,71,70,68,68,69,69,66,68,67,69,63,62,62,62,62,60,61,57,56,56,58,59,57,55,54,54,53,53,53,51,52,51,51,49,46,47,47,47,44,58,61,59,61,60,59,58,60,62,65,64,63,66,64,65,64,66,69,66,69,68,67,68,70,70,68,68,67,70,70,70,72,71,68,70,73,70,75,73,73,72,72,72,72,70,74,72,71,73,73,71,72,72,69,69,71,71,69,68,67,66,67,68,68,67,65,64,61,63,61,62,63,62,63,59,59,58,59,57,55,56,50,53,53,52,49,51,49,52,51,49,48,46,47,48,44,60,57,59,56,64,62,62,61,60,60,65,63,63,65,63,64,65,62,64,66,68,69,70,63,65,68,70,69,71,68,70,72,72,71,72,69,69,69,72,74,70,70,69,71,70,74,65,71,74,73,72,70,71,71,70,72,71,70,68,66,66,68,67,64,68,65,64,62,62,63,64,62,61,58,60,58,56,58,53,54,56,52,53,53,53,50,52,50,50,49,44,47,47,45,46,45,56,60,59,60,60,60,61,59,62,62,61,62,63,63,62,64,70,64,65,68,69,65,69,67,67,61,68,72,71,73,70,70,70,68,73,72,72,71,69,69,69,72,75,70,70,73,73,70,72,71,70,71,72,68,68,70,67,69,68,68,68,67,66,66,64,66,65,63,60,58,62,60,60,59,61,59,58,55,55,56,56,54,52,51,52,53,48,49,47,48,47,45,45,45,43,43,56,58,57,58,62,57,57,60,60,63,62,63,64,63,66,63,64,66,67,70,67,68,69,69,75,69,69,69,68,67,71,68,69,70,69,72,72,71,70,71,71,70,70,73,71,73,73,72,69,70,69,71,72,71,68,70,66,70,68,67,69,64,63,69,68,64,67,65,63,63,60,62,61,59,61,59,59,54,55,57,56,57,53,50,49,49,50,47,51,48,47,46,45,45,45,46,56,55,57,55,55,61,59,60,60,63,59,62,63,59,63,61,63,64,65,65,66,69,68,66,68,68,65,70,66,69,70,76,70,68,68,69,71,71,71,70,71,69,68,70,70,70,69,68,70,67,68,70,70,69,69,68,66,65,63,66,65,65,67,64,63,65,63,63,63,62,62,60,69,57,59,60,55,56,55,55,56,52,55,52,50,50,48,48,47,45,45,46,44,43,43,44,56,35,58,56,56,57,59,58,60,51,59,63,61,61,68,65,59,64,63,64,65,65,69,65,67,68,67,67,69,68,68,68,66,71,72,71,71,72,67,69,69,69,70,69,69,68,67,69,68,67,69,68,70,67,68,68,67,68,66,67,63,65,66,65,63,62,60,62,62,59,60,59,56,56,57,58,55,54,55,54,54,52,49,48,49,48,47,46,44,46,44,44,43,43,41,44,52,64,61,60,62,56,58,59,54,66,59,61,61,62,62,64,61,66,63,74,68,66,66,68,62,69,69,74,70,61,68,69,71,69,70,65,69,71,67,65,70,72,71,70,68,69,71,69,70,70,68,71,67,67,66,66,69,67,65,64,64,61,66,57,66,64,61,62,62,59,59,57,58,56,58,56,54,55,54,50,54,51,51,51,48,47,49,47,48,47,46,45,42,43,45,45,54,57,57,58,59,59,60,56,59,60,59,60,62,60,62,62,62,62,62,61,63,69,60,61,63,63,67,62,68,70,69,69,66,71,68,69,93,68,68,67,70,68,69,69,69,70,70,68,69,67,69,67,67,68,67,66,67,67,63,65,65,64,64,66,65,63,62,62,61,61,59,60,58,57,56,54,54,51,52,53,50,51,54,49,49,47,46,46,50,45,47,46,42,43,43,44,49,54,53,57,56,57,58,60,60,59,59,60,59,59,61,58,62,56,64,64,62,65,56,62,66,67,66,63,65,62,65,66,69,65,67,69,67,66,68,66,66,70,67,68,68,68,66,66,70,68,65,68,65,66,64,63,64,68,64,63,62,62,64,60,60,59,61,60,58,58,59,59,56,56,55,53,54,54,50,53,49,51,52,49,47,46,49,47,47,46,46,45,42,42,40,43,57,57,59,58,57,57,55,57,57,61,57,57,54,58,65,68,61,64,64,65,65,63,63,64,67,66,66,67,65,65,65,65,66,68,70,68,67,65,66,68,67,68,72,66,65,67,67,66,68,69,68,68,67,68,65,66,66,65,63,64,64,63,63,62,63,58,59,60,59,57,58,57,55,57,56,56,53,54,54,52,52,48,50,46,48,47,45,47,48,47,44,43,42,43,43,42,55,55,59,57,56,58,60,59,59,58,57,58,60,55,58,61,59,63,63,64,64,55,67,63,64,65,66,64,64,63,65,63,65,64,68,68,67,64,68,57,65,68,68,66,65,64,67,66,65,65,65,68,71,68,65,63,63,66,64,59,64,63,65,60,61,60,59,60,58,58,59,59,54,55,56,57,53,55,51,51,49,50,50,47,47,46,45,45,45,44,44,42,41,43,43,43,55,57,56,55,57,59,58,52,58,59,54,56,58,54,59,59,62,60,57,63,62,63,63,64,59,65,65,63,62,64,64,61,65,65,68,64,64,66,66,68,68,64,67,67,65,66,61,57,65,66,67,63,64,65,65,62,61,63,60,62,65,65,61,62,61,59,56,59,58,59,57,56,59,57,57,54,55,53,51,50,47,50,49,49,47,47,47,45,43,42,41,43,43,42,41,42,55,53,53,54,59,58,60,59,55,59,60,59,58,58,60,62,62,59,61,59,58,61,62,64,62,60,64,63,65,65,58,66,69,67,65,65,65,64,66,66,67,69,66,65,64,66,64,64,66,62,64,65,61,62,63,59,58,65,61,59,62,60,60,59,63,59,58,59,59,60,55,55,52,51,51,52,52,52,48,51,48,48,49,45,46,45,48,45,45,42,41,42,42,40,39,42,53,53,53,58,53,58,57,56,60,57,58,58,62,61,61,60,60,57,60,57,56,62,65,57,69,58,65,62,62,62,61,61,57,64,64,69,65,64,63,64,68,66,66,65,66,67,66,65,63,64,64,63,62,62,63,60,61,60,61,59,61,59,60,61,57,55,57,56,59,57,54,56,54,54,54,51,54,50,47,52,47,46,49,42,45,46,46,46,44,42,43,42,40,41,40,42,53,54,52,57,58,56,61,57,62,56,61,57,61,57,58,60,60,60,59,59,59,61,63,65,62,62,59,63,65,64,64,62,63,67,64,64,66,64,65,65,64,62,67,64,62,64,64,60,60,66,65,63,64,60,62,61,62,63,62,58,59,55,58,59,58,58,57,56,57,56,54,54,53,56,51,51,52,52,50,50,46,47,47,45,47,46,44,46,44,45,44,42,39,39,41,40,51,52,54,56,58,55,54,53,51,58,57,57,58,60,60,47,55,65,60,60,59,60,59,56,61,61,61,64,61,60,64,63,63,61,62,64,68,63,63,65,63,61,64,62,63,63,63,63,62,63,61,63,63,60,61,62,58,60,61,57,58,57,58,57,58,57,56,57,58,56,55,55,52,52,50,50,49,49,50,47,45,46,45,45,45,44,43,44,43,42,43,43,41,39,40,40,50,52,53,54,52,52,57,52,57,40,58,59,60,55,57,60,59,57,56,57,57,60,58,62,61,60,59,61,60,59,63,60,63,62,61,63,64,63,64,63,64,63,62,59,58,58,63,63,63,62,63,61,61,58,59,60,58,59,59,55,57,58,58,57,56,53,57,56,56,53,53,53,52,51,52,52,50,49,48,45,45,38,45,45,43,43,43,43,43,46,44,41,40,39,40,39,54,55,54,57,52,55,58,58,53,53,54,57,56,57,58,57,60,56,57,56,60,59,53,56,58,54,60,58,61,62,65,63,63,61,61,61,70,62,61,61,64,63,63,59,60,59,62,60,63,62,61,60,60,60,61,59,58,59,58,56,58,58,60,59,58,57,57,54,55,56,51,53,52,50,51,51,48,49,47,45,46,49,47,44,45,44,42,41,42,42,42,42,43,39,41,24,52,56,50,54,51,53,58,56,58,57,54,53,58,58,58,58,59,57,58,54,57,56,53,58,61,58,59,63,63,59,57,59,61,59,62,60,61,65,59,60,63,60,59,59,59,62,64,62,62,61,60,60,59,62,59,58,59,57,57,54,58,56,58,58,57,51,53,54,54,52,53,53,49,48,49,51,49,46,46,48,45,48,46,46,46,45,42,44,41,43,39,41,40,41,38,41,47,59,53,53,53,53,51,55,53,52,55,49,55,55,54,56,54,52,58,56,58,57,59,58,58,60,60,59,57,60,59,60,59,59,61,62,62,60,60,60,62,60,56,58,61,60,57,61,61,60,59,58,61,58,58,58,57,57,59,57,55,55,51,54,56,53,54,54,52,53,52,52,49,51,49,46,44,45,48,44,44,45,44,43,46,44,44,44,34,41,39,40,40,39,38,39,51,48,53,53,52,54,55,56,58,53,53,56,57,56,53,54,57,58,58,59,57,53,57,57,56,59,58,57,60,60,59,60,60,57,59,61,59,63,59,59,60,58,57,58,60,56,60,59,59,60,61,58,60,58,59,58,55,57,57,54,53,54,56,56,57,55,53,55,56,52,52,50,52,50,49,48,50,47,44,43,44,43,42,44,44,44,40,43,41,43,40,39,39,38,38,38,54,51,52,53,55,49,55,56,54,51,55,55,51,54,52,48,58,53,53,56,56,59,60,57,58,56,58,59,55,60,57,57,55,58,59,61,63,60,61,59,58,57,58,57,61,60,61,59,59,59,60,58,56,56,59,56,54,56,54,56,57,52,54,54,54,48,53,55,53,51,49,45,50,49,43,47,50,48,48,45,47,44,46,43,44,40,41,41,40,41,41,39,42,41,39,35,47,54,50,55,52,52,52,56,58,54,56,56,52,54,55,50,57,54,58,54,56,59,59,59,61,59,58,58,54,61,57,55,57,59,60,61,57,59,56,55,59,58,58,58,59,59,58,58,58,55,57,57,57,58,58,57,56,56,57,57,55,53,54,54,53,53,53,52,53,53,48,48,51,46,48,48,47,46,45,46,46,45,44,42,42,42,43,40,43,41,41,39,40,38,37,37,46,49,49,49,49,52,55,50,50,54,54,54,55,54,54,53,54,53,54,54,55,56,57,58,54,56,57,53,56,57,61,53,58,56,53,53,55,58,58,56,58,57,58,57,54,56,56,56,55,55,55,57,55,55,46,56,54,51,54,54,53,53,52,51,51,51,52,49,50,47,48,45,46,46,50,50,46,48,49,45,44,43,42,43,41,42,42,41,41,39,38,38,40,37,39,37,46,53,48,53,48,49,54,57,51,50,53,53,53,53,52,55,53,54,54,56,57,57,52,55,54,57,57,60,56,57,57,56,56,56,57,55,57,58,56,58,57,53,58,60,57,59,56,55,55,54,57,55,56,52,50,52,57,54,52,51,53,52,52,52,53,53,50,49,49,49,51,49,47,47,47,47,44,46,44,41,43,43,41,42,41,39,41,40,40,40,38,39,37,37,37,36, Length: 9216

there are some difference but the result seem to vary and I expected the result to be only 0 or very close to 0 when I was holding my finger over the lense.

This is the code I am using:

#include "esp_camera.h"
#include <WiFi.h>

#define CAMERA_MODEL_AI_THINKER // Has PSRAM
#include "camera_pins.h"

const char *ssid = "********";
const char *password = "********";

void startCameraServer();
void setupLedFlash(int pin);
void getPixels();

void setup()
{
  Serial.begin(115200);
  Serial.setDebugOutput(true);
  Serial.println();

  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sccb_sda = SIOD_GPIO_NUM;
  config.pin_sccb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.frame_size = FRAMESIZE_UXGA;
  config.frame_size = FRAMESIZE_96X96;
  config.pixel_format = PIXFORMAT_GRAYSCALE;
  config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
  config.fb_location = CAMERA_FB_IN_PSRAM;
  config.jpeg_quality = 12;
  config.fb_count = 1;
  if (config.pixel_format == PIXFORMAT_JPEG)
  {
    if (psramFound())
    {
      config.jpeg_quality = 10;
      config.fb_count = 2;
      config.grab_mode = CAMERA_GRAB_LATEST;
    }
    else
    {
      // Limit the frame size when PSRAM is not available
      // config.frame_size = FRAMESIZE_SVGA;
      config.fb_location = CAMERA_FB_IN_DRAM;
    }
  }
  else
  {
    // Best option for face detection/recognition
    // config.frame_size = FRAMESIZE_240X240;
#if CONFIG_IDF_TARGET_ESP32S3
    config.fb_count = 2;
#endif
  }

#if defined(CAMERA_MODEL_ESP_EYE)
  pinMode(13, INPUT_PULLUP);
  pinMode(14, INPUT_PULLUP);
#endif

  // camera init
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK)
  {
    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  }

  sensor_t *s = esp_camera_sensor_get();

// Setup LED FLash if LED pin is defined in camera_pins.h
#if defined(LED_GPIO_NUM)
  setupLedFlash(LED_GPIO_NUM);
#endif

  WiFi.begin(ssid, password);
  WiFi.setSleep(false);

  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");

}

void loop()
{
  getPixels();
}

void getPixels()
{
  // disable white balance and white balance gain
  sensor_t *sensor = esp_camera_sensor_get();
  sensor->set_whitebal(sensor, 0); // 0 = disable , 1 = enable
  sensor->set_awb_gain(sensor, 0); // 0 = disable , 1 = enable

  camera_fb_t *fb = NULL;

  // Take Picture with Camera
  fb = esp_camera_fb_get();

  if (!fb)
  {
    Serial.println("Camera capture failed");
    return;
  }

  for (int i = 0; i < fb->len; i++)
  {
    Serial.print(fb->buf[i]);
    Serial.print(",");
  }

  Serial.print(" Length: ");
  Serial.println(fb->len);
  Serial.println(F("\n\n---------------------\nPREPARE TO CAPTURE TO FILE\n"));
  delay(2000);

  esp_camera_fb_return(fb);
}

pick just one

if you try one example (like this), do you get the picture ?

No, there is always background sensor noise, even in pitch darkness. And a surprising amount of light gets through your finger.

Your camera is working. Try the histogram.

yes this is working. Im now isolating that code to just be able to grab rgb (or grayscale) values. Basically I want to grab the values on every frame. Im not sure however esp32cam is intended for this?

I implemented this histogram function in the loop but I get this error:

Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Code:

void histogram()
{
  // for each pixel in image
  long npix = 0;
  unsigned long histogram[256] = {0};
  camera_fb_t *fb = NULL;
  int WIDTH = 96;
  int x;
  int y;

  for (size_t i = 0; i < fb->len; i++)
  {
    x = i % WIDTH;                   // x position in image
    y = floor(i / WIDTH);            // y position in image
    unsigned int pixel = fb->buf[i]; // pixel value
    histogram[pixel]++;
    // show data
    //  Serial.print((unsigned int)pixel);
    //  Serial.print("\n");

    npix++;
  }
  Serial.print("***** "); // separator
  Serial.print(npix);
  Serial.print(" data lines\n");
  for (int i = 0; i < 256; i++)
  {
    Serial.print(i);
    Serial.print("\t");
    Serial.println(histogram[i]);
  }
}

The error is in the code that you forgot to post.

You're dereferencing a null pointer, you for got the call to esp_camera_fb_get().

You don't need to do any "grabbing". The esp_camera_fb_get() does it all for you. Assuming it succeeds, the returned value points to the complete frame information structure, as I already explained in Post #5.

1 Like

Ahh, yes. The OP made up some variable names and added them to the (working) code I posted earlier.

The working code is intended to be in line with the code that reads the image frame.

Here is the complete function:

bool capture_still() {

  Serial.print("***** greyscale image histogram\n");
  camera_fb_t *frame = esp_camera_fb_get();

  if (!frame)
    return false;

  int npix = 0;
  // for each pixel in image
  unsigned long histogram[256] = {0};

  for (size_t i = 0; i < frame->len; i++) {

    unsigned int pixel = frame->buf[i];                     // pixel value
    histogram[pixel]++;
    // show data
    //  Serial.print((unsigned int)pixel);
    //  Serial.print("\n");

    npix++;
  }
  Serial.print("***** ");  //separator
  Serial.print(npix);
  Serial.print(" data\n");
  for (int i = 0; i < 256; i++) {
    Serial.print(i);
    Serial.print("\t");
    Serial.println(histogram[i]);
  }
  esp_camera_fb_return(frame);                      // return storage space
  return true;
}

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.