R
R
RommB2021-12-02 13:58:08
Kotlin
RommB, 2021-12-02 13:58:08

How to compare numbers from one Activity and write a larger value to another Activity?

Android Studio (Kotlin). I have an Activity in which I entered data and received a response. If I enter new data, I get a response and they are greater than the first ones, then I need to display them in the first Activity

Answer the question

In order to leave comments, you need to log in

7 answer(s)
J
Jacen11, 2021-12-02
@Jacen11

Android Studio (Kotlin).
is this what you mean?
I have an Activity in which I entered data and received a response.
ok, okay
If I enter new data, I get a response and they are greater than the first ones, then I need to display them in the first Activity
clear, clear
iiiii, what? Well, take and compare. What's the question? here is the greater than sign >, the data is transferred to the other activity intent. All this is described literally on the first pages of anything
https://yandex.ru/search/?clid=2186621&text=%D0%BA...

M
mitaichik, 2015-05-14
@mitaichik

Who cares: to recognize such a captcha is not so difficult: the only problem is the presence of a sphere effect.
First we need to calculate the center and radius of the sphere. For this, the "grid" that is on the captcha will help us.
First we need to remove the gradient, because in the middle of the captcha it can merge with the grid. The gradient has a fairly linear dependence, so it is easy to calculate y to remove.
Then you need to calculate the coordinates of the grid lines. I did this with a bottom and right edge pass. The color of the grid pixels is approximately the same (with a very small spread), so they are easy to isolate.
Then, passing along the grid lines, it is calculated where they move in one direction or another - this is actually the beginning of the sphere effect. Having 3 such coordinates (right / left and from the bottom or top), you can calculate its radius and center.
The next step is image binarization. To do this, you can apply posterization and threshold binarization. The first one, alas, works very stupidly (you can only specify the number of colors), the second one is more customizable, so I used it.
Next, we get a black and white source of numbers, but with empty pixels from the grid, and still with a sphere effect.
The next step is to remove the sphere effect. This is elementary, because we know its parameters.
Next, we need to "recover" empty pixels from the grid. At first I thought to use dilitation, but the distance between the numbers does not allow it. Then I thought to use the centers of gravity, so that they would shrink the numbers, as it were, removing the voids, but I did not find an algorithm for this. As a result, I wrote my own algorithm, which works much better (since it takes into account the coordinates of the grid lines, unlike simple dilitation).
Almost normal numbers are obtained. Segmentation - wrote his own algorithm, rather stupid, nothing complicated.
After all, we get broken numbers. I set FANN on this for everything. At first I trained him with the help of anti-gate, now he works as it should.
As a result, captchas are recognized with an acceptable result. The coolest thing is that everything you need can be easily done with imagemagick.
But there are 2 problems: If the mesh is too dense, then when the sphere effect is applied, it wildly curves, which makes it difficult to find the beginning of its displacement. Plus, if it is possible to calculate only 2 coordinates of the beginning of the sphere, it is not possible to accurately calculate its center along the vertical axis. All this affects the percentage of recognition.
But Russian Railways makes it possible to request a new captcha, very quickly, and it turns out that on average, in 3 recognition attempts, it can be bypassed in any case (but usually less).
Naturally, this all takes time, but time in my case is not so critical, since Russian Railways in the forehead gives an answer from 10 to 40 seconds - users are already used to this, and the extra 2 seconds will not play a role.
Something like that...

K
KorsaR-ZN, 2015-05-13
@KorsaR-ZN

And why are you not considering the option
of showing this captcha to service users, let them recognize it themselves?

M
Mikhail Lyalin, 2015-05-13
@mr_jok

establish cooperation with Russian Railways

C
Coderast, 2015-05-19
@Coderast

RZD fucking ticketing app

Sorry for offtopic, smiled)

M
Max, 2015-05-13
@AloneCoder

https://anti-captcha.com/

V
Valery Matvienko, 2015-06-04
@Midas

We have an algorithm for recognizing this captcha.
service-captcha-lab.com/index.php?mod=captchas

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question