Commit c28649ff authored by limingzhe's avatar limingzhe

fix: debug

parent e83214d3
......@@ -266,10 +266,10 @@ cc.Class({
//调起检测
startTesting() {
// this.getPhotoData((data) => {
// this.photoEnd(data);
// });
// return;
this.getPhotoData((data) => {
this.photoEnd(data);
});
return;
const cw = window.courseware;
if (!cw || !cw.openOsmoHandwriting) {
......@@ -278,6 +278,13 @@ cc.Class({
return;
}
this.ques_region = [
0, 0.077,
1, 0.077,
1, 0.331,
0, 0.331,
]
const para = {
"library_id": "iplayabc",
'page_id': 5,
......@@ -2808,6 +2815,10 @@ cc.Class({
const y4 = y3;
const bbox = [{x1, y1}, {x2, y2}, {x3, y3}, {x4, y4}]
this.changeBboxPos(bbox);
const content = text[j];
bboxTextArr.push({bbox, content, score});
}
......@@ -2818,6 +2829,56 @@ cc.Class({
},
changeBboxPos(bbox) {
this.ques_region = [
0, 0.077,
1, 0.077,
1, 0.331,
0, 0.331,
]
console.log('bbox: ', bbox);
const x1 = bbox[0].x1;
const y1 = bbox[0].y1;
const x2 = bbox[1].x2;
const y2 = bbox[1].y2;
const x3 = bbox[2].x3;
const y3 = bbox[2].y3;
const x4 = bbox[3].x4;
const y4 = bbox[3].y4;
const left = this.ques_region[0];
const top = this.ques_region[1];
const right = this.ques_region[2];
const bottom = this.ques_region[7];
const rect = {x: left, y:top, width: right - left, height: bottom - top};
const y1_new = top + y1 * rect.height;
const y2_new = y1_new;
const y3_new = top + y3 * rect.height;
const y4_new = y3_new;
const x1_new = left + x1 * rect.width;
const x2_new = left + x2 * rect.width;
const x3_new = x2_new;
const x4_new = x1_new;
bbox[0].x1 = x1_new;
bbox[0].y1 = y1_new;
bbox[1].x2 = x2_new;
bbox[1].y2 = y2_new;
bbox[2].x3 = x3_new;
bbox[2].y3 = y3_new;
bbox[3].x4 = x4_new;
bbox[3].y4 = y4_new;
console.log('~~rect: ', rect);
},
setTestLabel(labelData) {
......@@ -3169,7 +3230,8 @@ cc.Class({
getPhotoData(cb) {
const tmpData1 = {"result":{"text":[{"left":0,"right":0.33299797773361206,"top":0.0971250981092453,"bottom":0.12354312092065811,"content":1,"text":"race,write,and say."},{"left":0.14084507524967194,"right":0.9476861357688904,"top":0.13131313025951385,"bottom":0.21445220708847046,"content":0.9066159129142761,"text":"AAAA-A-AA"},{"left":0.28470826148986816,"right":0.9315895438194275,"top":0.2735042870044708,"bottom":0.32867133617401123,"content":0.9610617756843567,"text":"aaaq qa"},{"left":0.03018108569085598,"right":0.6438632011413574,"top":0.37995338439941406,"bottom":0.41025641560554504,"content":1,"text":"Listen. Then write Aa or cross it out. o5"},{"left":0.636820912361145,"right":0.7655935883522034,"top":0.4755244851112366,"bottom":0.5314685106277466,"content":0.8729087710380554,"text":"Aa"},{"left":0.10663983970880508,"right":0.11167001724243164,"top":0.5788655877113342,"bottom":0.6021755933761597,"content":0.7464486360549927,"text":"4"},{"left":0.1589537262916565,"right":0.29074445366859436,"top":0.5936285853385925,"bottom":0.6596736311912537,"content":0.8887001872062683,"text":"Aa"},{"left":0.6549295783042908,"right":0.7786720395088196,"top":0.5920745730400085,"bottom":0.6643356680870056,"content":0.9307805895805359,"text":"Aa"},{"left":0.11267605423927307,"right":0.4034205377101898,"top":0.7700077891349792,"bottom":0.807303786277771,"content":1,"text":"Lusten and chant, bd"},{"left":0.28973841667175293,"right":0.7162978053092957,"top":0.9254079461097717,"bottom":0.9712509512901306,"content":0.9342746138572693,"text":"户藤미 Ow"},{"left":0.8158953785896301,"right":0.7203219532966614,"top":0.9611499905586243,"bottom":0.9370629191398621,"content":0.7845855951309204,"text":"0章"}]}}
const tmpData1 = {"result":{"text":[{"left":0.10519801825284958,"right":0.48514851927757263,"top":0.1924528330564499,"bottom":0.04150943458080292,"score":0.531991720199585,"content":"w9ani 2学"},{"left":0.11881188303232193,"right":0.5346534848213196,"top":0.2339622676372528,"bottom":0.5207546949386597,"score":0.8821592926979065,"content":"AAAA"},{"left":0.5061880946159363,"right":0.9863861203193665,"top":0.2037735879421234,"bottom":0.498113214969635,"score":0.9470328688621521,"content":"AAAAA"},{"left":0.13242574036121368,"right":0.9727723002433777,"top":0.7584905624389648,"bottom":0.9094339609146118,"score":0.9460853934288025,"content":"aaaaaaa00"}]}}
// const tmpData1 = {"result":{"text":[{"left":0,"right":0.33299797773361206,"top":0.0971250981092453,"bottom":0.12354312092065811,"content":1,"text":"race,write,and say."},{"left":0.14084507524967194,"right":0.9476861357688904,"top":0.13131313025951385,"bottom":0.21445220708847046,"content":0.9066159129142761,"text":"AAAA-A-AA"},{"left":0.28470826148986816,"right":0.9315895438194275,"top":0.2735042870044708,"bottom":0.32867133617401123,"content":0.9610617756843567,"text":"aaaq qa"},{"left":0.03018108569085598,"right":0.6438632011413574,"top":0.37995338439941406,"bottom":0.41025641560554504,"content":1,"text":"Listen. Then write Aa or cross it out. o5"},{"left":0.636820912361145,"right":0.7655935883522034,"top":0.4755244851112366,"bottom":0.5314685106277466,"content":0.8729087710380554,"text":"Aa"},{"left":0.10663983970880508,"right":0.11167001724243164,"top":0.5788655877113342,"bottom":0.6021755933761597,"content":0.7464486360549927,"text":"4"},{"left":0.1589537262916565,"right":0.29074445366859436,"top":0.5936285853385925,"bottom":0.6596736311912537,"content":0.8887001872062683,"text":"Aa"},{"left":0.6549295783042908,"right":0.7786720395088196,"top":0.5920745730400085,"bottom":0.6643356680870056,"content":0.9307805895805359,"text":"Aa"},{"left":0.11267605423927307,"right":0.4034205377101898,"top":0.7700077891349792,"bottom":0.807303786277771,"content":1,"text":"Lusten and chant, bd"},{"left":0.28973841667175293,"right":0.7162978053092957,"top":0.9254079461097717,"bottom":0.9712509512901306,"content":0.9342746138572693,"text":"户藤미 Ow"},{"left":0.8158953785896301,"right":0.7203219532966614,"top":0.9611499905586243,"bottom":0.9370629191398621,"content":0.7845855951309204,"text":"0章"}]}}
cb(tmpData1);
return;
const tmpData =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment