2019-03-26 22:01:10 +02:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
import Vuex from 'vuex'
|
|
|
|
|
|
|
|
|
|
Vue.use(Vuex);
|
|
|
|
|
const set = key => (state,val) =>{
|
|
|
|
|
state[key] = val
|
2019-03-31 22:52:38 +03:00
|
|
|
};
|
2019-03-26 22:01:10 +02:00
|
|
|
export const store = new Vuex.Store({
|
|
|
|
|
|
|
|
|
|
state:{
|
2019-03-26 22:28:58 +02:00
|
|
|
//header
|
|
|
|
|
camera:0,
|
|
|
|
|
pipeline:0,
|
|
|
|
|
//input
|
2019-03-27 23:12:15 +02:00
|
|
|
exposure:54,
|
2019-03-26 22:01:10 +02:00
|
|
|
brightness:0,
|
|
|
|
|
orientation:0,
|
2019-03-26 22:28:58 +02:00
|
|
|
resolution:0,
|
|
|
|
|
//threshold
|
|
|
|
|
hue:[0,10],
|
|
|
|
|
saturation:[0,10],
|
2019-04-20 22:49:44 +03:00
|
|
|
value:[0,10],
|
|
|
|
|
erode: false,
|
|
|
|
|
dilate: false,
|
|
|
|
|
//contours
|
|
|
|
|
area:[0,100],
|
|
|
|
|
ratio:[0,0],
|
|
|
|
|
extent:[0,100]
|
|
|
|
|
|
2019-03-26 22:01:10 +02:00
|
|
|
},
|
|
|
|
|
mutations:{
|
2019-03-31 22:52:38 +03:00
|
|
|
camera (state,value){
|
|
|
|
|
state['camera'] = value;
|
|
|
|
|
state['pipeline'] = "0";
|
|
|
|
|
},
|
2019-03-26 22:28:58 +02:00
|
|
|
pipeline: set('pipeline'),
|
2019-03-26 22:01:10 +02:00
|
|
|
brightness: set('brightness'),
|
|
|
|
|
exposure: set('exposure'),
|
|
|
|
|
orientation:set('orientation'),
|
2019-03-26 22:28:58 +02:00
|
|
|
resolution: set('resolution'),
|
|
|
|
|
hue: set('hue'),
|
|
|
|
|
saturation: set('saturation'),
|
2019-04-20 22:49:44 +03:00
|
|
|
value: set('value'),
|
|
|
|
|
erode: set('erode'),
|
|
|
|
|
dilate: set('dilate'),
|
|
|
|
|
area: set('area'),
|
|
|
|
|
ratio: set('ratio'),
|
|
|
|
|
extent: set('extent')
|
2019-03-26 22:01:10 +02:00
|
|
|
},
|
|
|
|
|
getters:{
|
2019-03-26 22:28:58 +02:00
|
|
|
camera: state => state.camera,
|
|
|
|
|
pipeline: state => state.pipeline,
|
2019-03-26 22:01:10 +02:00
|
|
|
brightness: state => state.brightness,
|
|
|
|
|
exposure: state => state.exposure,
|
|
|
|
|
orientation: state => state.orientation,
|
2019-03-26 22:28:58 +02:00
|
|
|
resolution: state => state.resolution,
|
|
|
|
|
hue: state => state.hue,
|
|
|
|
|
saturation: state => state.saturation,
|
|
|
|
|
value: state => state.value,
|
2019-04-20 22:49:44 +03:00
|
|
|
erode: state => state.dilate,
|
|
|
|
|
dilate: state => state.dilate,
|
|
|
|
|
area: state =>state.area,
|
|
|
|
|
ratio: state =>state.ratio,
|
|
|
|
|
extent: state =>state.extent
|
2019-03-26 22:01:10 +02:00
|
|
|
},
|
|
|
|
|
});
|