intel-iot-devkit / python-cv-samples

Python computer vision samples
273 stars 216 forks source link

Not working for gauge-2.jpg #6

Open BhimasenPurohit opened 5 years ago

BhimasenPurohit commented 5 years ago

Hi, I executed code on gauge-1.jpg, and got results successfully. But If I run the same code for gauge-2.jpg which is in "images" folder, I am getting this error.

File "analog_gauge_reader.py", line 199, in get_current_value
    x1 = final_line_list[0][0]
IndexError: list index out of range

What I am missing ??

simoooB commented 5 years ago

Hi, I executed code on gauge-1.jpg, and got results successfully. But If I run the same code for gauge-2.jpg which is in "images" folder, I am getting this error.

File "analog_gauge_reader.py", line 199, in get_current_value
   x1 = final_line_list[0][0]
IndexError: list index out of range

What I am missing ?? Hi, There is some parameters to change to be able to catch/detect lines and compute and print the result. In some cases and under certain conditions, the algo cant find any lines that match the prerequisite that means there is no line founded in final_line_list and the algo detect an IndexError cause there is no element in the list. You can change parameters (UpperTreshold and LowerThreshold to try to have some lines detected and hoping to be the best one that you re looking for)

alexmyczko commented 4 years ago

would it work for non-linear displays? http://bootes.ethz.ch/gauge.jpg

mainadwitiya commented 3 years ago

Hi, I executed code on gauge-1.jpg, and got results successfully. But If I run the same code for gauge-2.jpg which is in "images" folder, I am getting this error.

File "analog_gauge_reader.py", line 199, in get_current_value
   x1 = final_line_list[0][0]
IndexError: list index out of range

What I am missing ?? Hi, There is some parameters to change to be able to catch/detect lines and compute and print the result. In some cases and under certain conditions, the algo cant find any lines that match the prerequisite that means there is no line founded in final_line_list and the algo detect an IndexError cause there is no element in the list. You can change parameters (UpperTreshold and LowerThreshold to try to have some lines detected and hoping to be the best one that you re looking for)

The lines are not coming under the acceptable range, that's why your final lsit is empty and hence list index out of range, will do a PR soon or upload the modified code on github soon. @mainadwitiya

adirsingh96 commented 2 years ago

Hi, I executed code on gauge-1.jpg, and got results successfully. But If I run the same code for gauge-2.jpg which is in "images" folder, I am getting this error.

File "analog_gauge_reader.py", line 199, in get_current_value
   x1 = final_line_list[0][0]
IndexError: list index out of range

What I am missing ?? Hi, There is some parameters to change to be able to catch/detect lines and compute and print the result. In some cases and under certain conditions, the algo cant find any lines that match the prerequisite that means there is no line founded in final_line_list and the algo detect an IndexError cause there is no element in the list. You can change parameters (UpperTreshold and LowerThreshold to try to have some lines detected and hoping to be the best one that you re looking for)

The lines are not coming under the acceptable range, that's why your final lsit is empty and hence list index out of range, will do a PR soon or upload the modified code on github soon. @mainadwitiya

Hey , is there any update on this?

adirsingh96 commented 2 years ago

Solved the issue by increasing the threshold