I have an output from Sobel edge detector and I want to go through all the pixels of the resulting IplImage to find out the standard deviation (white pixels) in JavaCV.
Is there any function like getPixels()
for IplImage
?
I am new to JavaCV so any help would be much appreciated.
Asked
Active
Viewed 369 times
0
-
Why are you using IplImage? You really should use Mat instead of it. To answer your question have a look at this: http://stackoverflow.com/questions/14877383/iplimage-pixel-access-javacv – David_D May 23 '15 at 22:00
-
try not to use javaCV, but opencv's own java api. and then, iterating over pixels is a terrible idea in java. **never** try to do that. instead, use [meanStddev()](http://docs.opencv.org/java/org/opencv/core/Core.html#meanStdDev(org.opencv.core.Mat,%20org.opencv.core.MatOfDouble,%20org.opencv.core.MatOfDouble)) – berak May 24 '15 at 05:01
-
@berak Could you give me a Link or an short explanation why iterating over pixels is bad in java? I didn't knew that. Thanks – David_D May 24 '15 at 09:00
-
because it's gross slow, error-prone, and you're totally defeating the purpose of a high level computer-vision library ? – berak May 24 '15 at 10:08
-
Thank you for the link. but when I write the code for converting IplImage to Mat, cvGetMat() method shows me an error saying that the method is undefined. I have to use Javacv. – user_ng May 27 '15 at 07:42