change image to NDArray

This commit is contained in:
Bechir
2024-03-21 16:17:00 +01:00
parent c7ee7f3af4
commit 4ff2e18c6a
7 changed files with 109 additions and 109 deletions

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "aare/Image.hpp" #include "aare/NDArray.hpp"
#include "aare/defs.hpp" #include "aare/defs.hpp"
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
@ -47,8 +47,8 @@ class Frame {
} }
template <typename T> template <typename T>
Image<T> image() { NDArray<T> image() {
return Image<T>(this->view<T>()); return NDArray<T>(this->view<T>());
} }
~Frame() { delete[] m_data; } ~Frame() { delete[] m_data; }

View File

@ -7,7 +7,7 @@ memory.
TODO! Add expression templates for operators TODO! Add expression templates for operators
*/ */
#include "aare/View.hpp" #include "aare/NDView.hpp"
#include <algorithm> #include <algorithm>
#include <array> #include <array>
@ -19,47 +19,47 @@ TODO! Add expression templates for operators
#include <numeric> #include <numeric>
template <typename T, ssize_t Ndim = 2> class Image { template <typename T, ssize_t Ndim = 2> class NDArray {
public: public:
Image() NDArray()
: shape_(), strides_(c_strides<Ndim>(shape_)), size_(0), : shape_(), strides_(c_strides<Ndim>(shape_)), size_(0),
data_(nullptr){}; data_(nullptr){};
explicit Image(std::array<ssize_t, Ndim> shape) explicit NDArray(std::array<ssize_t, Ndim> shape)
: shape_(shape), strides_(c_strides<Ndim>(shape_)), : shape_(shape), strides_(c_strides<Ndim>(shape_)),
size_(std::accumulate(shape_.begin(), shape_.end(), 1, size_(std::accumulate(shape_.begin(), shape_.end(), 1,
std::multiplies<ssize_t>())), std::multiplies<ssize_t>())),
data_(new T[size_]){}; data_(new T[size_]){};
Image(std::array<ssize_t, Ndim> shape, T value) : Image(shape) { NDArray(std::array<ssize_t, Ndim> shape, T value) : NDArray(shape) {
this->operator=(value); this->operator=(value);
} }
/* When constructing from a View we need to copy the data since /* When constructing from a NDView we need to copy the data since
Image expect to own its data, and span is just a view*/ NDArray expect to own its data, and span is just a view*/
Image(View<T, Ndim> span):Image(span.shape()){ NDArray(NDView<T, Ndim> span):NDArray(span.shape()){
std::copy(span.begin(), span.end(), begin()); std::copy(span.begin(), span.end(), begin());
// fmt::print("Image(View<T, Ndim> span)\n"); // fmt::print("NDArray(NDView<T, Ndim> span)\n");
} }
// Move constructor // Move constructor
Image(Image &&other) NDArray(NDArray &&other)
: shape_(other.shape_), strides_(c_strides<Ndim>(shape_)), : shape_(other.shape_), strides_(c_strides<Ndim>(shape_)),
size_(other.size_), data_(nullptr) { size_(other.size_), data_(nullptr) {
data_ = other.data_; data_ = other.data_;
other.reset(); other.reset();
// fmt::print("Image(Image &&other)\n"); // fmt::print("NDArray(NDArray &&other)\n");
} }
// Copy constructor // Copy constructor
Image(const Image &other) NDArray(const NDArray &other)
: shape_(other.shape_), strides_(c_strides<Ndim>(shape_)), : shape_(other.shape_), strides_(c_strides<Ndim>(shape_)),
size_(other.size_), data_(new T[size_]) { size_(other.size_), data_(new T[size_]) {
std::copy(other.data_, other.data_ + size_, data_); std::copy(other.data_, other.data_ + size_, data_);
// fmt::print("Image(const Image &other)\n"); // fmt::print("NDArray(const NDArray &other)\n");
} }
~Image() { ~NDArray() {
delete[] data_; delete[] data_;
} }
@ -68,19 +68,19 @@ template <typename T, ssize_t Ndim = 2> class Image {
using value_type = T; using value_type = T;
Image &operator=(Image &&other); // Move assign NDArray &operator=(NDArray &&other); // Move assign
Image &operator=(const Image &other); // Copy assign NDArray &operator=(const NDArray &other); // Copy assign
Image operator+(const Image &other); NDArray operator+(const NDArray &other);
Image &operator+=(const Image &other); NDArray &operator+=(const NDArray &other);
Image operator-(const Image &other); NDArray operator-(const NDArray &other);
Image &operator-=(const Image &other); NDArray &operator-=(const NDArray &other);
Image operator*(const Image &other); NDArray operator*(const NDArray &other);
Image &operator*=(const Image &other); NDArray &operator*=(const NDArray &other);
Image operator/(const Image &other); NDArray operator/(const NDArray &other);
// Image& operator/=(const Image& other); // NDArray& operator/=(const NDArray& other);
template <typename V> template <typename V>
Image &operator/=(const Image<V, Ndim> &other) { NDArray &operator/=(const NDArray<V, Ndim> &other) {
// check shape // check shape
if (shape_ == other.shape()) { if (shape_ == other.shape()) {
for (int i = 0; i < size_; ++i) { for (int i = 0; i < size_; ++i) {
@ -88,26 +88,26 @@ template <typename T, ssize_t Ndim = 2> class Image {
} }
return *this; return *this;
} else { } else {
throw(std::runtime_error("Shape of Image must match")); throw(std::runtime_error("Shape of NDArray must match"));
} }
} }
Image<bool, Ndim> operator>(const Image &other); NDArray<bool, Ndim> operator>(const NDArray &other);
bool operator==(const Image &other) const; bool operator==(const NDArray &other) const;
bool operator!=(const Image &other) const; bool operator!=(const NDArray &other) const;
Image &operator=(const T &); NDArray &operator=(const T &);
Image &operator+=(const T &); NDArray &operator+=(const T &);
Image operator+(const T &); NDArray operator+(const T &);
Image &operator-=(const T &); NDArray &operator-=(const T &);
Image operator-(const T &); NDArray operator-(const T &);
Image &operator*=(const T &); NDArray &operator*=(const T &);
Image operator*(const T &); NDArray operator*(const T &);
Image &operator/=(const T &); NDArray &operator/=(const T &);
Image operator/(const T &); NDArray operator/(const T &);
Image &operator&=(const T &); NDArray &operator&=(const T &);
void sqrt() { void sqrt() {
for (int i = 0; i < size_; ++i) { for (int i = 0; i < size_; ++i) {
@ -115,7 +115,7 @@ template <typename T, ssize_t Ndim = 2> class Image {
} }
} }
Image &operator++(); // pre inc NDArray &operator++(); // pre inc
template <typename... Ix> template <typename... Ix>
typename std::enable_if<sizeof...(Ix) == Ndim, T &>::type typename std::enable_if<sizeof...(Ix) == Ndim, T &>::type
@ -153,7 +153,7 @@ template <typename T, ssize_t Ndim = 2> class Image {
// return strides_; // return strides_;
} }
View<T, Ndim> span() const { return View<T, Ndim>{data_, shape_}; } NDView<T, Ndim> span() const { return NDView<T, Ndim>{data_, shape_}; }
void Print(); void Print();
void Print_all(); void Print_all();
@ -175,7 +175,7 @@ template <typename T, ssize_t Ndim = 2> class Image {
// Move assign // Move assign
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> &Image<T, Ndim>::operator=(Image<T, Ndim> &&other) { NDArray<T, Ndim> &NDArray<T, Ndim>::operator=(NDArray<T, Ndim> &&other) {
if (this != &other) { if (this != &other) {
delete[] data_; delete[] data_;
data_ = other.data_; data_ = other.data_;
@ -188,14 +188,14 @@ Image<T, Ndim> &Image<T, Ndim>::operator=(Image<T, Ndim> &&other) {
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> Image<T, Ndim>::operator+(const Image &other) { NDArray<T, Ndim> NDArray<T, Ndim>::operator+(const NDArray &other) {
Image result(*this); NDArray result(*this);
result += other; result += other;
return result; return result;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> & NDArray<T, Ndim> &
Image<T, Ndim>::operator+=(const Image<T, Ndim> &other) { NDArray<T, Ndim>::operator+=(const NDArray<T, Ndim> &other) {
// check shape // check shape
if (shape_ == other.shape_) { if (shape_ == other.shape_) {
for (int i = 0; i < size_; ++i) { for (int i = 0; i < size_; ++i) {
@ -208,15 +208,15 @@ Image<T, Ndim>::operator+=(const Image<T, Ndim> &other) {
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> Image<T, Ndim>::operator-(const Image &other) { NDArray<T, Ndim> NDArray<T, Ndim>::operator-(const NDArray &other) {
Image result{*this}; NDArray result{*this};
result -= other; result -= other;
return result; return result;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> & NDArray<T, Ndim> &
Image<T, Ndim>::operator-=(const Image<T, Ndim> &other) { NDArray<T, Ndim>::operator-=(const NDArray<T, Ndim> &other) {
// check shape // check shape
if (shape_ == other.shape_) { if (shape_ == other.shape_) {
for (int i = 0; i < size_; ++i) { for (int i = 0; i < size_; ++i) {
@ -228,15 +228,15 @@ Image<T, Ndim>::operator-=(const Image<T, Ndim> &other) {
} }
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> Image<T, Ndim>::operator*(const Image &other) { NDArray<T, Ndim> NDArray<T, Ndim>::operator*(const NDArray &other) {
Image result = *this; NDArray result = *this;
result *= other; result *= other;
return result; return result;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> & NDArray<T, Ndim> &
Image<T, Ndim>::operator*=(const Image<T, Ndim> &other) { NDArray<T, Ndim>::operator*=(const NDArray<T, Ndim> &other) {
// check shape // check shape
if (shape_ == other.shape_) { if (shape_ == other.shape_) {
for (int i = 0; i < size_; ++i) { for (int i = 0; i < size_; ++i) {
@ -249,21 +249,21 @@ Image<T, Ndim>::operator*=(const Image<T, Ndim> &other) {
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> Image<T, Ndim>::operator/(const Image &other) { NDArray<T, Ndim> NDArray<T, Ndim>::operator/(const NDArray &other) {
Image result = *this; NDArray result = *this;
result /= other; result /= other;
return result; return result;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> &Image<T, Ndim>::operator&=(const T &mask) { NDArray<T, Ndim> &NDArray<T, Ndim>::operator&=(const T &mask) {
for (auto it = begin(); it != end(); ++it) for (auto it = begin(); it != end(); ++it)
*it &= mask; *it &= mask;
return *this; return *this;
} }
// template <typename T, ssize_t Ndim> // template <typename T, ssize_t Ndim>
// Image<T, Ndim>& Image<T, Ndim>::operator/=(const Image<T, Ndim>& // NDArray<T, Ndim>& NDArray<T, Ndim>::operator/=(const NDArray<T, Ndim>&
// other) // other)
// { // {
// //check shape // //check shape
@ -278,9 +278,9 @@ Image<T, Ndim> &Image<T, Ndim>::operator&=(const T &mask) {
// } // }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<bool, Ndim> Image<T, Ndim>::operator>(const Image &other) { NDArray<bool, Ndim> NDArray<T, Ndim>::operator>(const NDArray &other) {
if (shape_ == other.shape_) { if (shape_ == other.shape_) {
Image<bool> result{shape_}; NDArray<bool> result{shape_};
for (int i = 0; i < size_; ++i) { for (int i = 0; i < size_; ++i) {
result(i) = (data_[i] > other.data_[i]); result(i) = (data_[i] > other.data_[i]);
} }
@ -291,8 +291,8 @@ Image<bool, Ndim> Image<T, Ndim>::operator>(const Image &other) {
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> & NDArray<T, Ndim> &
Image<T, Ndim>::operator=(const Image<T, Ndim> &other) { NDArray<T, Ndim>::operator=(const NDArray<T, Ndim> &other) {
if (this != &other) { if (this != &other) {
delete[] data_; delete[] data_;
shape_ = other.shape_; shape_ = other.shape_;
@ -305,7 +305,7 @@ Image<T, Ndim>::operator=(const Image<T, Ndim> &other) {
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
bool Image<T, Ndim>::operator==(const Image<T, Ndim> &other) const { bool NDArray<T, Ndim>::operator==(const NDArray<T, Ndim> &other) const {
if (shape_ != other.shape_) if (shape_ != other.shape_)
return false; return false;
@ -317,78 +317,78 @@ bool Image<T, Ndim>::operator==(const Image<T, Ndim> &other) const {
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
bool Image<T, Ndim>::operator!=(const Image<T, Ndim> &other) const { bool NDArray<T, Ndim>::operator!=(const NDArray<T, Ndim> &other) const {
return !((*this) == other); return !((*this) == other);
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> &Image<T, Ndim>::operator++() { NDArray<T, Ndim> &NDArray<T, Ndim>::operator++() {
for (int i = 0; i < size_; ++i) for (int i = 0; i < size_; ++i)
data_[i] += 1; data_[i] += 1;
return *this; return *this;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> &Image<T, Ndim>::operator=(const T &value) { NDArray<T, Ndim> &NDArray<T, Ndim>::operator=(const T &value) {
std::fill_n(data_, size_, value); std::fill_n(data_, size_, value);
return *this; return *this;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> &Image<T, Ndim>::operator+=(const T &value) { NDArray<T, Ndim> &NDArray<T, Ndim>::operator+=(const T &value) {
for (int i = 0; i < size_; ++i) for (int i = 0; i < size_; ++i)
data_[i] += value; data_[i] += value;
return *this; return *this;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> Image<T, Ndim>::operator+(const T &value) { NDArray<T, Ndim> NDArray<T, Ndim>::operator+(const T &value) {
Image result = *this; NDArray result = *this;
result += value; result += value;
return result; return result;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> &Image<T, Ndim>::operator-=(const T &value) { NDArray<T, Ndim> &NDArray<T, Ndim>::operator-=(const T &value) {
for (int i = 0; i < size_; ++i) for (int i = 0; i < size_; ++i)
data_[i] -= value; data_[i] -= value;
return *this; return *this;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> Image<T, Ndim>::operator-(const T &value) { NDArray<T, Ndim> NDArray<T, Ndim>::operator-(const T &value) {
Image result = *this; NDArray result = *this;
result -= value; result -= value;
return result; return result;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> &Image<T, Ndim>::operator/=(const T &value) { NDArray<T, Ndim> &NDArray<T, Ndim>::operator/=(const T &value) {
for (int i = 0; i < size_; ++i) for (int i = 0; i < size_; ++i)
data_[i] /= value; data_[i] /= value;
return *this; return *this;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> Image<T, Ndim>::operator/(const T &value) { NDArray<T, Ndim> NDArray<T, Ndim>::operator/(const T &value) {
Image result = *this; NDArray result = *this;
result /= value; result /= value;
return result; return result;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> &Image<T, Ndim>::operator*=(const T &value) { NDArray<T, Ndim> &NDArray<T, Ndim>::operator*=(const T &value) {
for (int i = 0; i < size_; ++i) for (int i = 0; i < size_; ++i)
data_[i] *= value; data_[i] *= value;
return *this; return *this;
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> Image<T, Ndim>::operator*(const T &value) { NDArray<T, Ndim> NDArray<T, Ndim>::operator*(const T &value) {
Image result = *this; NDArray result = *this;
result *= value; result *= value;
return result; return result;
} }
template <typename T, ssize_t Ndim> void Image<T, Ndim>::Print() { template <typename T, ssize_t Ndim> void NDArray<T, Ndim>::Print() {
if (shape_[0] < 20 && shape_[1] < 20) if (shape_[0] < 20 && shape_[1] < 20)
Print_all(); Print_all();
else else
Print_some(); Print_some();
} }
template <typename T, ssize_t Ndim> void Image<T, Ndim>::Print_all() { template <typename T, ssize_t Ndim> void NDArray<T, Ndim>::Print_all() {
for (auto row = 0; row < shape_[0]; ++row) { for (auto row = 0; row < shape_[0]; ++row) {
for (auto col = 0; col < shape_[1]; ++col) { for (auto col = 0; col < shape_[1]; ++col) {
std::cout << std::setw(3); std::cout << std::setw(3);
@ -397,7 +397,7 @@ template <typename T, ssize_t Ndim> void Image<T, Ndim>::Print_all() {
std::cout << "\n"; std::cout << "\n";
} }
} }
template <typename T, ssize_t Ndim> void Image<T, Ndim>::Print_some() { template <typename T, ssize_t Ndim> void NDArray<T, Ndim>::Print_some() {
for (auto row = 0; row < 5; ++row) { for (auto row = 0; row < 5; ++row) {
for (auto col = 0; col < 5; ++col) { for (auto col = 0; col < 5; ++col) {
std::cout << std::setw(7); std::cout << std::setw(7);
@ -408,7 +408,7 @@ template <typename T, ssize_t Ndim> void Image<T, Ndim>::Print_some() {
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
void save(Image<T, Ndim> &img, std::string pathname) { void save(NDArray<T, Ndim> &img, std::string pathname) {
std::ofstream f; std::ofstream f;
f.open(pathname, std::ios::binary); f.open(pathname, std::ios::binary);
f.write(img.buffer(), img.size() * sizeof(T)); f.write(img.buffer(), img.size() * sizeof(T));
@ -416,9 +416,9 @@ void save(Image<T, Ndim> &img, std::string pathname) {
} }
template <typename T, ssize_t Ndim> template <typename T, ssize_t Ndim>
Image<T, Ndim> load(const std::string &pathname, NDArray<T, Ndim> load(const std::string &pathname,
std::array<ssize_t, Ndim> shape) { std::array<ssize_t, Ndim> shape) {
Image<T, Ndim> img{shape}; NDArray<T, Ndim> img{shape};
std::ifstream f; std::ifstream f;
f.open(pathname, std::ios::binary); f.open(pathname, std::ios::binary);
f.read(img.buffer(), img.size() * sizeof(T)); f.read(img.buffer(), img.size() * sizeof(T));

View File

@ -6,7 +6,7 @@
#include <vector> #include <vector>
#include "aare/Image.hpp" #include "aare/NDArray.hpp"
const int MAX_CLUSTER_SIZE = 200; const int MAX_CLUSTER_SIZE = 200;
namespace pl { namespace pl {
@ -31,9 +31,9 @@ template <typename T> class ClusterFinder {
private: private:
const std::array<ssize_t, 2> shape_; const std::array<ssize_t, 2> shape_;
NDView<T, 2> original_; NDView<T, 2> original_;
Image<int, 2> labeled_; NDArray<int, 2> labeled_;
Image<int, 2> peripheral_labeled_; NDArray<int, 2> peripheral_labeled_;
Image<bool, 2> binary_; // over threshold flag NDArray<bool, 2> binary_; // over threshold flag
T threshold_; T threshold_;
NDView<T, 2> noiseMap; NDView<T, 2> noiseMap;
bool use_noise_map = false; bool use_noise_map = false;
@ -56,7 +56,7 @@ template <typename T> class ClusterFinder {
hits.reserve(2000); hits.reserve(2000);
} }
Image<int, 2> labeled() { return labeled_; } NDArray<int, 2> labeled() { return labeled_; }
void set_noiseMap(NDView<T, 2> noise_map) { noiseMap = noise_map; use_noise_map = true; } void set_noiseMap(NDView<T, 2> noise_map) { noiseMap = noise_map; use_noise_map = true; }
void set_peripheralThresholdFactor(int factor) { peripheralThresholdFactor_ = factor; } void set_peripheralThresholdFactor(int factor) { peripheralThresholdFactor_ = factor; }

View File

@ -1,6 +1,6 @@
#include <aare/NDView.hpp> #include <aare/NDView.hpp>
#include <aare/Frame.hpp> #include <aare/Frame.hpp>
#include <aare/View.hpp> #include <aare/NDView.hpp>
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <cstdint> #include <cstdint>
@ -34,29 +34,29 @@ TEST_CASE("NDView") {
REQUIRE(ds(i / 10, i % 10) == data[i]); REQUIRE(ds(i / 10, i % 10) == data[i]);
} }
} }
// SECTION("from Frame") { SECTION("from Frame") {
// Frame f(reinterpret_cast<std::byte *>(data), 10, 10, 16); Frame f(reinterpret_cast<std::byte *>(data), 10, 10, 16);
// View<uint16_t> ds = f.view<uint16_t>(); NDView<uint16_t> ds = f.view<uint16_t>();
// for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
// REQUIRE(ds(i / 10, i % 10) == data[i]); REQUIRE(ds(i / 10, i % 10) == data[i]);
// } }
// f.set(0, 0, (uint16_t)44); f.set(0, 0, (uint16_t)44);
// REQUIRE((uint16_t)*f.get(0, 0) == 44); // check that set worked REQUIRE((uint16_t)*f.get(0, 0) == 44); // check that set worked
// REQUIRE(ds(0, 0) == 44); // check that ds is updated REQUIRE(ds(0, 0) == 44); // check that ds is updated
// REQUIRE(data[0] == 0); // check that data is not updated REQUIRE(data[0] == 0); // check that data is not updated
// } }
delete[] data; delete[] data;
} }
TEST_CASE("Image") { TEST_CASE("NDArray") {
auto data = new uint16_t[100]; auto data = new uint16_t[100];
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
data[i] = i; data[i] = i;
} }
SECTION("from Frame") { SECTION("from Frame") {
Frame f(reinterpret_cast<std::byte *>(data), 10, 10, 16); Frame f(reinterpret_cast<std::byte *>(data), 10, 10, 16);
Image<uint16_t> img = f.image<uint16_t>(); NDArray<uint16_t> img = f.image<uint16_t>();
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
REQUIRE(img(i / 10, i % 10) == data[i]); REQUIRE(img(i / 10, i % 10) == data[i]);
} }

View File

@ -7,7 +7,7 @@
"x": 1, "x": 1,
"y": 2 "y": 2
}, },
"Image Size in bytes": 524288, "NDArray Size in bytes": 524288,
"Pixels": { "Pixels": {
"x": 1024, "x": 1024,
"y": 256 "y": 256

View File

@ -7,7 +7,7 @@
"x": 1, "x": 1,
"y": 1 "y": 1
}, },
"Image Size in bytes": 1048576, "NDArray Size in bytes": 1048576,
"Pixels": { "Pixels": {
"x": 1024, "x": 1024,
"y": 512 "y": 512

View File

@ -7,7 +7,7 @@
"x": 1, "x": 1,
"y": 1 "y": 1
}, },
"Image Size in bytes": 15360, "NDArray Size in bytes": 15360,
"Pixels": { "Pixels": {
"x": 3840, "x": 3840,
"y": 1 "y": 1