boechat107 / eye-boof

Clojure image processing library based on BoofCV.
7 stars 3 forks source link

Can't require processing or helpers namespaces #5

Open dmarjenburgh opened 10 years ago

dmarjenburgh commented 10 years ago

Right now the code is a mix between the old and new versions. There are a lot of functions in processing.clj that simply do not work. I would like to use the canny-edges for example, but the namespace won't load, nor is that function it available elsewhere.

It looks like the code needs some cleanup. Do you have in mind what the new structure should look like?

boechat107 commented 10 years ago

Unfortunately, you are completely right!

I started the old version when I was starting to learn Clojure and I was in a big hurry. For now, only the documented namespaces are guaranteed to work.

I expect that eye-boof provides only the high level functions of BoofCV. Although only 8bits-integer images were been used, implementing protocols for other image types could be a good choice (do you have any suggestions?). The namespace structure could be something like this:

If you have any suggestion or if you want to help me coding, I would be very glad.

dmarjenburgh commented 10 years ago

Sure, I'd love to help out. I'm not yet very familiar with BoofCV myself though.

BoofCV has broken up the library in the following artifacts (source):

Plus other extras: android, openkinect, processing, v4l4j, WebcamCapture, xuggler But the list includes all the core functionality. Right now, there is only a dependency on org.boofcv/ip in project.clj, which is why some namespaces won't load.

I think you should consider which functionalities you want to support. I think it's easiest if we require all the core functionality above (not the extras). If it becomes to big, you can split it out into smaller pieces later (similar to what ring does).

For the namespace structure. I like having the public api namespaces at the top: eye-boof.core, eye-boof.ops, etc (not too many) The implementation details can go to eye-boof.impl.ops for example.

The visualization module contains functions to show a JFrame with the image (much like the imagez library from mikera). It would be nice if we can create an IShow protocol and extend it not only to the boofcv image types, but also to BufferedImage.

boechat107 commented 10 years ago

Great! Probably some namespaces need the packages io and geo. There was a primitive implementation of a visualization module, whose main function accept BoofCV data structures and BufferedImage.

And I agree with about keeping just a small number of public namespaces. Following the OpenCV modules, for example, we could start implementing the core, processing and visualize namespaces.

dmarjenburgh commented 10 years ago

Maybe starting with io is simplest. We need to load files anyway. Right now eye-boof.io contains custom functions for loading images, but boofcv has its own useful functions in io that can be wrapped.

By the way, there's already a lot implemented in some form or another. How set are you upon maintaining backwards compatibility?

ivar commented 8 years ago

So I'm really late to the party, but I'm trying to learn Clojure by building a simple CV project. My intention was to use eye-boof but I can't even get it work in place of 'clj-http' in the (Leiningen Tutorial)[https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#artifact-ids-groups-and-versions].. when I try to require it in a REPL I get :

my-stuff.core=> (require `[eye-boof :as boof])

FileNotFoundException Could not locate eye_boof__init.class or eye_boof.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.  clojure.lang.RT.load (RT.java:449)

Is it worth continuing my investigations of eye-boof ? I don't want to waste anyone's time asking questions that will never lead to anything, but on the other hand this seems like a cool place to start.

boechat107 commented 8 years ago

Hi, @ivar.

Although I didn't have time to update the project ultimately, you could use it for some simple applications (like those on the Readme page).

The code that you posted is not expected to work because there is no namespace called just eye-boof. Try (require '[eye-boof.core :as boof]) instead, eye-boof.core is the complete name of an existing namespace, for example. There is another way of requiring multiple namespaces:

(require '[eye-boof [core :as eb-core]
                    [io :as eb-io]])

Is it clearer now? ;-)