Option alignment algo off (#1924)

* Update edit_config_param.html

* Update ClassFlowAlignment.cpp
This commit is contained in:
Nicolas Liaudat
2023-02-03 21:01:43 +01:00
committed by GitHub
parent 69583db99e
commit 1d2f920819
2 changed files with 25 additions and 8 deletions

View File

@@ -65,7 +65,7 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
std::vector<string> splitted; std::vector<string> splitted;
int suchex = 40; int suchex = 40;
int suchey = 40; int suchey = 40;
int alg_algo = 0; int alg_algo = 0; //default=0; 1 =HIGHACCURACY; 2= FAST; 3= OFF //add disable aligment algo |01.2023
aktparamgraph = trim(aktparamgraph); aktparamgraph = trim(aktparamgraph);
@@ -130,6 +130,8 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
alg_algo = 1; alg_algo = 1;
if (toUpper(splitted[1]) == "FAST") if (toUpper(splitted[1]) == "FAST")
alg_algo = 2; alg_algo = 2;
if (toUpper(splitted[1]) == "OFF") //no align algo if set to 3 = off => no draw ref //add disable aligment algo |01.2023
alg_algo = 3;
} }
} }
@@ -145,7 +147,10 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
#endif #endif
} }
LoadReferenceAlignmentValues(); //no align algo if set to 3 = off => no draw ref //add disable aligment algo |01.2023
if(References[0].alignment_algo != 3){
LoadReferenceAlignmentValues();
}
return true; return true;
@@ -230,14 +235,22 @@ bool ClassFlowAlignment::doFlow(string time)
AlignAndCutImage->SaveToFile(FormatFileName("/sdcard/img_tmp/rot.jpg")); AlignAndCutImage->SaveToFile(FormatFileName("/sdcard/img_tmp/rot.jpg"));
} }
if (!AlignAndCutImage->Align(&References[0], &References[1]))
{ //no align algo if set to 3 = off //add disable aligment algo |01.2023
SaveReferenceAlignmentValues(); if(References[0].alignment_algo != 3){
} if (!AlignAndCutImage->Align(&References[0], &References[1]))
{
SaveReferenceAlignmentValues();
}
}// no align
#ifdef ALGROI_LOAD_FROM_MEM_AS_JPG #ifdef ALGROI_LOAD_FROM_MEM_AS_JPG
if (AlgROI) { if (AlgROI) {
DrawRef(ImageTMP); //no align algo if set to 3 = off => no draw ref //add disable aligment algo |01.2023
if(References[0].alignment_algo != 3){
DrawRef(ImageTMP);
}
tfliteflow.DigitalDrawROI(ImageTMP); tfliteflow.DigitalDrawROI(ImageTMP);
tfliteflow.AnalogDrawROI(ImageTMP); tfliteflow.AnalogDrawROI(ImageTMP);
ImageTMP->writeToMemoryAsJPG((ImageData*)AlgROI, 90); ImageTMP->writeToMemoryAsJPG((ImageData*)AlgROI, 90);
@@ -261,7 +274,10 @@ bool ClassFlowAlignment::doFlow(string time)
delete ImageTMP; delete ImageTMP;
ImageTMP = NULL; ImageTMP = NULL;
LoadReferenceAlignmentValues(); //no align algo if set to 3 = off => no draw ref //add disable aligment algo |01.2023
if(References[0].alignment_algo != 3){
LoadReferenceAlignmentValues();
}
return true; return true;
} }

View File

@@ -282,6 +282,7 @@ textarea {
<option value="default" selected>Default</option> <option value="default" selected>Default</option>
<option value="highAccuracy" >HighAccuracy</option> <option value="highAccuracy" >HighAccuracy</option>
<option value="fast" >Fast</option> <option value="fast" >Fast</option>
<option value="off" >Off</option><!-- add disable aligment algo |01.2023 -->
</select> </select>
</td> </td>
<td style="font-size: 80%;"> <td style="font-size: 80%;">