214 Commits

Author SHA1 Message Date
Michael Russo
b2159a5b3a Add MeanStdDevWithMask for cv::meanStdDev with the optional mask. 2025-04-18 08:14:16 +02:00
deadprogram
672042bf29 core: add ReshapeWithSize() to provide specific control over the reshape operation
Signed-off-by: deadprogram <ron@hybridgroup.com>
2025-04-09 08:34:22 -03:00
deadprogram
bd83700f33 feature: return error from calls to OpenCV functions. The error shows the OpenCV exception description
from the exception caught.

Signed-off-by: deadprogram <ron@hybridgroup.com>
2025-03-18 11:04:10 -03:00
deadprogram
a9fec5bda3 feature: add exception handling function and try/catch blocks
Signed-off-by: deadprogram <ron@hybridgroup.com>
2025-03-18 11:04:10 -03:00
diegohce
beec074600 added new Mat constructor and tests 2024-12-02 18:02:37 +01:00
diegohce
069827749e added NewMatFromPoint2fVector function 2024-11-21 10:58:34 -03:00
diegohce
93960c462f added missing cuda imgproc standalone functions 2024-09-24 09:38:52 +01:00
deadprogram
88c11e5fb2 core, cuda: add Closed() function to Mat/GpuMat
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-09-15 17:49:25 +02:00
diegohce
3b57c20779 BasicFaceRecognizer + EigenFaceRecognizer + FisherFaceRecognizer (#1213)
contrib/face: BasicFaceRecognizer + EigenFaceRecognizer + FisherFaceRecognizer
2024-09-03 09:35:14 +02:00
diegohce
6728b8ca83 RotatedRect type constructors 2024-08-21 11:10:38 +02:00
deadprogram
774ddceced core: add OpenCV types for half-float values
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-08-19 13:06:25 +02:00
deadprogram
475ceeaf26 core: add TransposeND() function
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-06-26 12:34:37 +02:00
deadprogram
a573f59836 core: add MulTransposed() function
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-10-21 10:21:04 +02:00
deadprogram
0a0682d3cb core: add SVBackSubst() and SVDecomp() functions
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-10-21 10:21:04 +02:00
deadprogram
63e234f57c core: add PSNR() function
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-10-21 10:21:04 +02:00
deadprogram
0920808fa3 core: add PCABackProject() and PCAProject() functions
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-10-21 10:21:04 +02:00
deadprogram
cf89b448fe core: add Mahalanobis(), Inv(), Row(), amd Col() functions
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-10-21 10:21:04 +02:00
Michael Russo
97afa6f54d Add func comments and update readme. 2023-10-17 21:40:32 +02:00
Michael Russo
1e61906d49 Add additional signature for MinMaxLoc. 2023-10-17 21:40:32 +02:00
deadprogram
f3641a85f4 all: correct formatting
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-10-12 00:10:33 +02:00
Ryan Heacock
7e101c350c Fixes parameter ordering for new PCACompute function
Realized after testing this implementation that I had the parameter
names inverted on this. Since they are both output parameters it doesn't
impact functinality so the smoke test still worked.

This change corrects the name order so that the doc is correct.
2023-06-15 22:02:47 +02:00
Ryan Heacock
3b4e6162fe Adds support for PCACompute
This PR adds support for PCACompute via wrapping one of the opencv
versions with this function signature. A smoke test has been added that
calls the wrapped function and verifies that the parameters are being
passed correctly.

In opencv there are four versions with this function signature, I have
chosen to wrap (what I think is) the most common with the most
parameters.

Link to supported functionality now: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga4e2073c7311f292a0648f04c37b73781
2023-06-14 08:43:53 +02:00
Josh Christie
213b6e75c6 Add ReduceArgMax and ReduceArgMin 2023-03-13 16:46:36 +01:00
Jinwoo Park (Curt)
50da617dd6 Add the number of thread setter and getter 2023-01-02 12:23:04 +01:00
pancpp
dc2c2c429a Add Mat.ElemSize (#964)
core: Add Mat.ElemSize
2022-04-21 15:41:32 +02:00
HearyShen
edb5483240 core: avoid index out of range panic in NewPointsVectorFromPoints 2022-04-03 16:17:51 +02:00
Reda
6b45d1af1f drawDetectedMarkers
DetectorParameters struct

TestArucoDetectorParams

Use DetectorParams

DrawDetectedMarkers

TestDrawDetectMarkers

clean up

Remove duplicate Contour2f

test DrawMarker

Dictionary

clean up

clean up

LDFLAGS add  -lopencv_aruco453
2021-10-26 22:18:24 +02:00
jiaru.yuan
df1d5e200c Add feature calibrate camera
update compare method in testcase
2021-08-17 08:26:00 +02:00
Solganik Alexander
5dbdee404a imencode: optimize IMEncode avoiding multiple data copies.
Currently IMEncode implemented the following way:
1) In Image_IMEncode std::vector is allocated and filled by cv::imencode
2) In Image_IMEncode function toByteArray allocated another native array
and copies the data from the vector
3) In IMEncode the result of Image_IMEncode is further copied to golang
allocated byte array.

