Reviving DCV help needed [Computer Vision library for D]
Ki Rill
rill.ki at yahoo.com
Fri Oct 29 03:47:37 UTC 2021
I was looking for a computer vision library for D. I know
[opencvd](https://code.dlang.org/packages/opencvd) package
exists. It uses OpenCV C interface.
I also stumbled upon DCV. It is a part of mir meta package. It
seems it is written from scratch. I really liked the code
examples. It stays true to the D spirit, so to speak. So I
decided to revive it on my free time.
I'd like to get some help if possible and/or any advise that will
help me save time and prevent me from going astray on my quest.
Who is the maintainer of DCV?
I was fixing all the 'depreciated' features and errors, and came
across this issue:
```D
.dub/packages/mir-algorithm-3.10.91/mir-algorithm/source/mir/ndslice/internal.d(192,5): Error: static assert: "dimension = 4LU at position 2LU should be less than N = 4LU
- - -
Error in function
mir.ndslice.dynamic.transposed!(0LU, 1LU,
4LU).transposed!(SliceIterator!(ZipIterator!(float*, float*),
1LU, mir_slice_kind.contiguous), 4LU,
mir_slice_kind.universal).transposed
- - -
Function prototype
mir.ndslice.dynamic.transposed!(0LU, 1LU,
4LU).transposed!(SliceIterator!(ZipIterator!(float*, float*),
1LU, mir_slice_kind.contiguous), 4LU,
mir_slice_kind.universal).transposed(Slice!(SliceIterator!(ZipIterator!(float*, float*), 1LU, mir_slice_kind.contiguous), 4LU, mir_slice_kind.universal) _slice)
_____"
source/dcv/multiview/stereo/matching.d(240,41):
instantiated from here:
`transposed!(SliceIterator!(ZipIterator!(float*, float*), 1LU,
mir_slice_kind.contiguous), 4LU, mir_slice_kind.universal)`
source/dcv/multiview/stereo/matching.d(188,12):
instantiated from here: `windowCost!((l, r) =>
reduce!sad(CostType(0), l, r))`
/Library/D/dmd/bin/dmd failed with exit code 1.
```
`transposed` comes from `mir-algorithm`.
I understand the constraints of `transposed`. It checks
`DimensionCTError`. But I'm having difficulties understanding
what DCV code does. It would be great if someone could help me
with this.
```
for(size_t d = 0; d < props.disparityRange; d++) {
costVol[0 .. $, 0 .. d, d] = CostType.max;
import mir.ndslice.dynamic;
costVol[0 .. $, d .. $, d] = zip!true(lpad[0 .. $, d .. $],
rpad[0 .. $, 0 .. $ - d])
.pack!1
.windows(windowSize, windowSize)
.unpack
.universal
.transposed!(0, 1, 4) // IT SEEMS ERROR OCCURS AT THIS LINE
(?)
.pack!2
.map!(x => fun(x.unzip!'a', x.unzip!'b'))
.pack!1
.map!sum
.unpack;
}
```
Any help is greatly appreciated.
More information about the Digitalmars-d
mailing list