python-cv-samples icon indicating copy to clipboard operation
python-cv-samples copied to clipboard

Not working for gauge-2.jpg

Open BhimasenPurohit opened this issue 4 years ago • 5 comments

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 ??

BhimasenPurohit avatar Oct 14 '19 06:10 BhimasenPurohit

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)

simoooB avatar Nov 04 '19 14:11 simoooB

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

alexmyczko avatar Feb 13 '20 05:02 alexmyczko

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

mainadwitiya avatar Jun 16 '21 07:06 mainadwitiya

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 avatar Sep 06 '22 16:09 adirsingh96

Solved the issue by increasing the threshold

adirsingh96 avatar Sep 07 '22 03:09 adirsingh96