Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int tablica[image.width()][image.height()];
- int xd,yd;
- cout<<endl<<"Enter x value of your seed";
- cin>>xd;
- cout<<"Enter y value of your seed ";
- cin>>yd;
- int sred=image(xd,yd,0);
- float kolor;
- do
- {
- cout<<endl<<"In what color I should create region?"<<endl;
- cin>>kolor;
- }while(kolor>255&&kolor<0);
- WHOLE_IMAGE_WITHOUT_BORDERS
- {
- if(image(x,y,z)<(sred+20) && image(x,y,z)>(sred-20))
- {tablica[x][y]=1;}
- }
- tablica[xd][yd]=2;
- for(int m;m<image.height();m++)
- {
- for(int z=0;z<image.width();z++)
- {
- for(int k=0;k<image.height();k++)
- {
- for(int i=-1;i<2;i++)for(int j=-1;j<2;j++)
- {
- if(tablica[k][z]==1){if(tablica[k+i][z+j]==2){tablica[k][z]=2;}}
- }
- }
- }}
- for(int x=0;x<image.width();x++)
- {
- for(int y=0;y<image.height();y++)
- { for(int z=0;z<spectrum;z++){
- if(tablica[x][y]==2) {image(x,y,z)=kolor; visu(x,y,z)=60;}
- }}}
Add Comment
Please, Sign In to add comment