lessthanoptimal / boofcv Goto Github PK
View Code? Open in Web Editor NEWFast computer vision library for SFM, calibration, fiducials, tracking, image processing, and more.
Home Page: http://boofcv.org
Fast computer vision library for SFM, calibration, fiducials, tracking, image processing, and more.
Home Page: http://boofcv.org
Add a parameter to the TemplteMacher that
allows ti to ignore alpha channel pixels on the
template while searching for matches on the image.
Hi, I am new to BoofCV. I use the Template Matching function in BoofCV, but i have a problem.
When my image not contain the template the result list return always one result, It correct?.
Serialization of the boofcv.struct.image.ImageBase class throws an java.io.NotSerializableException exception since it's member imageType of type boofcv.struct.image.ImageType is not serializable.
getSideLength does not seem to exist within georegression nor elsewhere (lines 168 and 169 of QuadPoseEstimator.java).
Is there a replacement, or a simple way to get the distance between two corners of a Quadrilateral_F64?
It looks like this is most likely a result of the various ConvertRaster methods not using the raster offsets when copying data out of the arrays.
The FactoryOrientation.sift
factory method doesn't accept a null pointer as the configuration. This looks like a oversight when comparing it to the FactoryOrientationAlgs.average_ii
and FactoryOrientationAlgs.sliding_ii
methods. Both of these methods will use a default configuration if a null pointer is passed. The boofcv.alg.feature.orientation.BenchmarkOrientation
test expects the factory method to accept a null pointer and fails to run because of this.
For calibration with square patterns you are using a approach of specifying rows and columns including white space (left over from chess pattern I believe). This make the algorithm only work with patterns of uneven squares and also hard to use. Instead I suggest to use the real square amount in ConfigSquare and all its dependencies like for example PlanarDetectorSquareGrid:
- detect = new DetectSquareGridFiducial(config.numRows/2+1,config.numCols/2+1, + detect = new DetectSquareGridFiducial(config.numRows,config.numCols,
Hi, I am new to BoofCV. Please excuse my bad english.
I use your algorithm for create a mosaic from a BufferedImage sequence using StitchingFromMotion2D.(using the example ExampleVideoMosaic.java).
I would like to know. Is it possible to save the resulting full image, which includes use a all list of BufferedImage. Not the GUI that displays the time when the procedure was initiated save photos ..like this
Planar foo = stitch.getStitchedImage ();
UtilItageIO.saveImage (ConvertBufferedImage.convertTo_F32 (foo, null, true), "stitched.png");
And if It's possible how to do it?
Thanks in advance. Greatly appreciate if you could help.
Best Regards,
Biorthogonal-5 passes all test but has very poor denoising and appears much brighter in wavelet transform than other coefficients.
The addString
method in FancyInterestPointRender
performs a no-op. Should this method be deprecated?
When running IntensityFeatureScaleSpaceApp and setting it to use ImageUInt8 images intensity images become corrupt for larger scale spaces. Most likely due to a buffer overflow error
When not using an explicit image type like BufferedImage.TYPE_3BYTE_BGR the colors of the created output are wrong. Following code interchanges red by blue:
MultiSpectral srcImg = ConvertBufferedImage.convertFromMulti(imageOrigin, null, ImageFloat32.class); try { ImageIO.write(ConvertBufferedImage.convertTo(srcImg, null), "png", new File("converted.png")); } catch (IOException ignored) { }
i can not download georegression version 9.0 , i can not run this project
Error:(21, 34) java: package georegression.struct.point does not exist
Error:(23, 27) java: package org.ddogleg.sorting does not exist
From Bill Ross [email protected]:
BoofCV RGB->HSV conversion agrees with http://www.rapidtables.com/convert/color/rgb-to-hsv.htm
double[] hsv = new double[3];
ColorHsv.rgbToHsv(rr, gg, bb, hsv);
System.out.println("hsv " + hsv[0] + " " + hsv[1] + " " + hsv[2]);
Back to XYZ, from here http://colormine.org/convert/rgb-to-xyz
for [1 20 30] I get the same as easyrgb, xyz = 0.4970170548743872 0.600502213773958 1.3180083206339976
So that might indicate a bug in ColorXyz.srgbToXyz(). Looking at the code, the matrix factors agree with http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html for sRGB/D65 to 3 or 4 figures.
Looking at the conversion code here: http://www.easyrgb.com/index.php?X=MATH&H=02#text2
The factors are the same as yours and Lindbloom's site, but other conditional math gets done before the matrix multiplication- this is the missing link.
Hi Peter, Thank you so much for this Lib. I am trying to compile it and found that I am getting errors like:
BoofCV/main/feature/src/boofcv/factory/feature/associate/FactoryAssociation.java:25: package org.ddogleg.nn does not exist
[javac] import org.ddogleg.nn.NearestNeighbor
I searched for classes in ddogleg, but couldn't find the nn package, or NearestNeighnor class.
Many thanks!
Sincerely,
Wei
0.23-SNAPSHOT does not exist anymore.
BoofCV fails to load tiff images in MediaManager.
I think it is related to a bug in Java/ImageIO not returning a valid image type when loading tiff files (it is 0). In DefaultMediaManager there is the member openImage which needs the type to reconstruct an image.
This seems to be a hack already, so I have an additional hack for it:
b.getType() != 0 ? b.getType() : (b.getSampleModel().getNumBands() > 1 ? BufferedImage.TYPE_BYTE_RGB : BufferedImage.TYPE_BYTE_GRAY)
The hack above might break special image color formats which I am not aware of, but works for images I get from GigE sources (color and monochrome). Probably TYPE_BYTE_RGB is to much and an other type might appropriate as default.
The detailed exception:
java.lang.IllegalArgumentException: Unknown image type 0
at java.awt.image.BufferedImage.(BufferedImage.java:509)
at boofcv.io.wrapper.DefaultMediaManager.openImage(DefaultMediaManager.java:74)
at test.BoofLoader.main(BoofLoader.java:19)
Hi Peter
When I feed an Image into the canny edge detector which is solid black, the process method does not seem to ever return.
example:
BufferedImage solidBlack = ImageIO.read(new File("black.png"); //loads solid black image
ImageUInt8 gray = ConvertBufferedImage.convertFrom(solidBlack , (ImageUInt8) null);
CannyEdge<ImageUInt8, ImageSInt16> canny = FactoryEdgeDetectors.canny(2, false, true, ImageUInt8.class, ImageSInt16.class);
float THRESHOLD_LOW = 0.075f, THRESHOLD_HIGH = 0.3f;
canny.process(gray, THRESHOLD_LOW, THRESHOLD_HIGH, gray); //<-- never returns
I solved this with a workaround which checks first if the image is entirely black:
public static boolean isSolidBlack(ImageUInt8 img){
for(byte b : img.data){
if(b != 0){
return false;
}
}
return true;
}
Here is what I get:
xuggle#xuggle-xuggler;5.4: not found
Example file https://github.com/lessthanoptimal/BoofCV/blob/master/examples/src/boofcv/examples/segmentation/ExampleSegmentSuperpixels.java for boofcv v0.19 fails with
java.lang.IllegalArgumentException: Expected 4 bands in dst not 3
at boofcv.io.image.ConvertBufferedImage.convertFromMulti(ConvertBufferedImage.java:400)
at boofcv.io.image.ConvertBufferedImage.convertFrom(ConvertBufferedImage.java:201)
when using the below rectangle image for Fh04
How can this be solved?
Hi! Most examples works OK, but I have some compilation errors with 2 methods (getFitQuality() and getModelParameters() ). Eclipse shows error like these:
The method getFitQuality() is undefined for the type LeastMedianOfSquares<ScaleTranslateRotate2D,AssociatedPair> SparseFlowObjectTracker.java /BoofCV/src/boofcv/alg/tracker/sfot line 127 Java Problem
.....
The method getModelParameters() is undefined for the type LeastMedianOfSquares<ScaleTranslate2D,AssociatedPair> TldAdjustRegion.java /BoofCV/src/boofcv/alg/tracker/tld line 74 Java Problem
I'm using the last sources commited that include FastQueue moved to DDogleg
Any help please?
Thanks in advance,
Juan Pablo
The ConvertBufferedImage
class uses the default constructors of the various ImageBase implementors. It then sets the various fields directly before returning its results.
Unfortunately the imageType
field is not initialized by any of the methods.
This means that the returned images cannot be used by for example the new FDistort
class.
The following is an example of a operation that cannot be applied to the returned images:
new FDistort(found, output).interpNN().scale().apply();
the doc for InterestPointDetector.getOrientation() states, "...If orientation is not supported by the detector then 0 is always returned." However, some InterestPointDetector wrappers throw an IllegalArgumentException if this method is called. The offending classes are:
boofcv.abst.feature.detect.interest.WrapFLPtoInterestPoint,
boofcv.abst.feature.detect.interest.WrapFLSStoInterestPoint,
boofcv.abst.feature.detect.interest.WrapFPtoInterestPoint,
and boofcv.abst.feature.detect.interest.WrapFSStoInterestPoint.
boofcv.alg.filter.binary.GThresholdImageOps#hysteresisLabel4
and boofcv.alg.filter.binary.GThresholdImageOps#hysteresisLabel8
should return the number of blobs found.
Hello,
Just imported project from git with IntelliJ Idea and got compilation error.
FactoryWaveletDaub class uses org.ejml.interfaces.linsol.LinearSolver class which is not present in
<dependency>
<groupId>com.googlecode.efficient-java-matrix-library</groupId>
<artifactId>ejml</artifactId>
<version>0.24</version>
</dependency>
While later ejml jar version has it. Is it wrong dependency?
I can't find this package according to this example
Hello!
First i would like to congratulate the lib, it helped me a lot!
But I'm having a trouble using wavelet transform in an image Java. I tried specifically the Haar and Daubechies transform.
Could you give a code example of how doing it to a bufferedImage, since the reading to writing?
Thank you!
Currently the NonMaxCandidates are working with a radius, so width and height are always equal, it would be nice to be able to specify width and height of the interest separately.
I spotted a minor discrepancy in version # and git tags.
The latest tagged version (in github) is v0.14.1
. However, on maven central, and in this project's README, the latest version is 0.24.1
. I believe that the v0.14.1
tag should be renamed to 0.24.1
.
Michele Zannoni says:
Hi, I've got some problem with the CreateFiducialSquareImage process. The result file fiducial.ps is not standard and I can't open on OSX with adobe o any system software.
I've opened the file with a text editor and there was the data, but I can't open it with any other software.
This is an issue created for a Bounty. The bounty is for adding the capability of reading Aruco's makers in BoofCV. BoofCV already has much of the code required to read ArUco markers, but needs the ability to read their binary format and create their dictionaries. All of which are documented in Aruco papers.
Hello,
I am trying to run your code for point association with surf and I got an ArrayOutOfBoundsEcxeption at:
FATAL EXCEPTION: main
java.lang.ArrayIndexOutOfBoundsException
at boofcv.alg.feature.describe.impl.ImplSurfDescribeOps.gradientInner(ImplSurfDescribeOps.java:149)
at boofcv.alg.feature.describe.SurfDescribeOps.gradient_noborder(SurfDescribeOps.java:92)
at boofcv.alg.feature.orientation.impl.ImplOrientationAverageIntegral_I32.compute(ImplOrientationAverageIntegral_I32.java:69)
at boofcv.abst.feature.describe.WrapDescribeSurf.process(WrapDescribeSurf.java:87)
at com.nobm.stereocamera.InterestPointAssociator.describeImage(InterestPointAssociator.java:151)
with indexes:
length = 460800
r = 6 w = 13
indexSrc1 452677
indexSrc2 456517
indexSrc3 457157
indexSrc4 460997
image size is 640X720.
It seems that the check for bounds was successful while it actually isn't.
Any help will be much appreciated.
Thanks,
Oleg.
Hi,
first of all: Thanks for the great library!
In the Canny Edge Example (http://boofcv.org/index.php?title=Example_Canny_Edge), the example code uses the method VisualizeBinaryData.renderExternal, which I found neither in the 0.26 release nor in the snapshot. I guess it was changed to VisualizeBinaryData.render at some point.
The JavaDoc of the ThresholdImageOps methods has the following:
If the down flag is set to true then the inlier set
is defined as <= to the the threshold and >= if true.
The second true should be false.
For this task several simple usability enhancements are requested for the example and demonstration applications, which are written using Swing and share a common code base. None of the requested improvements are technically difficult for those familiar with Swing and you’re encouraged to ask questions if not sure how to complete a task.
For details see the Google Doc
For amount of bounty see http://boofcv.org/index.php?title=Bounties
The ConvertBufferedImage.extractInterlacedInt8 uses the width of the input as the stride. The stride of the input raster can be found using the getScanlineStride() method.
In addition shouldn't this method be called extractInterleavedInt8 ?
Hi,
the method render(List contours , int colors[] , BufferedImage out) assumes that the provided contours are numbered from 1 to contours.size().
This results in an ArrayIndexOutOfBoundsException if this is not the case:
List<Contour> contours = new ArrayList<>();
Contour c = new Contour();
c.id = 5;
contours.add(c);
BufferedImage image = new BufferedImage(512, 512,BufferedImage.TYPE_INT_RGB);
VisualizeBinaryData.render(contours, (int[]) null, image);
Is this intended behavior? If not, I propose similar behavior to two of the renderContours methods:
Instead of using
int color = colors[c.id-1];
to look up the color increment the index:
int index = 0;
for( Contour c : contours ) {
int color = colorExternal[index++];
...
DetectEdgeContour is a good base of detecting structures in images. The problem is that currently the returned pixel list is not ordered. But the ordering is an important structure information and helpful for further extraction computation like line extraction.
Hello,
converting a BufferedImage to Multispectral, then HSV and back works, but i think there is something wrong with it. After conversion i got some strange magenta contours in the destination image without doing any modification in the image:
BufferedImage buffered = UtilImageIO.loadImage("source.jpg"); MultiSpectral input = ConvertBufferedImage.convertFromMulti(buffered, null, true, ImageFloat32.class); MultiSpectral hsv = new MultiSpectral(ImageFloat32.class, input.width, input.height, 3); ColorHsv.rgbToHsv_F32(input, hsv); ColorHsv.hsvToRgb_F32(hsv, input); buffered = ConvertBufferedImage.convertTo_F32(input, null, true); UtilImageIO.saveImage(buffered, "destination.jpg");
I have a PNG which is decoded as TYPE_4BYTE_ABGR, as soon as I want to convert to Planar it fails:
java.lang.IllegalArgumentException: Unequal number of bands src = 4 dst = 3
at boofcv.io.image.ConvertRaster.multToBuffered_U8(ConvertRaster.java:1599)
at boofcv.io.image.ConvertBufferedImage.convertTo_U8(ConvertBufferedImage.java:736)
at boofcv.io.image.ConvertBufferedImage.convertTo(ConvertBufferedImage.java:606)
Which translates to, use Point2D_I32 instead of Point2D_I16. Also it should check the image width/height that it is within the bounds of the supported size. When I tried to use a 32k+ wide image, i was getting out-of-bounds errors for when it found a template at around -32k; I then figured out it was because the X greater than 2^15 was getting wrapped around in the signed 16-bit int.
Hey Peter. Great work on this awesome library. I was using the PointTrackerKltPyramid and got a null pointer exception.
I read the source code, and it looks like you missed an initialization in one of the constructors.
public PointTrackerKltPyramid(KltConfig config,
int templateRadius ,
PyramidDiscrete<I> pyramid,
ImageGradient<I, D> gradient,
InterpolateRectangle<I> interpInput,
InterpolateRectangle<D> interpDeriv,
Class<D> derivType ) {
this.config = config;
this.templateRadius = templateRadius;
this.gradient = gradient;
this.basePyramid = pyramid;
KltTracker<I, D> klt = new KltTracker<I, D>(interpInput, interpDeriv,config);
tracker = new PyramidKltTracker<I, D>(klt);
}
You didn't initialize the derivType member variable. The fixed constructor will be:
public PointTrackerKltPyramid(KltConfig config,
int templateRadius ,
PyramidDiscrete<I> pyramid,
ImageGradient<I, D> gradient,
InterpolateRectangle<I> interpInput,
InterpolateRectangle<D> interpDeriv,
Class<D> derivType ) {
this.config = config;
this.templateRadius = templateRadius;
this.gradient = gradient;
this.basePyramid = pyramid;
//// The added line
this.derivType = derivType;
KltTracker<I, D> klt = new KltTracker<I, D>(interpInput, interpDeriv,config);
tracker = new PyramidKltTracker<I, D>(klt);
}
I use georegression 8.0 on gradle like
compile group: 'org.georegression', name: 'georegression', version: '0.8'
i can download this lib but can not run, because ddogleg have not output.setTo
Method , just have output.set
i use ddogleg v0.7
First of all, thanks for this library!
I'm getting this with Java 9 early access:
Exception in thread "main" java.lang.IllegalAccessError: class boofcv.io.image.ConvertBufferedImage (in unnamed module @0x53ce1329) cannot access class sun.awt.image.ByteInterleavedRaster (in module java.desktop) because module java.desktop does not export sun.awt.image to unnamed module @0x53ce1329
at boofcv.io.image.ConvertBufferedImage.convertFrom(ConvertBufferedImage.java:389)
at boofcv.io.image.ConvertBufferedImage.convertFromSingle(ConvertBufferedImage.java:295)
I try to run video mosaic example, image not stitching, just stabilization, i'm use netbeans 8 and JDK 8
To simplify build procedure who has no build tools, I recommend to add Gradle wrapper to Git repo.
The following NullPointerException is thrown when the ImplOrientationImageAverageIntegral constructor is invoked:
java.lang.NullPointerException
at boofcv.alg.feature.orientation.impl.ImplOrientationImageAverageIntegral.setObjectRadius(ImplOrientationImageAverageIntegral.java:91)
at boofcv.alg.feature.orientation.OrientationIntegralBase.<init>(OrientationIntegralBase.java:87)
at boofcv.alg.feature.orientation.impl.ImplOrientationImageAverageIntegral.<init>(ImplOrientationImageAverageIntegral.java:56)
at boofcv.alg.feature.orientation.impl.ImplOrientationImageAverageIntegralTest.testConstructor(ImplOrientationImageAverageIntegralTest.java:10)
[...]
This is caused by the base class OrientationIntegralBase
calling the setObjectRadius(double radius)
template method before the ImplOrientationImageAverageIntegral.sampler
field have been initialized.
The following unit test will trigger the exception.
package boofcv.alg.feature.orientation.impl;
import boofcv.struct.image.ImageFloat32;
import boofcv.struct.sparse.GradientValue_F32;
import org.junit.Test;
public class ImplOrientationImageAverageIntegralTest {
@Test
public void testConstructor() {
new ImplOrientationImageAverageIntegral<ImageFloat32, GradientValue_F32>(0.5, 6, 1, 4, 0, ImageFloat32.class);
}
}
In ConvertBufferedImages.checkInputs there a gray scale image is only returned when the src image type is ImageInt16. But it should return a gray scale not by type but by src band width.
Hello,
I am working on the boofcv template matching feature, so it works well in case when my image has a template. But when my image does not contain any template still it return a result match found. So my question is if the image does not contain the template how can it find a match for it.
Thanks and Regards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.