Re: Camera profile generation options



On Mon, Feb 8, 2010 at 4:12 PM, Richard Hughes <hughsient gmail com> wrote:
> On 8 February 2010 15:04, Pascal de Bruijn <pmjdebruijn pcode nl> wrote:
>> Are camera profiles generated with Argyll's default options? -q m -a l ?
>>
>> This might be fine for IT8 or other targets with lots of patches...
>>
>> But it's probably not such a good idea for a 24 patch ColorChecker, -q
>> l -a S seems more appropriate...
>
> Yes, this is a good idea, and a perfect patch for you to submit :-)
>
> The kind of profile is listed in src/gcm-calibrate-argyll.h, which is
> saved to priv->reference_kind, which is private data for the
> GcmCalibrateArgyll object. You probably need to add a simple "if
> (priv->reference_kind ==
> GCM_CALIBRATE_ARGYLL_REFERENCE_KIND_COLOR_CHECKER)" rather than just
> getting the type of profile (using
> gcm_calibrate_argyll_precision_to_quality_arg) in the function
> gcm_calibrate_argyll_device_generate_profile() which lives in
> src/gcm-calibrate-argyll.c
>
> Make a few changes, and just do "git diff > test.patch"

I think this patch should do it, it seems to work, though I didn't
extensively test it.

I also included the QPcard as well, it's a similar target...

Regards,
Pascal de Bruijn
diff -Nurpd gcm-orig/src/gcm-calibrate-argyll.c gcm-hack/src/gcm-calibrate-argyll.c
--- gcm-orig/src/gcm-calibrate-argyll.c	2010-02-08 21:57:27.000000000 +0100
+++ gcm-hack/src/gcm-calibrate-argyll.c	2010-02-08 22:24:04.000000000 +0100
@@ -123,9 +123,9 @@ gcm_calibrate_argyll_precision_from_stri
  * gcm_calibrate_argyll_precision_to_quality_arg:
  **/
 static const gchar *
-gcm_calibrate_argyll_precision_to_quality_arg (GcmCalibrateArgyllPrecision precision)
+gcm_calibrate_argyll_precision_to_quality_arg (GcmCalibrateArgyllPrecision precision, GcmCalibrateArgyllReferenceKind reference_kind)
 {
-	if (precision == GCM_CALIBRATE_ARGYLL_PRECISION_SHORT)
+	if (precision == GCM_CALIBRATE_ARGYLL_PRECISION_SHORT || reference_kind == GCM_CALIBRATE_ARGYLL_REFERENCE_KIND_COLOR_CHECKER || reference_kind == GCM_CALIBRATE_ARGYLL_REFERENCE_KIND_QPCARD_201)
 		return "-ql";
 	if (precision == GCM_CALIBRATE_ARGYLL_PRECISION_NORMAL)
 		return "-qm";
@@ -674,7 +674,7 @@ gcm_calibrate_argyll_display_generate_pr
 	g_ptr_array_add (array, g_strdup_printf ("-M%s", model));
 	g_ptr_array_add (array, g_strdup_printf ("-D%s", description_new));
 	g_ptr_array_add (array, g_strdup_printf ("-C%s", copyright));
-	g_ptr_array_add (array, g_strdup (gcm_calibrate_argyll_precision_to_quality_arg (priv->precision)));
+	g_ptr_array_add (array, g_strdup (gcm_calibrate_argyll_precision_to_quality_arg (priv->precision, priv->reference_kind)));
 	g_ptr_array_add (array, g_strdup ("-as"));
 	g_ptr_array_add (array, g_strdup (basename));
 	argv = gcm_utils_ptr_array_to_strv (array);
@@ -962,8 +962,12 @@ gcm_calibrate_argyll_device_generate_pro
 	g_ptr_array_add (array, g_strdup_printf ("-M%s", model));
 	g_ptr_array_add (array, g_strdup_printf ("-D%s", description_tmp));
 	g_ptr_array_add (array, g_strdup_printf ("-C%s", copyright));
-	g_ptr_array_add (array, g_strdup (gcm_calibrate_argyll_precision_to_quality_arg (priv->precision)));
-//	g_ptr_array_add (array, g_strdup ("-as"));
+	g_ptr_array_add (array, g_strdup (gcm_calibrate_argyll_precision_to_quality_arg (priv->precision, priv->reference_kind)));
+
+	/* check whether the target is a low patch count target and generate low quality single shaper profile */
+	if (priv->reference_kind == GCM_CALIBRATE_ARGYLL_REFERENCE_KIND_COLOR_CHECKER || priv->reference_kind == GCM_CALIBRATE_ARGYLL_REFERENCE_KIND_QPCARD_201)
+		g_ptr_array_add (array, g_strdup ("-aS"));
+
 	g_ptr_array_add (array, g_strdup (basename));
 	argv = gcm_utils_ptr_array_to_strv (array);
 	gcm_calibrate_argyll_debug_argv (command, argv);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]