Blame view

test_main.cpp 1.36 KB
b71cc8bb   Tianshu Cheng   mPb using 3 channels
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  #include <stim/image/image.h>
  #include <cmath>
  #include <stim/visualization/colormap.h>
  #include <stim/image/image_contour_detection.h>
  #include <iostream>
  
  
  void main()
  {
  	stim::image<float> rgb,gaussgradient;				//generate an image object
  
  	rgb.load("101087.bmp");					//load the input image
  	unsigned int w = rgb.width();		//get the image size
  	unsigned int h = rgb.height();
  	unsigned int s = rgb.size();
  	unsigned a = sizeof(float);
  	
  	stim::image<float> lab;						//create an image object for a single-channel (grayscale) image
  	lab = rgb.srgb2lab();						//create the single-channel image
  
  	/*
  	stim::image<float> pic_light, pic_colora, pic_colorb;	
  	pic_light = lab.channel(0);
  	pic_light.save("pic_light.bmp");
  
  	pic_colora = lab.channel(1);
  	pic_colorb = lab.channel(2);
  
  	float sigma = 2; 
  	unsigned int sigma_n = 3;
  	unsigned int r = 5;
  	unsigned int winsize = r * 2;  //window size = winsize + 1
  	float theta = 90;
  
  	gaussgradient = gaussian_derivative_filter_odd(pic_colorb, sigma, sigma_n, winsize, theta, w, h);
  	gaussgradient.save("data_output/pic_gray_gradient.bmp");
  	*/
  
  	//float theta = 0;
  	unsigned int theta_n = 8;
  
  	//stim::image<float> mPb_stack(w,h,theta_n);
  
  	//stim::image<float> mPb_theta;	
  	//mPb_theta = func_mPb_theta(lab, theta, w, h);
  	//mPb_theta.save("data_output/pic_gray_gradient.bmp");
  
  	stim::image<float> mPb;
  	mPb = func_mPb(lab, theta_n, w, h);
  
  	
  
  }