Giter Club home page Giter Club logo

lessthanoptimal / boofcv Goto Github PK

View Code? Open in Web Editor NEW
1.0K 1.0K 257.0 47.11 MB

Fast computer vision library for SFM, calibration, fiducials, tracking, image processing, and more.

Home Page: http://boofcv.org

Java 99.70% Python 0.06% Kotlin 0.23%
3d-reconstruction 3d-vision android aztec-code camera-calibration computer-vision image-processing java micro-qr-code micro-qrcode photogrammetry qr-code qrcode qrcode-generator qrcode-scanner stereo-vision structure-from-motion

boofcv's People

Contributors

boechat107 avatar bradh avatar docdoc avatar genietim avatar jairorotava avatar jenskapitza avatar jmankhan avatar lessthanoptimal avatar maxdoss3 avatar nobusue avatar npahucki avatar olegvakulenko avatar sergiuchuckmisha avatar thhart avatar xzvfinet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boofcv's Issues

QuadPoseEstimator

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?

FactoryOrientation.sift method doesn't accept null pointer as a configuration

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_iiand 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.

ConfigSquare cols and rows should be specified correct

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,

How to save full mosaic image

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 Daub Wavelet Bug?

Biorthogonal-5 passes all test but has very poor denoising and appears much brighter in wavelet transform than other coefficients.

  • Is this a bug?
  • If so how to fix it?

ConvertBufferedImage.convertTo creates wrong output

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) {
      }

Check to see if HSV, XYZ conversion is correct. Producing different results.

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.

package org.ddogleg.nn does not exist

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

Unable to load tiff files

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)

endless loop in canny edge detector

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;
}

ExampleSegmentSuperpixels Fails for FH04 for Attached Image

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
rectangle

How can this be solved?

Compile errors with methods getFitQuality() and getModelParameters()

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

ConvertBufferedImage class doesn't initialize ImageBase.imageType

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();

some implementations of InterestPointDetector have unexpected behavior

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.

Not able to run examples from IDE

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?

Wavelet Transform applied to an BufferedImage

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!

[minor] Latest tagged version != actual version

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.

Fiducial post script files unreadable in MacOS

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.

[Feature Request] ArUco markers in BoofCV

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.

Exception in Surf description

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.

JavaDoc error in ThresholdImageOps

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.

Exception in VisualizeBinaryData.render relating to colors

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 interface should support ordered pixels

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.

Converting to HSV and back to Multispectral

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:

after conversion

        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");

ConvertBufferedImage.convertTo fails for alpha band images

output
BoofCV 0.23

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)

TemplateMatching: support images wider or taller than 16k pixels

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.

Null Pointer Exception in PointTrackerKltPyramid

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);
}

can not download georegression v9.0

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

sun.awt.image.ByteInterleavedRaster gone in Java 9?

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)

convolution kernel order

  • When convolving kernels across an image they are done in the wrong order.
  • Minimal impact since almost all kernels used in computer vision are symmetric
  • Needs to be fixed and checked to make sure performance does not degrade

Video Mosaic Example

I try to run video mosaic example, image not stitching, just stabilization, i'm use netbeans 8 and JDK 8

Add Gradle wrapper

To simplify build procedure who has no build tools, I recommend to add Gradle wrapper to Git repo.

A NullPointerException is thrown when the ImplOrientationImageAverageIntegral constructor is invoked

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);
    }
}

Template Matching issue

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.