Preview image on the serial terminal

Hi there,
i remember i used
print(img.compressed_for_ide())
at the end of my code and then i was able to see the images on the serial terminal.

Now for some reason i am not able to run it with:
AttributeError: ‘Image’ object has no attribute 'compressed_for_ide

Why is this happening?

In addition i remember you where ready to launch an “ide viewer” so to customise a viewer to run the end users instead of the ide. Is this ready?

in addition open terminal doesnt print any of the print fuctions when connected to the camera.
like print(clock.fps()).
Fps appears inside the serial terminal of the ide but not in the open terminal window…
Maybe i miss something i have almost 2 years to deal with the open terminal.

i dont know whats wrong today.
But neither the:
tv.display(img,0,0,1.6,1.2)
seams to work anymore!
it says TypeError: extra positional arguments given.
This was working fine also before 2 years…
Maybe i missed some major change?

Hi, yes, the scales need to be keyword arguments. We’ve been refactoring the API.

tv — tv shield driver — MicroPython 1.23 documentation (openmv.io)

Also, note that the TV driver will be refactored into the display module eventually to make it an object.

tv.display(img,0,0,x_scale=1.6,y_scale=1.2)

This was changed a while back.

Comrpessed for IDE has been removed, the functionality is still there:

Do:

.to_jpeg(encode_for_ide=True, copy=True)

image — machine vision — MicroPython 1.23 documentation (openmv.io)

This is recent in the latest release.

Note, the old compressed_for_ide() was calling the new function internally. So, the behavior should be the same.

We haven’t heard of many folks using this feature so we decided to refactor it completely. We are getting very tight on firmware space; as such, maintaining backward compatibility and old APIs is starting to cost.

That said, we have not removed any functionality, there’s just a new way to do things.

1 Like

It would appear in the Open Terminal window unless you connected to the IDE normally.

Support for the IDE viewer mode was partially completed. However, the client paying for the feature deemphasized that it needed to get done soon. Given that, I’ve been busy on other activities to generate future revenue for OpenMV. It’s still on the todo list when I get into an update IDE phase.

See the command line args for the IDE. If you pass the -viewer_mode many of the elements will be removed. But, I’m only 25% of the way removing things in that mode.

there is no -viewer_mode as i see…

there still nothing in open terminal.
it prints only the first lines:
OpenMV v4.5.5; MicroPython v1.22-omv.r22; OPENMV4-STM32H743

Type “help()” for more information.

After that nothing else. no image no simple fps txt.

Yeah i tried that and it works. note that i must use keyword arguments for the position too to work.

Hi, the latest release has the -viewer_mode argument. I thought you were asking about that and had updated to it already.

I’ll debug the terminal. Pretty sure that should be fine though…

yeah indeed.
But didn’t notice that you released new soft.
I tried and it works.
But as you said there is a lot of stuff there.
I notice that the play button is missing though and i think that only this will be needed!

Despite that open terminal refuse to cooperate.
Connection established but after hitting play only the first few lines appear.

Hi, play is removed from viewer mode as the script editor will be removed. You should have a script already programmed on the system you are connecting to. The idea is that the IDE is just connecting to the system to pull the frame buffer and nothing more.

Despite that open terminal refuse to cooperate.
Connection established but after hitting play only the first few lines appear.

Will check and debug.

Open Terminal works as expected with the latest firmware, not sure what’s wong on your end. This is over USB though:

1 Like

It’s virtually impossible to detect these bots anymore. @kwagyeman

Which bots my friend?

Not you, an AI spam bot that we blocked.

1 Like

Maybe I miss something obviously. I will try again on Monday. I will double check port settings and try other port maybe . I noticed the argument -open_serial_terminal too. Is this to open direct the open terminal? I tried but everytime gives me syntax error no matter what I try. There is no examples too.

You can’t send a script when you open a terminal from the command line. It’s just a normal serial terminal. The run button if clicked will tell the camera to run main.py on it’s disk.

What I showed earlier was launching it from the IDE which then let’s you send the script from the IDE text editor.

That said, typically, this feature is hardly used. What are you trying to do?

i will give up.
I am troubleshooting almost a week something that worked for years. something so simple.
open terminal refuse to co operate.
I tried varius cams, global shutter, varius cables, varius pcs, varius scripts.
Nothing works.

I dont know if its simple anymore. Usually was plug and play routine.
Open terminal doesnt print anything. Neither the fps from hello world example refuse to print.
In addition

print(img.to_jpeg(encode_for_ide=True))

drops fps to 0.5 from 120 without it!
After that the whole ide crashes as soon as i hit the stop button.
Then have to hard reset the camera to connect again…

Note that i have only h7 r2 cameras…

The reason i want it is to have just the preview of the image for an application i want to evaluate.
I dont want the user to deal with the ide and everything that is inside it.
If the viewer mode was ready i wouldnt try to connect with the open terminal…

I know that ethernet, wifi, and tv shields can give me such results but i dont want to use a shield for that now.

It used to work but i cant make it now.