Forums > Dev

[mods please delete this message]

September 20, 2006 | 2:53 am

Hi all,
ummm, oops. Don’t you love it when you spend 30 minutes typing up a huge forum post and then solving the problem 30 seconds after hitting "submit"? Disregard…

Mike


September 20, 2006 | 3:15 am

Hi Mike,
If you’re using OpenCV, you’d better get used to this max vanishing
with no trace thing. It’s not Jitter that’s doing it but OpenCV.
When OpenCV doesn’t get proper arguments to a function, it kills
everything. This really sucks and the way I’ve handled it is by doing
a looksee in the OpenCV source with the debugger to make sure that my
args are correct. I haven’t looked, but hopefully there are some
configuration params that can be set when initially compiling opencv
to prevent this heinous behavior. Otherwise, be very very careful.
Here’s an example:

I was makeing an ecternal with a convolution kernel. If the kernel
width was even, it would kill max, if it was odd I was fine. Seems
like a minor and trivial thing, but it ain’t minor when it kills max.

wes

On 9/19/06, Mike Sayre wrote:
>
> Hi all,
> I’ve posted about this before, but have yet to find a solution. I’ve been trying to write some externals – some of them for MSP, and now I’m trying to work with some Jitter externals. I was using MingW, but after having a lot of problems with weird crashes, I’ve switched to Visual Studio. However, I am still having the same problems.
> I took a Jitter object that I knew to compile correctly AND work in Max exactly as intended. I gutted it and changed some names around, but left the bones of the instantiation routine unaltered. It compiles + links with no problems. When I start Max, I can use the File->Install command without a crash. However, when I attempt to instantiate the object, Max just vanishes without any error messages and nothing in the syslog. I am sitting here with two monitors comparing the code from the working object and the non-working object, and I can’t find anything different about them other than names. This is obviously getting extremely frustrating. Can anyone tell me what’s wrong with this?
>
> < <<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>
> /*
> jit_haarCascade
> Mike Sayre
> mesayre@bsu.edu
>
> Created using the haar-like Features algorithms of OpenCV, modified for Jitter
>
> last modified: 18-9-2006
> */
>
> #include "jit.common.h"
> #include "max.jit.mop.h"
>
> typedef struct _max_jit_haarCascade
> {
> t_object ob;
> void *obex;
> } t_max_jit_haarCascade;
>
> t_jit_err jit_haarCascade_init(void);
>
> void *max_jit_haarCascade_new(t_symbol *s, long argc, t_atom *argv);
> void max_jit_haarCascade_free(t_max_jit_haarCascade *x);
> void *max_jit_haarCascade_class;
>
> void main(void)
> {
> void *p,*q;
>
> jit_haarCascade_init();
> setup(&max_jit_haarCascade_class, max_jit_haarCascade_new, (method)max_jit_haarCascade_free, (short)sizeof(t_max_jit_haarCascade),
> 0L, A_GIMME, 0);
>
> p = max_jit_classex_setup(calcoffset(t_max_jit_haarCascade,obex));
> q = jit_class_findbyname(gensym("jit_haarCascade"));
> max_jit_classex_mop_wrap(p,q,0);
> max_jit_classex_standard_wrap(p,q,0);
> addmess((method)max_jit_mop_assist, "assist", A_CANT,0);
> }
>
> void max_jit_haarCascade_free(t_max_jit_haarCascade *x)
> {
> max_jit_mop_free(x);
> jit_object_free(max_jit_obex_jitob_get(x));
> max_jit_obex_free(x);
> }
>
> void *max_jit_haarCascade_new(t_symbol *s, long argc, t_atom *argv)
> {
> t_max_jit_haarCascade *x;
> void *o;
>
> if (x=(t_max_jit_haarCascade *)max_jit_obex_new(max_jit_haarCascade_class,gensym("jit_haarCascade"))) {
> if (o=jit_object_new(gensym("jit_haarCascade"))) {
> max_jit_mop_setup_simple(x,o,argc,argv);
> max_jit_attr_args(x,argc,argv);
> } else {
> error("error in [max_jit_haarCascade_new]");
> freeobject(x);
> }
> }
> return (x);
> }
>
>
> < <<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>
>
> /*
> jit.haarCascade
> Mike Sayre
> mesayre@bsu.edu
>
> Created using the haar-like Features algorithms of OpenCV, modified for Jitter
>
> last modified: 19-9-2006
> */
>
> //Max includes
> #include "jit.common.h"
>
> //OpenCV includes
> #include "cv.h"
> #include "highgui.h"
>
> //System includes
> #include
> #include
> #include
> #include
> #include

> #include
> #include

> #include


September 20, 2006 | 4:04 am

Well, this time around it was nothing so sinister. I just forgot the following:

x = (t_jit_haarCascade *)jit_object_alloc(_jit_haarCascade_class);

…in my instantiation routine. Whoops. Boom. But it works now that I put that in there.

Anyway, I will try going through opencv in debug mode if I have any of those kinds of weird problems.

Thanks,
Mike


Viewing 3 posts - 1 through 3 (of 3 total)