heliostat project

Here I tried to integrate the last suggestions (with the latest firmware!) but I don’t see any progress, I guess it is because of my poor coding? I attached the part where the tracking should take place
post.txt (1.08 KB)

You want me to review your code and improve it?

I know that is a lot to ask. But if you could take a look again that would be really great.

You’ll find the entire code attached
draft-24.py (3.43 KB)

I’m having a little trouble with the find “largest blob” code … any suggestions?

blob_list =  img.find_blobs([(120,160),(120,160),(120,160)], [0,0,320,240], x_stride=2, y_stride=1, invert=False, area_threshold=10, pixels_threshold=10, merge=False, margin=0, threshold_cb=None, merge_cb=None):
        largest_blob = max(blob_list, key = lambda x: x.pixels())
        print(largest_blob[4])

Right now, I’m trying to just debug to make sure that this works before moving on … shouldn’t the print statement just output the largest_blob’s pixel size?

Thanks.

Do:

Print(largest_blob.pixels()).

Not sure what the trouble you are having is.

blob_list = img.find_blobs([(120,160),(120,160),(120,160)], [0,0,320,240], x_stride=2, y_stride=1, invert=False, area_threshold=10, pixels_threshold=10, merge=False, margin=0, threshold_cb=None, merge_cb=None)
largest_blob = max(blob_list, key = lambda x: x.pixels())
Print(largest_blob.pixels())

and I get this error:

ValueError: arg is an empty sequence

And it’s pointing at

largest_blob = max(blob_list, key = lambda x: x.pixels())

line


EDIT:
Those thresholds are just general values and are just there for testing… and I’m trying to just use the entire image for the roi, again for testing.

So, blob_list is empty. Thus, find blobs must not be finding anything. Please print blob_list and see if it’s not empty.

Hmmm … ok. Yup. blob_list is empty.
I guess I have my thresholds wrong?

Probably, the sun is usually 255 valued pixels.