Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMHO Bug in AI-on-the-edge-device__update__v15.7.0 with reference pictures #2941

Closed
fft1010 opened this issue Feb 20, 2024 · 10 comments
Closed

Comments

@fft1010
Copy link

fft1010 commented Feb 20, 2024

Issue

EDIT: The below happened to be with firefox (which is very restricted in my settings). After reading you did some FE changes, I tried brave browser, and with brave Browser, I could get it to work.

EDIT2: Did not work. The firsttime the values where correct, but now the reference image is turned a little bit, as if the rotation angle is not taken into account, but if I take a picture in the settingns all looks fine.

brave-15-7-settings

But here after first calculation.

brave-15-7-first-calculation

No errors in the Logfiles. (Except miscalculations, which is expected as the reference is wrong.)

Hi,
I am brand new to this project, and did install AI-on-the-edge-device__update__v15.5.0, and it worked perfectly. I than decided to use the newest version (OTA update), which is 15.7. I red that I might have to redo the camera adjustment. I did so, as you can see here:
reference-image
which is the new reference image (looks the very same as the of 15.5, but a little darker.

I than check the digital marker aand analog marker, and they looked the same. I saved and I rebooted.

The first picture than looked like this in 15.7

screen-after-taking-picture

I tried around with the new 15.7, but without any luck. I than went back, to 15.5, and it worked immediately see:

screen-after-taking-picture-15-5

The differences that I notice: A little lighter (IMHO in the old version the LED Intensity was not taken into account. To mee it looks like, as if 15.7. is not doing the correct reference picture.

I am happy with version 15.5. Many many thanks for this. I just wanted to let you know.

If there is anything I could help with debugging, or if I am too damn stupid, please let me know.

thanks
Juergen

@SybexX
Copy link
Collaborator

SybexX commented Feb 20, 2024

As you have already noticed, the brightness of the image has changed,
this is due to the additional setting options for the reference image.
Due to the darker image, your aligment masks are apparently no longer recognized correctly.
If they are not detected correctly, there will be problems aligning the image, for some users there will be a shift and for others there will be a rotation of the image.
To solve this problem, you will have to experiment with the camera settings or set your aligment masks differently.

#2901 #2935

@fft1010
Copy link
Author

fft1010 commented Feb 21, 2024

Hi @SybexX ,
the darker image is the second problem. The real problem in the 15.7. for me is, that the image in the "setup" is shown correctly, but when taken for calculation, it is shown in the original not rotated version, and all the markers are off. To me it looks like, as if the new settings I put in in the reference setting for the markers, the analog and digit markers are not taken into account, as well as the roatation of the image. Check the rotation: I really doubt, that I made it to exactly rotate the camera in 180 degrees. But even if I rotate to 179 and back to 180 the image is shown correctly in the settings, but the used image in calculation is wrong. See:
image after first calculation:

brave-15-7-first-calculation

and see what is shown in the settings:

brave-15-7-settings

with verison 15.5 I have absolutely no problem in rotating, and setting of the markers...

thanks
Juergen

@fft1010
Copy link
Author

fft1010 commented Feb 21, 2024

Hi,
if I could check directly on the ESPS somewhere, than I could see what rotating numbers are used. What is shown in the settings seems to be different to what is used , IMHO. The used image seems to be the image without any rotation, like it is the first time, when taken.

thanks
Juergen

@Slider0007
Copy link
Collaborator

Slider0007 commented Feb 21, 2024

@fft1010:
For a test you could switch the alignment algo expert parameter to 'off' then only pure rotation angle gets applied, no additional image related pattern matching will be performed. The image will be rotated exactly by defined 180 degree, if no other bug is in place. For this use case no alignment marker needs to be set.

@fft1010
Copy link
Author

fft1010 commented Feb 21, 2024

@SybexX ,
after reading again your comment I have a question: So due to darker image, the alignment markers are not working any more, and the image is rotated only due to correct setting of the aligment marker? right?
I'll than try to get the image brighter, but I really wonder because even with 100% flash the image is much darker now. Are there other places I can make the image lighter? (I for sure played around with brightness/contrast), but I cannot get the image as "crispy" as with version 15.5

thanks
Juergen

@SybexX
Copy link
Collaborator

SybexX commented Feb 21, 2024

305455046-7c15fd2d-ac65-4d4a-9a4e-ed04f8ace655

@fft1010 The system searches for the aligment marks and to do this, the image is both rotated and shifted to x-y-axis.
If the system does not find them or recognize them correctly, the image will not be aligned correctly.
The contrast is obviously very important and is higher in a bright image.
When everything is perfectly aligned for me, I notice that the processing time is much shorter.

@fft1010
Copy link
Author

fft1010 commented Feb 21, 2024

Hi,
Auto Exposure 2 checked was giving me a black picture. But the Fixed Exposure seemed to have helped. But as I also changed one alignment marker, I am not 100% sure. Picture although is much more crispy, but not as crispy as in Version 15.5.
And I am 100% sure, that 180 degree is not the rotation angle my system has. But I do not know how I could find it out.

Many thanks for your help and this great program.

@fft1010 fft1010 closed this as completed Feb 21, 2024
@SybexX
Copy link
Collaborator

SybexX commented Feb 21, 2024

With (fine tune) you can adjust the angle of rotation more finely. Use the cross in the picture to see whether the set angle fits.

Unbenannt

@fft1010
Copy link
Author

fft1010 commented Feb 21, 2024

Hi @SybexX ,
I think this picture 4 above, where the picture is a little turned, is the original one, without rotation. So IMHO the 180 degrees are simply plain wrong. I do not know where this comes from. Maybe a default, or is the rotation only for finding the markers as a human? And ensuring for the system where is "up/down/left/right"? I am a little confused, for what the rotation is for, I assumed the system uses it, for getting the picture right, but it seem to me now, that the alignment markers are much much more taken into account.
but thanks a lot again. It now works.
Juergen

@SybexX
Copy link
Collaborator

SybexX commented Feb 21, 2024

The system looks for the Aligment marks and the image is rotated clockwise, counterclockwise or moved up, down, left and right, but you won't notice this because it is done internally and is not displayed on the page until it is finished the image on the page will be updated.
The alignment marks are cut out of the reference image and saved on the SD card (sd-card/config) and are then used for searching or comparing.
You need the 180° otherwise your picture would be upside down, like in picture 4. Picture 4 shows 0 degrees for you.
In order to relieve some of the load on the ESP and to improve the processing time, you should align the camera so that you don't have to use the rotation function.

the process is something like this:

  • make a picture
  • rotate around the set angle
  • look for the alignment marks
  • Cut out images based on the ROI coordinates (x, y dx, dy).
  • compare and evaluate the cut images with those stored in the model (dig-cont_0640_s3_q.tflite, ana-cont_1208_s2_q.tflite)
  • Put all the numbers together and edit them
  • output the value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants