luxonis/depthai-unity

Full resolution Color image

BarnabasTakacs opened this issue · 9 comments

Thank you for these very nice demos indeed.
I noticed you are visualizing the low-resolution Preview of the color stream.

Is there a way to get the HD or even full 4K resolution from the camera? If so, where do we need to modify it? (At the moment when the Preview is turned off, we get no images at all)

Hi ! yes, usually color image preview is low-res (same input size of NN).

If you want to retrieve full res image, I'd suggest to take a look to the streams example and just modify the pipeline to retrieve full image instead of preview

https://github.com/luxonis/depthai-unity/blob/main/src/device/Streams.cpp

Just change the link from the camera node to output node

That said, I will try to work on the example itself so you can select the resolution from unity interface

Hi! Thank you for this repo.
Could you describe where it needs to be changed, the size of the image.("Just change the link from the camera node to output node") How to build the files? Because when I try, I always get an error.

Hi @balogistvan

Camera node has preview and normal output

You can find in line 56 of Streams.cpp

colorCam->preview.link(xlinkOut->input);

To build the plugin dll you need to follow the steps here:

https://github.com/luxonis/depthai-unity/blob/main/docs/Build_unity_lib.md

What errors are you getting?

Let me know if this info it's not enough, I will try to make the changes in a branch of the repo

Thanks for the answer. I'll try to build it and post the result here.

Hello. Now I am getting this error. Could this be because there is no depthai camera connected to the computer?

C:\Users\balog\depthai-unity\depthai-core\include\depthai/device/Device.hpp(67): error C2061: syntax error: identifier 'Device' [C:\Users\balog\depthai-unity\build\depthai-core\depthai-core.vcxproj] C:\Users\balog\depthai-unity\depthai-core\include\depthai/device/Device.hpp(67): error C2238: unexpected token(s) prece ding ';' [C:\Users\balog\depthai-unity\build\depthai-core\depthai-core.vcxproj] C:\Users\balog\depthai-unity\depthai-core\include\depthai/device/Device.hpp(97): fatal error C1903: unable to recover f rom previous error(s); stopping compilation [C:\Users\balog\depthai-unity\build\depthai-core\depthai-core.vcxproj] Generating Code...

And in line 56 of Streams.cpp colorCam->preview.link(xlinkOut->input);

The correct code is:
if (config->previewSizeWidth > 0 && config->previewSizeHeight > 0) { xlinkOut = pipeline.createdai::node::XLinkOut(); xlinkOut->setStreamName("preview"); colorCam->setPreviewSize(config->previewSizeWidth, config->previewSizeHeight); colorCam->color.link(xlinkOut->input); }

or: colorCam->normal.link(xlinkOut->input); } ?

Is there anything else that needs to be changed? Thank You.

Seems error compilation and it does NOT depends on depthai camera connected or not.

I see some typo here: xlinkOut = pipeline.createdai::node::XLinkOut

To choose another output from the colorcamera node you can check here: https://docs.luxonis.com/projects/api/en/latest/components/nodes/color_camera/?highlight=colorcamera

So in case to retrieve full res image you can use ->isp or ->still or even ->raw

Will try to setup a branch in next days

Dear Gerard. Can you upload a verson with full resolution images output? Thank You.

Hi @balogistvan ,

Please check branch https://github.com/luxonis/depthai-unity/tree/full-resolution-streams

As you can see in line 92 of DaiStreams.cs you need to setup resolution.

image

Thank You.