Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28310 > unrolled thread

need code java of RLSA - Run Length Smoothing Algorithm

Started byysr88 <yusragharbi@hotmail.fr>
First post2014-04-29 13:14 -0500
Last post2014-04-29 21:10 -0400
Articles 2 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  need code java of RLSA - Run Length Smoothing Algorithm ysr88 <yusragharbi@hotmail.fr> - 2014-04-29 13:14 -0500
    Re: need code java of RLSA - Run Length Smoothing Algorithm Arne Vajhøj <arne@vajhoej.dk> - 2014-04-29 21:10 -0400

#28310 — need code java of RLSA - Run Length Smoothing Algorithm

Fromysr88 <yusragharbi@hotmail.fr>
Date2014-04-29 13:14 -0500
Subjectneed code java of RLSA - Run Length Smoothing Algorithm
Message-ID<DfidnXetRf5odsLOnZ2dnUVZ_q-dnZ2d@giganews.com>
this is a version of RLSA - Run Length Smoothing Algorithm in c++

int hor_thres = 22;
int one_count = 0;
int zero_flag = 0;
Mat tmpImg = Mat(Img.size(), CV_8UC1, Scalar(0, 0, 0));
for (int j = 0; j<Img.rows; j++){
    for (int i = 0; i<Img.cols; j++){
        if (Img.at<uchar>(j, i) == 0)
        {
            if (zero_flag == 1)
            {
                if (one_count <= hor_thres)
                {           
                    tmpText(cv::Range(j - zero_count, j), cv::Range(i, i+1)).setTo(cv::Scalar::all(255));
                    // I want to do the same thing in Matlab as this  image(i,j-one_count:j-1)=0;
                }
                else
                {
                    zero_flag = 1;
                }
                one_count = 0;
            }
            zero_flag = 1;
        }
        else
        {
            if (zero_flag == 1)
            {
                one_count = one_count + 1;
            }
        }
    }
}
--
ysr88
http://compgroups.net//

[toc] | [next] | [standalone]


#28318

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-04-29 21:10 -0400
Message-ID<53604da0$0$298$14726298@news.sunsite.dk>
In reply to#28310
On 4/29/2014 2:14 PM, ysr88 wrote:
> this is a version of RLSA - Run Length Smoothing Algorithm in c++
>
> int hor_thres = 22;
> int one_count = 0;
> int zero_flag = 0;
> Mat tmpImg = Mat(Img.size(), CV_8UC1, Scalar(0, 0, 0));
> for (int j = 0; j<Img.rows; j++){
>      for (int i = 0; i<Img.cols; j++){
>          if (Img.at<uchar>(j, i) == 0)
>          {
>              if (zero_flag == 1)
>              {
>                  if (one_count <= hor_thres)
>                  {
>                      tmpText(cv::Range(j - zero_count, j), cv::Range(i, i+1)).setTo(cv::Scalar::all(255));
>                      // I want to do the same thing in Matlab as this  image(i,j-one_count:j-1)=0;
>                  }
>                  else
>                  {
>                      zero_flag = 1;
>                  }
>                  one_count = 0;
>              }
>              zero_flag = 1;
>          }
>          else
>          {
>              if (zero_flag == 1)
>              {
>                  one_count = one_count + 1;
>              }
>          }
>      }
> }

If you need the Java code, then you better start writing some Java code.

It is neither likely that someone would want to write your code for free
or be able to write your code (it looks like it uses some library that
is not part of standard C++).

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web