Giter Site home page Giter Site logo

Comments (6)

brunoalr avatar brunoalr commented on May 19, 2024 1

Hi, @tonitch, thanks a lot for the well written report, I really appreciate it :)

Getting straight to the point: we currently only support a few opencv and eigen image/matrix classes out of the box. To support other image types, you have to follow https://github.com/OpenImageDebugger/OpenImageDebugger#advanced-configuration . Basically you have to implement a python interface that tells OID how to draw an image. @csantosbh wrote a blog post with more details about it, but I don't remember the link by heart. I will try to find it later.

I would suggest that you try compiling and debugging the testbench project in this repo. There we emulate cv::mat classes. Put a breakpoint on line 351 and you should be able to see the buffer.
Alternatively, you can try to replicate your tests with either opencv or eigen instead of stb.

Regarding arch: I currently have no plans of supporting distros other than Ubuntu since this is mostly a hobby project and I am barely able to properly maintain it as it is... But feel free to go and add it to aur.

if there is anything particular to know when packaging this project I would really apreciate to know ^^

The tricky part is qt. You gotta read their license very carefully to understand how this affect packaging of OID. Currently the installation relies on having qt installed as shared library (vi apt on ubuntu) and I am not entirely sure if we could just vendor the .so's in a package, for instance.
A suggestion is that you create as an entry point scripts (maybe called gdb-oid and lldb-oid) that wrap a call to gdb/lldb and import/source oid.py from it.

from openimagedebugger.

brunoalr avatar brunoalr commented on May 19, 2024 1

Found the blogpost: https://csantosbh.wordpress.com/2016/10/15/configuring-gdb-imagewatch-to-visualize-custom-buffer-types/#more-492

from openimagedebugger.

tonitch avatar tonitch commented on May 19, 2024

Thanks a lot for you fast response. I'v got a long week end ahead so I will try that next week. The project is really cool and is pretty much exactly what I was looking for (minus the fact that I'm not smart enought to make it work properly haha)

for the packaging, qt is in arch's package already and I have put it as a dependency so this should work properly and I don't think license is a problem as many other repo have it this way :)) (I just finished it : https://aur.archlinux.org/packages/openimagedebugger ) I will certainly do the entry point next week as well ^^

from openimagedebugger.

tonitch avatar tonitch commented on May 19, 2024

here is my solution for those who need

OpenImageDebugger/oidscripts/oidtypes/stb.py

from oidscripts.oidtypes import interface
from oidscripts.symbols import *

class STBInspector(interface.TypeInspectorInterface):

    def get_buffer_metadata(self,
                            obj_name,  # type: str
                            picked_obj,  # type: DebuggerSymbolReference
                            debugger_bridge  # type: BridgeInterface
                            ):

        width = 9
        height = 9
        comp = 4

        return {"display_name": obj_name,
                "pointer": picked_obj,
                "width": width,
                "height": height,
                "channels": 4,
                "type": OID_TYPES_UINT8,
                "row_stride": width,
                "pixel_layout": "rgba",
                "transpose_buffer": True}

    def is_symbol_observable(self, symbol_obj, symbol_name):
        # type: (DebuggerSymbolReference, str) -> bool
        return (str(symbol_obj.type) == "unsigned char *")

I has to be configured for each images but at least it's a start ^^

This project is really awesome and I think a way to improve it would be to configure it on the go. Like there would be a dropdown for each images format existing ( I could make one for raylib) and there would be a custom one where it would be possible to configure each parameter of the above list until you see your image. (I can make a separate and more specific issue if desired)

My "issue" is resolved so I will close it. Thanks for your help!

from openimagedebugger.

brunoalr avatar brunoalr commented on May 19, 2024

Thanks a lot for providing this example!

Like there would be a dropdown for each images format existing

For supported classes/structs (i.e. scripts under OpenImageDebugger/oidscripts/oidtypes/), this is done seamlessly.

and there would be a custom one where it would be possible to configure each parameter of the above list until you see your image. (I can make a separate and more specific issue if desired)

I think it would be nice to have this idea in a new issue indeed. It is slightly related to
#30 (a bit old, I know...), but there I was thinking about a command line interface to display "structless" images instead of proper GUI to it.

from openimagedebugger.

tonitch avatar tonitch commented on May 19, 2024

For supported classes/structs (i.e. scripts under OpenImageDebugger/oidscripts/oidtypes/), this is done seamlessly.

When there is no ambiguity in the type, this is clearly not a problem ^^ I was thinking about multiple specific libs that has similar pattern and couldn't be dissociated ^^

I think it would be nice to have this idea in a new issue indeed. It is slightly related to #30 (a bit old, I know...), but there I was thinking about a command line interface to display "structless" images instead of proper GUI to it.

I will play with oid for a while and then will come back to do that for sure !

from openimagedebugger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.