|
@@ -9,7 +9,7 @@
|
|
<!-- ## Template to place in the header (example: Extract-configurator) ## -->
|
|
<!-- ## Template to place in the header (example: Extract-configurator) ## -->
|
|
</template>
|
|
</template>
|
|
|
|
|
|
- <template v-if="reconstructedImage" v-slot:content>
|
|
|
|
|
|
+ <template v-if="extracts" v-slot:content>
|
|
<!-- ## Actual experiment template ## -->
|
|
<!-- ## Actual experiment template ## -->
|
|
|
|
|
|
<!-- Image -->
|
|
<!-- Image -->
|
|
@@ -17,7 +17,7 @@
|
|
<v-card dark color="primary">
|
|
<v-card dark color="primary">
|
|
<v-card-text class="px-0">Reconstructed image</v-card-text>
|
|
<v-card-text class="px-0">Reconstructed image</v-card-text>
|
|
<v-container class="pa-1">
|
|
<v-container class="pa-1">
|
|
- <ExtractsToImage :extracts="reconstructedImage" :extract-config="extractConfig" />
|
|
|
|
|
|
+ <ExtractsToImage :extracts="extracts" :extract-config="extractConfig" />
|
|
</v-container>
|
|
</v-container>
|
|
</v-card>
|
|
</v-card>
|
|
</v-flex>
|
|
</v-flex>
|
|
@@ -52,7 +52,6 @@ import { EXPERIMENT as experimentMsgId } from '@/../config.messagesId'
|
|
import { rand } from '@/functions'
|
|
import { rand } from '@/functions'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- name: 'IsImageCorrectOneExtract', // experiment filename
|
|
|
|
components: {
|
|
components: {
|
|
ExperimentBlock,
|
|
ExperimentBlock,
|
|
ExtractsToImage
|
|
ExtractsToImage
|
|
@@ -62,11 +61,6 @@ export default {
|
|
],
|
|
],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- experimentName: 'IsImageCorrectOneExtract', // experiment filename
|
|
|
|
- refImage: null,
|
|
|
|
- randImage: null,
|
|
|
|
- reconstructedImage: null,
|
|
|
|
- selectedQuality: 50,
|
|
|
|
testCount: 1,
|
|
testCount: 1,
|
|
maxTestCount: 10
|
|
maxTestCount: 10
|
|
}
|
|
}
|
|
@@ -85,7 +79,7 @@ export default {
|
|
// Load scene qualities list
|
|
// Load scene qualities list
|
|
await this.getQualitiesList()
|
|
await this.getQualitiesList()
|
|
|
|
|
|
- if (!this.reconstructedImage) await this.getReconstructedImage()
|
|
|
|
|
|
+ if (!this.extracts) await this.getReconstructedImage()
|
|
}
|
|
}
|
|
catch (err) {
|
|
catch (err) {
|
|
console.error(err)
|
|
console.error(err)
|
|
@@ -106,26 +100,25 @@ export default {
|
|
// load reconstructed image
|
|
// load reconstructed image
|
|
async getReconstructedImage() {
|
|
async getReconstructedImage() {
|
|
const randomQuality = this.qualities[rand(0, this.qualities.length - 1)]
|
|
const randomQuality = this.qualities[rand(0, this.qualities.length - 1)]
|
|
- const maxQuality = this.qualities[this.qualities.length - 1]
|
|
|
|
|
|
|
|
// Get the reference image, extracts of reference image and random quality extracts
|
|
// Get the reference image, extracts of reference image and random quality extracts
|
|
- const [maxExtracts, randomExtracts, maxImage, randImage] = await Promise.all([
|
|
|
|
|
|
+ const [maxExtracts, randomExtracts] = await Promise.all([
|
|
this.getExtracts('max'),
|
|
this.getExtracts('max'),
|
|
- this.getExtracts(randomQuality),
|
|
|
|
- this.getImage(maxQuality),
|
|
|
|
- this.getImage(randomQuality)
|
|
|
|
|
|
+ this.getExtracts(randomQuality)
|
|
])
|
|
])
|
|
|
|
|
|
- this.refImage = maxImage
|
|
|
|
- this.randImage = randImage
|
|
|
|
|
|
+ this.extractsInfos = {
|
|
|
|
+ refImage: maxExtracts.info,
|
|
|
|
+ randImage: randomExtracts.info
|
|
|
|
+ }
|
|
|
|
|
|
// get part to keep into refImage
|
|
// get part to keep into refImage
|
|
- let position = rand(0, randomExtracts.extracts.length)
|
|
|
|
|
|
+ let position = rand(0, randomExtracts.extracts.length - 1)
|
|
this.randZonePosition = position
|
|
this.randZonePosition = position
|
|
|
|
|
|
// construct new image with two different parts
|
|
// construct new image with two different parts
|
|
maxExtracts.extracts[position] = randomExtracts.extracts[position]
|
|
maxExtracts.extracts[position] = randomExtracts.extracts[position]
|
|
- this.reconstructedImage = maxExtracts.extracts
|
|
|
|
|
|
+ this.extracts = maxExtracts.extracts
|
|
},
|
|
},
|
|
|
|
|
|
// get next reconstructed image
|
|
// get next reconstructed image
|
|
@@ -136,8 +129,8 @@ export default {
|
|
this.testCount++
|
|
this.testCount++
|
|
|
|
|
|
const experimentalData = {
|
|
const experimentalData = {
|
|
- refImage: this.refImage,
|
|
|
|
- randImage: this.randImage,
|
|
|
|
|
|
+ refImage: this.extractsInfos.refImage,
|
|
|
|
+ randImage: this.extractsInfos.randImage,
|
|
randZoneId: this.randZonePosition,
|
|
randZoneId: this.randZonePosition,
|
|
imageCorrect: correct,
|
|
imageCorrect: correct,
|
|
stepCounter: this.testCount,
|
|
stepCounter: this.testCount,
|