How can I print from the IDE into another software?

Hello! I have a code going right now that is continuously printing out the centroids of tracked objects to the OpenMV IDE terminal; however, I would really like to export those values to MATLAB for processing. Is this possible? If so, how can I do this? I’d appreciate any links or tutorials I can get. I’m very new to python! Thank you!! :smiley:

Hi, with the same script… Save that to the OpenMV Cam as main.py. see the tools → save script to OpenMV Cam.

Then reset your OpenMV Cam under the same menu in tools.

Finally, in MATLAB, open the serial port that your OpenMV appears as and you’ll get that debug text.

Thank you so much for your help! I do have another question, but it’s okay if you don’t have an answer. I am trying to get the sensor to find and locate stars. I’ve been able to get it to track small LED lights with the find_blobs command in grayscale since it just looks for bright spots. However, stars are so much dimmer and smaller, I can’t even see them in the buffer. Is there a way to change exposure, shutter, or ISO? I’d appreciate any ideas (: thank you again!

Please see the Examples → Sensor Control and look for the exposure control.

Hello again Nyamekye,

You have been such great help for my project! I have another question, but it might need a bit of context to answer:

I am designing a star tracker. The sensor so far has been able to pick up 1 or 2 stars through the find_blobs color tracking in Grayscale. However, it considers a lot of random ambient light spots around the edges “blobs”. I figured it’d be a little more accurate and less likely to pick up those areas if I was in YUV mode, since the Y is specifically brightness. Does the find_blobs command still work the same in YUV mode? And do I set the threshold the same way? And lastly, do you have any examples of this?

Thank you!

Hi, please switch to RGB565 mode and then use find_blobs. It will then use LAB thresholds like YUV.

That said, generally you need to filter the output of find-blobs(). Are the white spots on the boarder more than 1 pixel compared to the starts? If so, then reject them. Find blobs allows you to set a filter callback method in Python. You can also filter blobs after the list of blobs has been returned.

Maybe post an image so I can see what to do?

Okay, I attached a screenshot here. I drew the two arrows pointing at the actual stars. The rest is noise I think. I still have it on grayscale, but I will try your suggestion tomorrow night. I have also ordered a telephoto lens since most star trackers have a 10-12 degree FOV anyway. So that might help as well (:

Check this out:

http://book.pythontips.com/en/latest/map_filter.html

In particular, checkout the filter method. What you should do is filter out blobs with more than 5 pixels and more than 9 area, then check that the width and height are equal:

E.g:

list(filter(lambda x: x.pixels()==1 and x.w() == x.h() and x.w()*x.h() <= 9, img.find_blobs(...)))