I am using Zivid.NET, Halcon.NET and ML.NET together. Zivid provides me with a 3D byte array (row, column, channel), Halcon uses HImages
/HObjects
, ML.NET functionality expects a 1D byte array (same as File.ReadAllBytes()
)
So far I used a workaround where:
- I
save()
'd Zivid'simageRGBA
as a PNG, - which I read with Halcon's
read_image()
that gives me aHObject
. - After some graphical work I saved the
HObject
again as a PNG usingwrite_image()
. - Using
File.ReadAllBytes()
to read that PNG I get thebyte[]
that my ML.NET functionalities expect.
But this is far from ideal with larger amounts of data.
What I need is:
- a way to convert
byte[r,c,c]
images toHObject
/HImage
. - a way to convert
HObject
/HImage
images tobyte[]
.
Halcon's read_image()
and write_image()
don't seem to have any options for this and I haven't found anything helpful so far.