<commit_before>#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>

// Apriltag includes.
#include <apriltag.h>
#include <tag36h11.h>
#include <common/zarray.h>
#include <common/image_u8.h>
#include <common/homography.h>

#include <chiasm.h>

apriltag_family_t *tag_family = NULL;
apriltag_detector_t *tag_detector = NULL;

uint32_t width, height, stride;

bool calib = false;
double f[2];
double c[2];


int
CH_DL_INIT(struct ch_device *device, struct ch_dl_cx *cx)
{
    width = device->framesize.width;
    height = device->framesize.height;

    if (device->calib) {
        calib = true;
        cx->undistort = true;
        f[0] = device->calib->camera_mat[0][0];
        f[1] = device->calib->camera_mat[1][1];

        c[0] = device->calib->camera_mat[2][0];
        c[1] = device->calib->camera_mat[2][1];
    }

    cx->out_pixfmt = AV_PIX_FMT_GRAY8;
    stride = cx->out_stride = ch_calc_stride(cx, width, 96);

    // Initialize AprilTag tag family.
    tag_family = tag36h11_create();

    tag_family->black_border = 1;<commit_msg>Fixed bad reference in intrinsics in apriltag.<commit_after>#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>

// Apriltag includes.
#include <apriltag.h>
#include <tag36h11.h>
#include <common/zarray.h>
#include <common/image_u8.h>
#include <common/homography.h>

#include <chiasm.h>

apriltag_family_t *tag_family = NULL;
apriltag_detector_t *tag_detector = NULL;

uint32_t width, height, stride;

bool calib = false;
double f[2];
double c[2];

int
CH_DL_INIT(struct ch_device *device, struct ch_dl_cx *cx)
{
    width = device->framesize.width;
    height = device->framesize.height;

    if (device->calib) {
        calib = true;
        cx->undistort = true;
        f[0] = device->calib->camera_mat[0][0];
        f[1] = device->calib->camera_mat[1][1];

        c[0] = device->calib->camera_mat[0][2];
        c[1] = device->calib->camera_mat[1][2];
    }

    cx->out_pixfmt = AV_PIX_FMT_GRAY8;
    stride = cx->out_stride = ch_calc_stride(cx, width, 96);

    // Initialize AprilTag tag family.
    tag_family = tag36h11_create();

    tag_family->black_border = 1;
{'fraction_non_alphanumeric': 0.1520112254443405, 'fraction_numerical': 0.027128157156220765, 'mean_word_length': 3.6198704103671706, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5964778', 'n_tokens_mistral': 862, 'n_tokens_neox': 831, 'n_words': 159}