public static RleElement[] createArray(int i_length)
 {
     RleElement[] ret = new RleElement[i_length];
     for (int i = 0; i < i_length; i++)
     {
         ret[i] = new RleElement();
     }
     return(ret);
 }
        public NyARLabeling_Rle(int i_width, int i_height)
        {
            this._rlestack = new RleInfoStack(i_width * i_height * 2048 / (320 * 240) + 32);
            this._rle1     = RleElement.createArray(i_width / 2 + 1);
            this._rle2     = RleElement.createArray(i_width / 2 + 1);
            setAreaRange(AR_AREA_MAX, AR_AREA_MIN);

            return;
        }
 public NyARLabeling_Rle(int i_width, int i_height)
 {
     this._raster_size.setValue(i_width, i_height);
     this._rlestack = new RleInfoStack(i_width * i_height * 2048 / (320 * 240) + 32);
     this._rle1     = RleElement.createArray(i_width / 2 + 1);
     this._rle2     = RleElement.createArray(i_width / 2 + 1);
     this._max_area = AR_AREA_MAX;
     this._min_area = AR_AREA_MIN;
     return;
 }
Beispiel #4
0
        protected void initInstance(int i_width, int i_height)
        {
            this._raster_size.setValue(i_width, i_height);
            //120KB/QVGA +4K
            long t = (long)i_width * i_height * 3000 / (320 * 240) + 100;//full HD support

            this._rlestack = new RleInfoStack((int)t);
            this._rle1     = RleElement.createArray(i_width / 2 + 1);
            this._rle2     = RleElement.createArray(i_width / 2 + 1);
            this._max_area = AR_AREA_MAX;
            this._min_area = AR_AREA_MIN;
            return;
        }
        private void addFragment(RleElement i_rel_img, int i_nof, int i_row_index, RleInfoStack o_stack)
        {
            int l   = i_rel_img.l;
            int len = i_rel_img.r - l;

            i_rel_img.fid = i_nof;// REL毎の固有ID
            RleInfoStack.RleInfo v = o_stack.prePush();
            v.entry_x = l;
            v.area    = len;
            v.clip_l  = l;
            v.clip_r  = i_rel_img.r - 1;
            v.clip_t  = i_row_index;
            v.clip_b  = i_row_index;
            v.pos_x   = (len * (2 * l + (len - 1))) / 2;
            v.pos_y   = i_row_index * len;

            return;
        }
        private bool addFragment(RleElement i_rel_img, int i_nof, int i_row_index, RleInfoStack o_stack)
        {
            int l   = i_rel_img.l;
            int len = i_rel_img.r - l;

            i_rel_img.fid = i_nof;// REL毎の固有ID
            NyARRleLabelFragmentInfo v = o_stack.prePush();

            if (v == null)
            {
                return(false);
            }
            v.entry_x = l;
            v.area    = len;
            v.clip_l  = l;
            v.clip_r  = i_rel_img.r - 1;
            v.clip_t  = i_row_index;
            v.clip_b  = i_row_index;
            v.pos_x   = (len * (2 * l + (len - 1))) / 2;
            v.pos_y   = i_row_index * len;

            return(true);
        }