test_main.cpp
1.14 KB
#include <stim/image/image.h>
#include <cmath>
#include <stim/visualization/colormap.h>
#include <stim/image/image_contour_detection.h>
#include <iostream>
/// calculate the mPb given a multi-channel image
int main()
{
stim::image<float> img; // generate an image object
img.load("slice00_500_500.bmp"); // load the input image
img = img.channel(0); // get the first channel of black-and-white image
unsigned int w = img.width(); // get the width of picture
unsigned int h = img.height(); // get the height of picture
int c = img.channels(); // get the number if channels of picture
int s = 3; // set the number of scales
int r[3] = {3,5,10}; // set an array of radii for different scaled discs(filters)
float alpha[3] = {1,1,1}; // set an array of weights for different scaled discs(filters)
unsigned int theta_n = 8; // set the number of angles used for computing the gradient
stim::image<float> mPb; // allocate the space for mPb
mPb = func_mPb(img, theta_n, r, alpha, s); // calculate the mPb
return 0;
}