Hence there are 2 additional copies of the data for each call to
IMEncode.
This is highly inefficient, especially if this needs to be performed
frequently.

The solution is to avoid copies altogether (though with a slight API
cost).
First we introduce NativeByteBuffer struct which is just a wrapper for
std::vector. Note that it is hard-coded 24 bytes (std::vector is 3
pointers of data, and this will never change as this will force
recompilation of probably every existing c++ application).

Second We call Image_IMEncode with this "preallocated" and
pre-initialied std::vector.

Finally the "func (buffer *NativeByteBuffer) GetBytes() []byte" function
returns a hand-made slice from the underlying std::vector buffer.

Note that we both provide a "Close" function and register "finalizer" to
clear the native buffer when NativeByteBuffer goes out of scope.

Usage Example:

buf, err := IMEncode(PNGFileExt, img)
defer buf.Close()
bytes := buf.GetBytes()
2021-07-12 11:10:02 +02:00
deadprogram
be08b213cf core: add NewPointVectorFromMat() and NewPoint2fVectorFromMat() functions
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-05-17 09:26:32 +02:00
snowcrumble
81744fdc0a use enum instead of int for Invert Method 2021-03-25 12:21:06 +01:00
deadprogram
3f30107e85 core: test coverage for Point2f
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-03-07 23:31:59 +01:00
deadprogram
391c616201 core: add Append() to PointsVector/PointVector
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-03-07 23:31:59 +01:00
deadprogram
6b7549b64e core: add implementation for Point2fVector
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-03-07 23:31:59 +01:00
deadprogram
1cd64c70d4 core: use PointVector for everything that we can to speed up pipeline when passing around Point vectors
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-03-07 23:31:59 +01:00
deadprogram
854f525ef7 core: create new PointsVector/PointVector wrappers to avoid repetitive memory copying for seeming innocent operations involving slices of image.Point
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-03-07 23:31:59 +01:00
snowcrumble
13a322a924 add rand functions 2021-01-14 11:54:25 +01:00
lijingfeng
74658ea300 add cv::RNG 2021-01-12 18:51:19 +01:00
Aleksandar Golubović
b090d9e34b Add created mats in Split and ForwardLayers to profile (#780)
profile: Add created mats in Split and ForwardLayers to profile
test: Close previously unclosed mats in tests
2020-12-13 21:18:00 +01:00
Ron Evans
fa6036d0e3 core: remove guard for DataPtrUint8 since any Mat can be treated an Uint8
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2020-12-13 21:06:52 +01:00
Ron Evans
a8a9540c7f core: add Mat IsContinuous() function, and ensure that any Mat data pointers used to create Go slices only apply to continuous Mats
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2020-12-10 20:00:58 +01:00
Josh
23427541b9 Add multidimensional mat creation 2020-11-28 18:04:23 +01:00
deadprogram
d208c7caba Resolves merge conflicts with PR 2020-11-28 17:19:35 +01:00
Kim Eik
7f525fdbcb added norm call with two mats (#600)
core: added norm call with two mats
2020-11-08 13:02:52 +01:00
Florin Pățan
5af13f37f2 Fix buffer size
This will allow compilation on 32bit Raspberry Pi OSes
2020-11-07 12:11:29 +01:00
Sebastian Terhorst
3d2ebdc926 add ndim mat constructor 2020-11-01 18:16:51 +01:00
Bruno Albuquerque
751329f5a4 Keep a reference to a []byte that backs a Mat. (#755)
core: prevents crashes when Mats created with NewMatFromBytes are used, by keeping a reference to a []byte that backs a Mat.
2020-10-30 05:51:22 +01:00
Omri Treidel
67301b1740 I244 add mat init rebased (#758)
core: Add Matrix initializers: eye, ones, zeros
2020-10-28 07:23:48 +01:00
Marc Navarro
eec3fce165 core: add mixChannels() method to Mat (#746)
* core: add mixChannels() method to Mat
2020-10-21 22:48:10 +02:00
Omri Treidel
390b7d7756 Add DetectAndDecodeMulti
* C strings to Go strings
2020-10-21 07:31:12 +02:00