android


adaptiveThreshold getting blank (full white) image


I want to apply adaptiveThreshold using open cv library to my bitmap image, but once i do with following code, it shows blank (full white) image, please help me to resolve it.
following is code:
Mat grayMat = imread(getImageUri(this, photo).getPath(), IMREAD_GRAYSCALE);
Mat resultMat = new Mat();
Imgproc.adaptiveThreshold(grayMat, resultMat, 255, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, 3, 40);
Bitmap imgBitmap = Bitmap.createBitmap(resultMat.cols(), resultMat.rows(), Bitmap.Config.ARGB_8888);
Add following line after init. bitmap
Utils.matToBitmap(resultMat, imgBitmap);
and load imgBitmap to your ImageView, I hope this will solve your problem.

Related Links

How to calculate multiplication of 2 values that is coming from another activity using Intent in android?
How can update the Realm DB when the JSON updates
How to return only first result hit from Google Drive?
How to pass data from an activity to a fragment in TabHost?
pjsip2 issue during build
Captured image cropping issue
Tweets are not posted using Fabric
How to root Genymotion Android Emulator?
cannot run emulator in android studio and in genymotion
What is the meaning of switchSearch() method, KWS_SEARCH attribute, and parameter of startListening() method, in the demo project?
Adding onClick to RecyclerView Android [duplicate]
RecyclerView Hide behind AppbarLayout?
How to display image with intent.ACTION_VIEW
NDK Error occured while importing telegram source code from github
Picking only images from gallery Android
Getting thread error in ui automation android

Categories

HOME
batch-file
google-cloud-platform
paraview
delphi-7
developer-tools
alexa-skills-kit
mjml
pyqt
powerpoint
obfuscation
composite-primary-key
devise
telegram-bot
babeljs
hpc
nuget-package
32bit-64bit
line
dynamic-sql
powershell-v5.0
google-content-api
shortest-path
asp.net-core-webapi
undertow
r-mice
interpreter
jquery-callback
opentk
jackson-modules
comparable
constexpr
aws-codecommit
r-grid
hard-drive
hibernate-search
sharding
pdw-file-browser
git-rewrite-history
dm-script
sessionstorage
apache-stanbol
ntvs
openrasta
podscms
boxing
truezip
monkey
tinkerpop3
observablecollection
shopping
stream-processing
nupic
libav
grass
tfs-workitem
coda
dronekit-android
rdflib
cwrsync
code-documentation
adehabitathr
spy++
rickshaw
device-tree
strawberry-perl
android-framework
authlogic
fpdi
gd-graph
mbunit
traceability
server-administration
cardreader
fb.ui
curb
extreme-programming
correlated-subquery
fsevents
massive
xui
cdonts
django-piston
change-management

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App