4 years ago (2017-01-16)  Algorithm language |   First to comment  11 
post score 0 times, average 0.0
[Slideup] Catalog

I have recently seen an article about the "Cracking algorithm" in the picture. I suddenly became interested in it, so I thought I could implement it.Due to the urgency of mathematics ability, the article's thoughts and related papers could not be understood.So find the relevant Java code on Github, the effect of the algorithm is very obvious:

[Picture removal algorithm practice] NDK two-dimensional array transfer

Before you go to the picture
[Picture removal algorithm practice] NDK two-dimensional array transfer

Detour algorithm processed image

I don't know if the algorithm is too complicated or because of the relatively low efficiency of Java. It takes about 20 seconds to process a 3M JPG image. The obvious effect of the algorithm led me to the idea of ​​developing a camera. In order to obtain faster processing speed, I decided to write it as C++ code after studying Java code, and then through NDK (Android native development). Ported to the Android platform. The basic idea of ​​the project is to obtain the Bitmap of the image in Android/Java and convert its pixels into a two-dimensional int two-dimensional array. Then the two-dimensional array of int is passed to the JNI layer, which is passed to the NDK layer C++ code processing, and the NDK layer processing. After returning to the end of the int two-dimensional array, from the Java layer to Bitmap re-display or save. After one day's struggle, I finally realized the implementation of the "go" algorithm using C++ code and successfully migrated to Android native development.The effect has been achieved, there are a lot of BUG, ​​when the image size is slightly larger, the algorithm takes too much time and memory.

[Picture removal algorithm practice] NDK two-dimensional array transfer

Android pictures go

This article is expected to write a series, follow-up may be open source under the circumstances.If you are interested in the practice of gossip algorithm, you can follow my simple book and blog: http://wangbaiyuan.cn, follow-up will continue to update

This article describes how the NDK and Java layers exchange two-dimensional arrays








This article has been printed on copyright and is protected by copyright laws. It must not be reproduced without permission.If you need to reprint, please contact the author or visit the copyright to obtain the authorization. If you feel that this article is useful to you, you can click the "Sponsoring Author" below to call the author!

Reprinted Note Source: Baiyuan's Blog>>https://wangbaiyuan.cn/en/practice-photo-haze-algorithm-under-ndk-two-dimensional-array-2.html

Post comment


No Comment


Forget password?