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

Multiple intent to broadcast
Attempt to invoke virtual method 'boolean java.util.ArrayList.isEmpty()' on a null object reference
Can I add autocomplete feature to my alert input dialog?
Java RSS Feed Reader Android Studio
Android Lollipop Set Status Bar Text Color
Location updates using google fused API client don't work
isReachable not working in android studio
CardView Click state not working [closed]
Performance Testing for Native Mobile Applications
Overriding string resources from module/library that have translations in Android
Android: how to change menu item at page scrolling with ViewPager?
transfer udp packets in android
Android SqliteAssetHelper copy user saved data
Android Studio - XML Serialization and XML Validation against .xsd schema
How to have a parallax effect between 2 ViewPagers?
SecurityException when calling BluetoothAdapter.getDefaultAdapter

Categories

HOME
scikit-learn
cobalt
c++11
codenvy
css3
swt
static
vscode-extensions
square
google-schemas
project-intu
jsonpath
selectize.js
jmp
user-experience
kendo-mobile
exit
object-storage
linked-data
datastax-enterprise-graph
ntp
testbed
turfjs
r-grid
hreflang
reactjs.net
swagger-php
wurfl
graphhopper
dm-script
android-augmented-reality
c9.io
kill
laravel-elixir
claims
congestion-control
memory-mapping
linter
jquery-ui-draggable
convex-optimization
azure-cli
opengl-4
skin
check-mk
css-transforms
type-theory
restore
docpad
cortex-m
realsense
kendo-upload
httpruntime.cache
qt5.2
doctype
atoi
jdk1.7
liquid-layout
jsvc
osc
xmltype
delayed-execution
spy++
device-tree
encryption-asymmetric
named-parameters
cuba
xml-dsig
ray
cfcache
spring-3
http-patch
inputmismatchexception
tlf
wp7test
jquery-blockui
apache-whirr
jdb
user-tracking
screen-size
update-statement
inline-formset
cdonts
svk
load-time
aspmenu
wcf-instancing

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