Solving digit-only captcha - command-line

There is a captcha which I'm trying to solve, I know its always digits.
When i try the command tesseract cap.png cap it returns empty page !!!
When I try command tesseract cap.png cap -psm 6 digits && cat cap.txt it returns:
[root#usa1 ~]# tesseract cap.png cap -psm 7 digits && cat cap.txt
Tesseract Open Source OCR Engine v3.05.00dev with Leptonica
Info in pixReadStreamPng: converting (cmap + alpha) ==> RGBA
Info in pixReadStreamPng: converting 8 bpp cmap with alpha ==> RGBA
41-1-8 5
and also:
[root#usa1 ~]# tesseract cap.png cap -psm 7 digits && cat cap.txt
Tesseract Open Source OCR Engine v3.05.00dev with Leptonica
Info in pixReadStreamPng: converting (cmap + alpha) ==> RGBA
Info in pixReadStreamPng: converting 8 bpp cmap with alpha ==> RGBA
7 5
The captcha sample is :
The main goal is to achieve an accurate result, and also I noticed that running the same command twice wont make any difference on result so I wont be able to run it for example 3 times and compare the different results right?
And as for empty page error I guess somehow i need to make the quality of png file higher, am I wrong?

Related

Swift MPSCNNConvolution -- weights all set to 1, shouldn't the output look just like the input?

Trying to figure out how to use MPSCNNConvolution. I have a 4 x 3 image, and a 4 x 3 kernel. I'm setting all the weights to 1, and all the inputs to 1, and I sort of expected to get all 1's back. What I get instead is
12 9 6 3
8 6 4 2
4 3 2 1
The problem is that I don't know whether it's supposed to behave like this or not. I've been all over every shred of Apple doc I can find, every online article, every github repo, and I can't find anything that says what kind of output to expect when the layer is set up correctly.
The pattern holds for differently sized images. A 3 x 2 gives me
6 4 2
3 2 1
And a 2 x 2 gives me
4 2
2 1
I've pushed my "minimal" example to github. It's not small. Xcode 12.4 no longer supports Float16, so there's utility code for floating between Float16 and Float32, plus all the convoluted setup for convolution, and yet more code for trying to un-headache un-safe pointers.
My specific questions: is this output "just the normal behavior" for MPSCNNConvolution? Is there a name for this function/algorithm, something I can look up?
The documentation for MPSCNNConvolution is slightly confusing. To the uninitiated, it might seem that MPSCNNConvolution is a kind of container that holds convolution kernels. This is not the case. MPSCNNConvolution is itself a kernel. Specifically, it weights and sums all the input values under the kernel window. Just a straight sum, no averaging or maxing. What you're seeing is the result of the kernel starting at (0, 0) and sliding way off the right edge, and eventually way off the bottom edge.
Set your kernel offset and your clip rectangle on the input image, and MPSCNNConvolution will work the same way as MPSCNNPooling* kernels and all the others

Why do I receive the error 'count must be integer multiple of packet size' when using USB1408FS?

When using USB-1408FS I get the following error:
count must be integer multiple of packet size for continuous mode.
I know that the packet size is 32 and the count must be a multiple of that. The code only works when the number of repeats (in this code it is 5) is under 7. When I put number 8 on (which makes 32) it gives me that error. And anything above 8 does not work.
nchannel=1;
AO=analogoutput('mcc',0);
set(AO,'BufferingMode','manual');
set(AO,'BufferingConfig',[128 2]);
addchannel(AO, [0:nchannel-1]);
samplerate=500;
sampleinterval=1/samplerate;
set(AO,'SampleRate',samplerate);
set(AO, 'TriggerType','Manual');
ActualRate=get(AO,'SampleRate');
%%set up desired output vector
V4 = 4
outputvector = repmat([0;1;1;0],5,1)*V
%%Load device memory
putdata(AO,outputvector);
start(AO);
%%trigger output
trigger(AO)
Any help will be appreciated.

using export_fig with Matlab2016b

I'm trying to use export_fig (latest version altmany-export_fig-5ad44c4) with Matlab2016b (Windows10, 64 bit, gs9.20). Settings of my graphics card are given below.
plot(cos(linspace(0, 7, 1000)));
export_fig('test1.png','test1.pdf')
print('test2.pdf','-dpdf')
The png-file is generated but the pdf-file contains only a gray box. I don't get any error message from export_fig. The native Matlab print command produces a correct pdf-file which has a lot of white space around the plot. To get rid of it I'd like to use export_fig.
Any help would be greatly appreciated. Thanks a lot.
Cheers
Heiner
opengl info
Version: '4.5.13399 Compatibility Profile Context 15.201.1151.1008'
Vendor: 'ATI Technologies Inc.'
Renderer: 'AMD RADEON HD 6450'
RendererDriverVersion: '15.201.1151.1008'
RendererDriverReleaseDate: '04-Nov-2015'
MaxTextureSize: 16384
Visual: 'Visual 0x08, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buffer, Antialias 4 samples)'
Software: 'false'
HardwareSupportLevel: 'full'
SupportsGraphicsSmoothing: 1
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 1
Extensions: {266×1 cell}
MaxFrameBufferSize: 16384

Equivalent command matlab<>opencv

Does anyone knows what is the equivalent command for logical (matlab) for opencv? I saw that the bit depth for a logical image(1 channel) is equal to '1'. For a normal 1 channel image, we can set it to 8U or 32F (meaning, the bit depth is 8, 32). Am I right? The reason I'm asking because when I tried thinning using matlab, image(logical) and image(uint8 # im2double) give different results.
In MATLAB, logical type has a size of 1 byte. Try the following:
>> x = true
x =
1
>> whos x
Name Size Bytes Class Attributes
x 1x1 1 logical
So the equivalent to a logical image in OpenCV would be 8U image with a single-channel

How to set number of digits for float point output in Ipython

In octave the output of float point numbers is limited by default to 4 digits (%.4f). Is there a way to set this behavior using IPython?
If you are using numpy a lot, then numpy.set_printoptions lets you tweak that.
Another option is to use the magic %precision command (only in IPython 0.11 or greater).
I guess that you can put your defaults in your startup configuration file.
%precision also takes a format argument, eg like this (gives you 2 digit precision and non-scientific format):
%precision %.2f
If you want to set the precision to 6 digits, try this:
%precision 6