Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
com.github.soranakk.oofqrreader:image-converter-android-camera
Advanced tools
OutOfFocusQRReader is a library for reading QR codes from out-of-focus images on Android.
OutOfFocusQRReader is a library for reading QR Code from out-of-focus images on Android.
This library uses the OpenCV library.
“QR Code” is a registered trademark of DENSO WAVE INCORPORATED.
Download the latest version of the OpenCV Android library from the official OpenCV web page.
Extract the files the downloaded zip file and move the SDK folder to your project root folder.
Edit the settings.gradle
file in your project and sync your project:
// add
include ':sdk'
Edit the build.gradle
file in your project:
repositories {
mavenCentral()
}
dependencies {
// OpenCV sdk
implementation project(':sdk')
// core
implementation 'com.github.soranakk.oofqrreader:oofqrreader:1.0.0'
}
dependencies {
...
implementation 'com.github.soranakk.oofqrreader:image-converter-android-camera:1.0.0'
}
val imageConverter = Camera2ApiImageConverter()
ImageReader.newInstance(width, height, ImageFormat.YUV_420_888, 1)
.apply {
setOnImageAvailableListener({ reader ->
reader?.acquireLatestImage()?.let { image ->
val imageData = imageConverter.convertImage(image)
... read QR Code
image.close()
}
}, workerHandler)
dependencies {
...
implementation 'com.github.soranakk.oofqrreader:image-converter-androidx-camera:1.0.0'
}
val imageConverter = CameraXApiImageConverter()
val imageAnalysis = ImageAnalysis.Builder()
.setTargetRotation(Surface.ROTATION_0)
.setTargetResolution(Size(1280, 720))
.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
.build()
.also {
it.setAnalyzer(cameraExecutor, ImageAnalysis.Analyzer { image ->
val imageData = imageConverter.convertImage(image)
... read QR Code
image.close()
})
}
dependencies {
...
implementation 'com.github.soranakk.oofqrreader:decoder-mlkit:1.0.0'
implementation 'com.google.mlkit:barcode-scanning:16.1.1'
}
val mlKitDecoder = MLKitDecoder()
dependencies {
...
implementation 'com.github.soranakk.oofqrreader:decoder-zxing:1.0.0'
implementation "com.google.zxing:core:3.4.1"
}
val zxingDecoder = ZxingDecoder()
If your app require Android minSdkVersion less than 24, see https://github.com/zxing/zxing/issues/1170 and demoApp's build.gradle
dependencies {
...
implementation 'com.github.soranakk.oofqrreader:decoder-opencv:1.0.0'
}
val openCVDecoder = OpenCVDecoder()
val qrReader = MultiFilterQRCodeReader(someDecoder)
val result = qrReader.detectAndRead(image)
See demoApp for more info.
Estimate the area where a QR code exists by using the large contrast between the QR code and the background.
Imgproc.erode
to thicken the dots in a QR code and turn them into black squares.Imgproc.findContours
to get the black square areaFurther improve the accuracy by processing the image of the estimated area using various Image Filters. The features of each ImageFilter implemented are as follows.
Binarize with a weighted average using Gaussian as a threshold at a fixed block size.
Input image
Estimate the area where a QR code exists
After applying the image filter
Binarize Otsu's method.
Input image
Estimate the area where a QR code exists
After applying the image filter
A filter for reading overexposed QR codes by setting a threshold so that even almost white areas become black. Most input images output a black image, but under certain circumstances this filter works well. For example, displaying a QR code on a smartphone will result in overexposure due to the strong backlight of the smartphone.
Input image
Estimate the area where a QR code exists
After applying the image filter
FAQs
OutOfFocusQRReader is a library for reading QR codes from out-of-focus images on Android.
We found that com.github.soranakk.oofqrreader:image-converter-android-camera demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.