Blame view

test_main.cpp 1.14 KB
b71cc8bb   Tianshu Cheng   mPb using 3 channels
1
2
3
4
5
  #include <stim/image/image.h>
  #include <cmath>
  #include <stim/visualization/colormap.h>
  #include <stim/image/image_contour_detection.h>
  #include <iostream>
7fab7a98   Tianshu Cheng   a neat version of...
6
  /// calculate the mPb given a multi-channel image
b71cc8bb   Tianshu Cheng   mPb using 3 channels
7
  
abaf5630   David Mayerich   fixed the signed/...
8
  int main()
b71cc8bb   Tianshu Cheng   mPb using 3 channels
9
  {
7fab7a98   Tianshu Cheng   a neat version of...
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  	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
b71cc8bb   Tianshu Cheng   mPb using 3 channels
26
  
abaf5630   David Mayerich   fixed the signed/...
27
  	return 0;
b71cc8bb   Tianshu Cheng   mPb using 3 channels
28
  
abaf5630   David Mayerich   fixed the signed/...
29
  }