158
if (mxGetNumberOfDimensions(input) != 2) {
159
reportError("Invalid dimensionality of base matrix, 2D matrix is expected");
163
if (mxGetClassID(input) != mxUINT8_CLASS) {
164
reportError("Invalid type of image data, should be 8bit integers");
168
if ((mxGetN(input) != width)||(mxGetM(input) != height)) {
169
reportError("Invalid size of image (%ix%i), but (%ix%i) is expected", mxGetN(input), mxGetM(input), width, height);
173
dictLoadImage(ps, (unsigned char*)mxGetData(input));
164
class_id = mxGetClassID(input);
167
if (mxGetNumberOfDimensions(input) != 2) {
168
reportError("Invalid dimensionality of base matrix, 2D matrix is expected");
172
if ((mxGetN(input) != width)||(mxGetM(input) != height)) {
173
reportError("Invalid size of image (%ix%i), but (%ix%i) is expected", mxGetN(input), mxGetM(input), width, height);
177
dictLoadImage(ps, (unsigned char*)mxGetData(input));
180
if ((mxGetNumberOfDimensions(input) != 2)&&(mxGetM(input) != 1)) {
181
reportError("Only a single string is supported");
185
length = mxGetN(input);
186
chars = mxGetChars(input);
188
if (length > MAX_FILE_NAME) {
189
reportError("File name is too long, limit is %i", MAX_FILE_NAME);
193
for (int i = 0; i < length; i++) {
194
if (chars[i] > 255) {
195
reportError("Unicode file names are not supported yet");
202
err = dictLoadImageFile(ps, name);
204
reportError("Failed to load image: %s", name);
209
reportError("Invalid type of image data, should be 8bit integers");
175
213
case ACTION_COMPUTE_BASE:
177
215
reportError("ComputeBase action expects 1 argument, but %i is passed", nrhs - 2);
183
if (mxGetNumberOfDimensions(base) != 2) {
184
reportError("Invalid dimensionality of base matrix, 2D matrix is expected");
188
if (mxGetClassID(base) != mxUINT8_CLASS) {
189
reportError("Invalid matrix. The data type (%s) is not supported", mxGetClassName(base));
193
width = mxGetN(base);
194
height = mxGetM(base);
196
dictLoadTemplateImage(ps, (unsigned char*)mxGetData(base), width, height);
221
class_id = mxGetClassID(base);
225
if (mxGetNumberOfDimensions(base) != 2) {
226
reportError("Invalid dimensionality of base matrix, 2D matrix is expected");
230
width = mxGetN(base);
231
height = mxGetM(base);
233
dictLoadTemplateImage(ps, (unsigned char*)mxGetData(base), width, height);
236
if ((mxGetNumberOfDimensions(base) != 2)&&(mxGetM(base) != 1)) {
237
reportError("Only a single string is supported");
241
length = mxGetN(base);
242
chars = mxGetChars(base);
244
if (length > MAX_FILE_NAME) {
245
reportError("File name is too long, limit is %i", MAX_FILE_NAME);
249
for (int i = 0; i < length; i++) {
250
if (chars[i] > 255) {
251
reportError("Unicode file names are not supported yet");
258
err = dictLoadTemplateImageFile(ps, name);
260
reportError("Failed to load image: %s", name);
265
reportError("Invalid matrix. The data type (%s) is not supported", mxGetClassName(base));
198
269
case ACTION_SET_BASE_POINTS: